Checksum Differences

In this example, we report checksum differences for certain critical system files.

The ChecksumDifference script might send an alert message like the following:

                                PIKT ALERT
                         Sat Oct  6 14:31:05 2002
                                 cologne

CRITICAL:
    ChecksumDifference
        Report checksum differences for certain critical system files.

        /usr/sbin/login checksums differ!
            auth:   63605c254a6a9928b8075963c951dbbf 29144 /usr/sbin/login
            actual: 938a4ca4a6dd7b8665faa4cde6a83f73 29356 /usr/sbin/login

ChecksumDifference makes reference to the =checksums_obj macro, which resolves to the name of the Checksums.obj file.  The script follows.

ChecksumDifference

        init
                status =piktstatus
                level =piktlevel
                task "Report checksum differences for critical system files."
                input file "=checksums_obj"
                // dat $csauth 1        // not used
                // dat $szauth 2        // not used
                dat $name   3

        rule
                if ! -e $name
                        output mail "$name not found!"
                else
                        set $actual = $checksum(5, $name)      // MD5 checksum
                        if $inlin ne $actual
                                output mail "$name checksums differ!"
                                output mail "    auth:   $inlin"
                                output mail "    actual: $actual"
                        fi
                endif

This is just one program example.  You could add rules, or write new scripts, for example to:  review log files, report attempted break-ins, report and auto-fix improperly set file and directory ownerships and permissions, report suspicious user activity, monitor the timely application of security patches, find and report rootkits, report unexpected changes in the system configuration--the list goes on and on.

For more examples, see Samples.

 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2019-01-12.   This site is PIKT® powered.
Copyright © 1998-2019 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
View sample
mtime
changes
Pikt script