12.11_find_sgid_files.sh

This commit is contained in:
thibault.dewailly
2016-04-16 12:57:24 +02:00
parent d241ae57f9
commit fffd9842d6
5 changed files with 95 additions and 8 deletions

View File

@ -19,16 +19,15 @@ audit () {
for BINARY in $RESULT; do
if grep -q $BINARY <<< "$EXCEPTIONS"; then
debug "$BINARY is confirmed as an exception"
RESULT=$(sed '!'"$BINARY"'!d' <<< $RESULT)
RESULT=$(sed "s!$BINARY!!" <<< $RESULT)
fi
done
if [ ! -z "$RESULT" ]; then
crit "Some world writable file are present"
crit "Some suid files are present"
FORMATTED_RESULT=$(sed "s/ /\n/g" <<< $RESULT | sort | uniq | tr '\n' ' ')
crit "$FORMATTED_RESULT"
else
ok "No world writable files found"
ok "No unknown suid files found"
fi
}