I'm writing a script to search for changes in suid programs. What I have so far is
but I'm still getting entries for /var/spool/cron/atjobs found. Any help with the find syntax would be gratefully recieved.
Ceci n'est pas une signature
Columb Healy
Code:
#!/bin/ksh
SUID_FILE=/var/log/suid.progs
suid_search()
{
find / \( -name proc -a -prune \) -o \( -name /var/spool/cron/atjobs -a -prune \) -o -type f -perm -04000 -ls 2>/dev/null
}
[[ "$1" = "reset" ]] && { suid_search > $SUID_FILE; exit; }
[[ -f $SUID_FILE ]] || { suid_search > $SUID_FILE; exit; }
suid_search > $SUID_FILE.$(date +%y%m%d)
diff $SUID_FILE $SUID_FILE.$(date +%y%m%d) > /tmp/suid.progs.$(date +%y%m%d) ||
mail -s "changed suid programs" me@home.server < /tmp/suid.progs.$(date +%y%m%d)
rm -f $SUID_FILE.$(date +%y%m%d) /tmp/suid.progs.$(date +%y%m%d)
but I'm still getting entries for /var/spool/cron/atjobs found. Any help with the find syntax would be gratefully recieved.
Ceci n'est pas une signature
Columb Healy