Code:
    #!/usr/bin/perl -w use strict; my $setuidtoday = "/var/log/setuid.today"; my $setuidyest = "/var/log/setuid.yesterday"; my $DIFF = "/usr/bin/diff -u"; my $out = `$DIFF $setuidtoday $setuidyest`; print "Content-type: text/html\n\n"; print "<HTML><TITLE>SET SUID FILE CHECK</TITLE>\n"; print "<BODY BGCOLOR=#000000 Text=#008000 link=#00c000 vlink=lightblue +>\n"; print "<H1>SET SUID FILE CHECK</H1>\n"; if(-e $setuidtoday && -e $setuidyest) { print "<H6>Setuid lists exist!</H6>\n"; print "<CODE><BR>\n"; print "$out\n"; } #print `$DIFF $setuidtoday $setuidyest`; print "</BODY></HTML>";
CLI output:
    Content-type: text/html <HTML><TITLE>SET SUID FILE CHECK</TITLE> <BODY BGCOLOR=#000000 Text=#008000 link=#00c000 vlink=lightblue> <H1>SET SUID FILE CHECK</H1> <H6>Setuid lists exist!</H6> <CODE><BR> --- /var/log/setuid.today Wed Jul 12 03:03:52 2006 +++ /var/log/setuid.yesterday Fri Jun 30 03:03:13 2006 @@ -3,11 +3,11 @@ 31837 -r-sr-xr-x 1 root wheel 21792 Nov 3 08:10:37 2005 /sbin +/ping 31838 -r-sr-xr-x 1 root wheel 28660 Nov 3 08:10:37 2005 /sbin +/ping6 31850 -r-sr-x--- 1 root operator 10148 Nov 3 08:10:38 2005 /sbin +/shutdown -1040389 -rws--x--x 1 root wheel 3348 Oct 12 20:39:40 2005 /usr/ +X11R6/bin/Eterm +1040389 -rws--x--x 1 root wheel 3348 Oct 12 20:39:40 2005 /u +sr/X11R6/bin/Eterm 1040154 -rws--x--x 1 root wheel 1664917 Oct 12 17:23:09 2005 /u +sr/X11R6/bin/Xorg -1040397 -rws--x--x 1 root wheel 94008 Oct 12 15:44:09 2005 /usr/ +X11R6/bin/aterm </BODY></HTML>
WWW output:
    <HTML><TITLE>SET SUID FILE CHECK</TITLE> <BODY BGCOLOR=#000000 Text=#008000 link=#00c000 vlink=lightblue> <H1>SET SUID FILE CHECK</H1> <H6>Setuid lists exist!</H6> <CODE><BR> </BODY></HTML>

I really dont get this. file permissions are correct too.


In reply to Re: SUID check by n00dles
in thread SUID check by n00dles

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.