#!/usr/bin/perl -w use strict; my $setuidtoday = "/var/log/setuid.today"; my $setuidyest = "/var/log/setuid.yesterday"; my $DIFF = "/usr/bin/diff"; print "Content-type: text/html\n\n"; print "<HTML><TITLE>SET SUID FILE CHECK</TITLE>\n"; print "<BODY BGCOLOR=#000000 Text=#008000 link=#00c000\n"; print "<H1>SET SUID FILE CHECK</H1>\n"; if(-e $setuidtoday && $setuidyest) { print "<H6>Setuid lists exist!</H6>\n"; print `$DIFF $setuidtoday $setuidyest`; } print "</BODY></HTML>";
It works fine at the CLI but the output from diff is not displayed in the webpage, I can see why that is but dont know how to fix the issue... Also if anyone has any improvements please say. The reason I have not used any modules for HTML prasing etc... is because I haven't got that far in my study and i'd like to see what I can code with base perl before I branch out.print `$DIFF $setuidtoday $setuidyest`;
In reply to SUID check by n00dles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |