Changeset 399
- Timestamp:
- 05/29/07 16:16:47 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeyclient/branches/exp/kindlund-filesystem/lib/HoneyClient/Agent.pm
r393 r399 114 114 # within the global configuration file. Or, feed the initialization logic through init() as part of the arguments. 115 115 @DRIVERS = ( 'IE' ); 116 # XXX: See if this is still needed.117 116 foreach (@DRIVERS) { 118 117 eval "use HoneyClient::Agent::Driver::Browser::$_"; … … 229 228 use Data::Compare; 230 229 230 # The global logging object. 231 our $LOG = get_logger(); 232 231 233 # Complete URL of SOAP server, when initialized. 232 234 our $URL_BASE : shared = undef; … … 344 346 # Sanity check. Make sure the daemon isn't already running. 345 347 if (defined($DAEMON_PID)) { 348 $LOG->fatal("Error: " . __PACKAGE__ . " daemon is already running (PID = " . $DAEMON_PID .")!"); 346 349 Carp::croak "Error: " . __PACKAGE__ . " daemon is already running (PID = $DAEMON_PID)!\n"; 347 350 } … … 407 410 # Make sure the fork was successful. 408 411 if (!defined($pid)) { 412 $LOG->fatal("Error: Unable to fork child process.\n$!"); 409 413 Carp::croak "Error: Unable to fork child process.\n$!"; 410 414 } … … 467 471 # the parent process... 468 472 if (defined($DAEMON_PID) && ($DAEMON_PID != 0)) { 473 $LOG->error("Killing PID = " . $DAEMON_PID); 469 474 print STDERR "Killing PID = " . $DAEMON_PID . "\n"; 470 475 # The Win32 version of kill() seems to only respond to SIGKILL(9). … … 837 842 # We assume $driver->next() returns defined data. 838 843 foreach my $resource (keys %{$driver->next()->{resources}}) { 839 print "Using Resource: " . $resource . "\n";844 $LOG->info("Driving To Resource: " . $resource); 840 845 } 841 846 … … 854 859 # XXX: Delete this, eventually. 855 860 if ($driverTargetsChanged) { 856 print "Driver targets have changed.\n";861 $LOG->info("Driver targets have changed."); 857 862 #$Data::Dumper::Terse = 0; 858 863 #$Data::Dumper::Indent = 1; … … 877 882 # For now, we update a scalar called 'is_compromised' within 878 883 # the $data->{$driverName}->{'status'} sub-hashtable. 879 print "Performing Integrity Checks...\n";884 $LOG->info("Performing Integrity Checks."); 880 885 my $changes = $integrity->check(); 881 886 if (scalar(@{$changes->{registry}}) || 882 887 scalar(@{$changes->{filesystem}})) { 883 print "Integrity Check: FAILED\n";888 $LOG->warn("Integrity Check: FAILED"); 884 889 $isCompromised = 1; 885 890 } else { 886 print "Integrity Check: PASSED\n";891 $LOG->info("Integrity Check: PASSED"); 887 892 } 888 893 } … … 922 927 923 928 # TODO: Do proper fault queuing. 924 print "FAULT: " . $@ . "\n";929 $LOG->error("FAULT: " . $@); 925 930 } 926 931 … … 1131 1136 if ($proc->{Name} eq $processName) { 1132 1137 # TODO: Should this statement be in here? 1138 $LOG->warn("Killing Process ID: " . $proc->{ProcessId}); 1133 1139 Carp::carp "Killing Process ID: " . $proc->{ProcessId} . "\n"; 1134 1140 Win32::Process::KillProcess($proc->{ProcessId}, 0);
