| 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 | #} |
|---|
| 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 | #} |
|---|