Changeset 1107

Show
Ignore:
Timestamp:
01/11/08 16:02:08 (8 months ago)
Author:
kindlund
Message:

Disabled all DB interactions, since we're going to change the raw data outputted in order to be compatible with the new Ruby data model.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/trunk/lib/HoneyClient/Manager.pm

    r1105 r1107  
    582582    } 
    583583    #XXX: Insert Urls. To be moved eventually. 
    584     if ($DB_ENABLE && ($clientDbId > 0)) { 
    585         $LOG->info("Saving Url History to Database."); 
    586         insert_url_history(agent_state => $globalAgentState); 
    587         HoneyClient::DB::Client->update( 
    588             '-set' => { 
    589                 status => $HoneyClient::DB::Client::STATUS_CLEAN, 
    590             }, 
    591             '-where' => { 
    592                 id => $clientDbId, 
    593             } 
    594         ); 
    595    
     584    #if ($DB_ENABLE && ($clientDbId > 0)) { 
     585    #    $LOG->info("Saving Url History to Database."); 
     586    #    insert_url_history(agent_state => $globalAgentState); 
     587    #    HoneyClient::DB::Client->update( 
     588    #        '-set' => { 
     589    #            status => $HoneyClient::DB::Client::STATUS_CLEAN, 
     590    #        }, 
     591    #        '-where' => { 
     592    #            id => $clientDbId, 
     593    #        } 
     594    #    ); 
     595    #
    596596 
    597597    # XXX: There is an issue where if we try to quit but are in the 
     
    839839 
    840840    #Register Client with the Honeyclient Database 
    841     if ($DB_ENABLE) { 
    842         eval { 
    843             $clientDbId = dbRegisterClient($vm->name); 
    844         }; 
    845         if ($@) { 
    846             $clientDbId = 0; #$DB_FAILURE 
    847             $LOG->warn("Failure Inserting Client Object:\n$@"); 
    848         } 
    849    
     841    #if ($DB_ENABLE) { 
     842    #    eval { 
     843    #        $clientDbId = dbRegisterClient($vm->name); 
     844    #    }; 
     845    #    if ($@) { 
     846    #        $clientDbId = 0; #$DB_FAILURE 
     847    #        $LOG->warn("Failure Inserting Client Object:\n$@"); 
     848    #    } 
     849    #
    850850 
    851851    # Build our VM's connection table. 
     
    956956 
    957957                    # Insert Compromised Fingerprint into DB. 
    958                     if ($DB_ENABLE && ($clientDbId > 0)) { 
    959                         #XXX: This should occurr as a resource is accessed and will be moved. Also should be in Browser code. 
    960                         # Put Honeyclient Link History in database. 
    961                         $LOG->info("Saving Url History to Database."); 
    962                         $args{'agent_state'} = insert_url_history(agent_state => $args{'agent_state'}); 
    963                         $globalAgentState = $args{'agent_state'}; 
    964  
    965                         # Remove the compromise time from the fingerprint. This is to be added to the Client Object 
    966                         delete $fingerprint->{last_resource}; 
    967                         my $compromise_time = HoneyClient::DB::Time->new(delete($fingerprint->{'compromise_time'})); 
    968                         $LOG->info("Inserting Fingerprint Into Database."); 
    969                         my $fp = HoneyClient::DB::Fingerprint->new($fingerprint); 
    970                         my $fpId = $fp->insert(); 
    971                         my $ctId = $compromise_time->insert(); 
    972                         HoneyClient::DB::Client->update( 
    973                             '-set' => { 
    974                                 status => $HoneyClient::DB::Client::STATUS_COMPROMISED, 
    975                                 fingerprint => $fpId, 
    976                                 compromise_time => $ctId, 
    977                             }, 
    978                             '-where' => { 
    979                                 id => $clientDbId, 
    980                             } 
    981                         ); 
    982                         $LOG->info("Database Insert Successful."); 
    983                    
     958                    #if ($DB_ENABLE && ($clientDbId > 0)) { 
     959                    #    #XXX: This should occurr as a resource is accessed and will be moved. Also should be in Browser code. 
     960                    #    # Put Honeyclient Link History in database. 
     961                    #    $LOG->info("Saving Url History to Database."); 
     962                    #    $args{'agent_state'} = insert_url_history(agent_state => $args{'agent_state'}); 
     963                    #    $globalAgentState = $args{'agent_state'}; 
     964                    # 
     965                    #    # Remove the compromise time from the fingerprint. This is to be added to the Client Object 
     966                    #    delete $fingerprint->{last_resource}; 
     967                    #    my $compromise_time = HoneyClient::DB::Time->new(delete($fingerprint->{'compromise_time'})); 
     968                    #    $LOG->info("Inserting Fingerprint Into Database."); 
     969                    #    my $fp = HoneyClient::DB::Fingerprint->new($fingerprint); 
     970                    #    my $fpId = $fp->insert(); 
     971                    #    my $ctId = $compromise_time->insert(); 
     972                    #    HoneyClient::DB::Client->update( 
     973                    #        '-set' => { 
     974                    #            status => $HoneyClient::DB::Client::STATUS_COMPROMISED, 
     975                    #            fingerprint => $fpId, 
     976                    #            compromise_time => $ctId, 
     977                    #        }, 
     978                    #        '-where' => { 
     979                    #            id => $clientDbId, 
     980                    #        } 
     981                    #    ); 
     982                    #    $LOG->info("Database Insert Successful."); 
     983                    #
    984984                    return; # Return out of eval block. 
    985985                } else {