| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
use HoneyClient::Agent::Integrity::Registry; |
|---|
| 6 |
use Data::Dumper; |
|---|
| 7 |
use File::Temp qw(:POSIX); |
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
my $more_detail = 0; |
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
print "This script will help you identify registry key directories\n" . |
|---|
| 19 |
"to ignore within your Registry module.\n\n" . |
|---|
| 20 |
"Notes: Edit this script, if you would like to have the output show\n" . |
|---|
| 21 |
"more detail. Also, if you CTRL-C this script, then be sure to check\n" . |
|---|
| 22 |
"your /tmp directory, to delete any temporary files created.\n\n". |
|---|
| 23 |
"Press return to start baseline process...\n"; |
|---|
| 24 |
|
|---|
| 25 |
my $input = <>; |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
my $registry = HoneyClient::Agent::Integrity::Registry->new(); |
|---|
| 30 |
|
|---|
| 31 |
print "\n"; |
|---|
| 32 |
print "Baseline check complete. Perform normal allowable actions\n" . |
|---|
| 33 |
"on the system (i.e., browse benign web pages).\n\n" . |
|---|
| 34 |
"Press CTRL-D, when ready to perform an integrity check...\n"; |
|---|
| 35 |
|
|---|
| 36 |
$input = <>; |
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
print "Checking registry hives...\n"; |
|---|
| 40 |
my $changes = $registry->check(); |
|---|
| 41 |
|
|---|
| 42 |
if (!scalar(@{$changes})) { |
|---|
| 43 |
print "No registry changes have occurred.\n"; |
|---|
| 44 |
} else { |
|---|
| 45 |
print "Registry has changed:\n"; |
|---|
| 46 |
|
|---|
| 47 |
if ($more_detail) { |
|---|
| 48 |
$Data::Dumper::Terse = 1; |
|---|
| 49 |
$Data::Dumper::Indent = 1; |
|---|
| 50 |
print Dumper($changes); |
|---|
| 51 |
} else { |
|---|
| 52 |
foreach my $change (@{$changes}) { |
|---|
| 53 |
print $change->{'key'} . " (" . $change->{'status'} . ")\n"; |
|---|
| 54 |
} |
|---|
| 55 |
} |
|---|
| 56 |
my ($fh, $file) = tmpnam(); |
|---|
| 57 |
$Data::Dumper::Terse = 1; |
|---|
| 58 |
$Data::Dumper::Indent = 1; |
|---|
| 59 |
print $fh Dumper($changes); |
|---|
| 60 |
print "\n"; |
|---|
| 61 |
print "Done!\n"; |
|---|
| 62 |
print "Detailed registry changes were written to: " . $file . "\n"; |
|---|
| 63 |
} |
|---|
| 64 |
|
|---|