Update tuto 3
This commit is contained in:
parent
12b62208bd
commit
beb834c01c
9 changed files with 1890 additions and 44 deletions
46
tutorial/3/check.sh
Executable file
46
tutorial/3/check.sh
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
#!/bin/sh
|
||||
|
||||
note_init() {
|
||||
NOTE=0
|
||||
echo -n $@
|
||||
}
|
||||
|
||||
note() {
|
||||
NOTE=$(($NOTE + $1))
|
||||
echo -n ,$@
|
||||
}
|
||||
|
||||
for LOGIN in $@
|
||||
do
|
||||
note_init $LOGIN
|
||||
|
||||
if [ -f "$LOGIN" ]; then
|
||||
QUESTIONSF="$LOGIN"
|
||||
else
|
||||
QUESTIONSF="$LOGIN/questions.txt"
|
||||
fi
|
||||
|
||||
# Questions
|
||||
|
||||
if grep -E -i "(grsec)" "${QUESTIONSF}" 2> /dev/null > /dev/null; then
|
||||
note 1
|
||||
else
|
||||
note 0
|
||||
fi
|
||||
|
||||
|
||||
if grep -E -i "(/proc/.*/oom_|score)" "${QUESTIONSF}" 2> /dev/null > /dev/null; then
|
||||
note 1
|
||||
else
|
||||
note 0
|
||||
fi
|
||||
|
||||
if grep -E -i "root" "${QUESTIONSF}" 2> /dev/null > /dev/null; then
|
||||
note 1
|
||||
else
|
||||
note 0
|
||||
fi
|
||||
|
||||
|
||||
echo #" = $NOTE"
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue