3 # checks the rootkit report file to see if anything is listed.
5 export CHKFILE=$TMP/test_for_rootkit_entries.txt
6 export QUIET_REPORT=/var/www/rootkit_report_quiet.txt
7 export LOUD_REPORT=/var/www/rootkit_report_expert.txt
9 # cgi text starting thing...
14 if [ ! -f $QUIET_REPORT ]; then
15 echo No file found for $QUIET_REPORT
19 grep "LKM Trojan" $QUIET_REPORT >$CHKFILE
21 if [ -z "$(cat $CHKFILE)" ]; then
22 echo found no content in the quiet report, skipping complaint.
28 echo found some content in the quiet report, looking up bad processes.
30 if [ ! -f $LOUD_REPORT ]; then
31 echo No file found for $LOUD_REPORT
35 grep "PID.*not in readdir output" $LOUD_REPORT >$CHKFILE
37 echo after the pid grep
39 if [ -z "$(cat $CHKFILE)" ]; then
40 echo "didn't find our expected phrase."
44 export BAD_PROCESS=$(sed -e "s/^.*PID *\([0-9][0-9]*\).*$/\1/" <$CHKFILE)
45 if [ -z "$BAD_PROCESS" ]; then
46 echo "didn't find our expected phrase."
49 echo bad process number is $BAD_PROCESS
51 echo bad proc command line is:
52 export CMDLINE=$(cat /proc/$BAD_PROCESS/cmdline)
55 if [ $BAD_PROCESS -ne 1 ]; then
57 if [ ! -z "$(echo $CMDLINE | grep ini)" ]; then
59 echo "How come the process $BAD_PROCESS is called \"$CMDLINE\""
60 echo "when the init process is always supposed to be process 1?"