Changeset 1201
- Timestamp:
- 02/15/08 17:44:59 (7 months ago)
- Files:
-
- honeyclient/trunk/lib/HoneyClient/Manager.pm (modified) (7 diffs)
- honeyclient/trunk/lib/HoneyClient/Manager/VM.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeyclient/trunk/lib/HoneyClient/Manager.pm
r1200 r1201 754 754 fault_handler => \&_handleFaultAndCleanup); 755 755 756 # TODO XXX: Get URL list fromdatabase.756 # If supported, get a URL list from the database. 757 757 if ($DB_ENABLE && ($vm->database_id > 0)) { 758 758 $args{'agent_state'} = get_urls($vm, $args{'agent_state'}, $args{'driver'}); … … 780 780 # assume that the Agent's watchdog process will recover. 781 781 eval { 782 #print "Calling getState()...\n";783 #$som = $stubAgent->getState();784 #$args{'agent_state'} = $som->result();785 786 # XXX: Delete this, eventually.787 #$globalAgentState = $args{'agent_state'};788 #print "Result:\n";789 #print Dumper(thaw(decode_base64($globalAgentState)));790 791 782 print "Calling getStatus()...\n"; 792 783 $som = $stubAgent->getStatus(); … … 799 790 #print Dumper($ret); 800 791 801 # Extract current agent state.792 # Derive current agent state from full status. 802 793 my @driverNames = keys(%{$ret}); 803 794 my $state = {}; … … 807 798 $args{'agent_state'} = encode_base64(nfreeze($state)); 808 799 $globalAgentState = $args{'agent_state'}; 809 print "GlobalAgentState:\n";810 print Dumper(thaw(decode_base64($globalAgentState)));800 #print "GlobalAgentState:\n"; 801 #print Dumper(thaw(decode_base64($globalAgentState))); 811 802 812 803 # Check to see if Agent::run() thread has stopped … … 881 872 if (!$ret->{$args{'driver'}}->{status}->{links_remaining}) { 882 873 883 # TODO XXX: Get URL list from database. 884 885 $LOG->info("All URLs exhausted. Shutting down Manager."); 886 $vm = undef; 887 print "Done!\n"; 888 _cleanup(); 889 874 # If supported, get more URLs from the database. 875 if ($DB_ENABLE && ($vm->database_id > 0)) { 876 # Put URL History in database. 877 $LOG->info("Saving URL History to Database."); 878 insert_url_history(agent_state => $args{'agent_state'}, 879 client_id => $vm->database_id); 880 881 $args{'agent_state'} = get_urls($vm, $args{'agent_state'}, $args{'driver'}); 882 print "Calling updateState()...\n"; 883 $som = $stubAgent->updateState($args{'agent_state'}); 884 } else { 885 $LOG->info("All URLs exhausted. Shutting down Manager."); 886 $vm = undef; 887 print "Done!\n"; 888 _cleanup(); 889 } 890 890 } else { 891 891 # The Agent::run() thread has stopped; we assume … … 988 988 cid => $vm->name, 989 989 status => 'running', 990 # TODO: Collect host, application, and config through automation/config files990 # TODO: Collect host, application, and config through automation/config files 991 991 host => { 992 992 org => 'MITRE', … … 1032 1032 # XXX: Hardcoded timeout. 1033 1033 sleep (2); 1034 $LOG->info("Retrieving new URLs from database.");1034 #$LOG->info("Retrieving new URLs from database."); 1035 1035 $queue_url_list = HoneyClient::Manager::Database::get_queue_urls(10, $vm->database_id); 1036 1036 $remoteLinksExist = scalar(%{$queue_url_list}); honeyclient/trunk/lib/HoneyClient/Manager/VM.pm
r1040 r1201 825 825 # the parent process... 826 826 if (defined($DAEMON_PID) && $DAEMON_PID) { 827 # XXX: Delete this, eventually. 828 $LOG->info("Destroying VM daemon at PID: " . $DAEMON_PID); 827 829 $ret = kill("QUIT", $DAEMON_PID); 828 830
