Create multiCleaner.py#180
Open
garanews wants to merge 4 commits into
Open
Conversation
This script will delete samples (present into mongodb and on disk) older than X seconds (find in delta variable), with a malware score less than Y value (find in MAX_MALSCORE) and with no virustotal evidences (0 is considered a report).
Before run it, some index into monngodb is needed:
mongo cuckoo then
db.calls.createIndex({"pid": 1})
db.analysis.createIndex({"virustotal_summary": 1, "info.ended": -1})
db.analysis.createIndex({"malscore": 1, "info.ended": -1})
db.analysis.createIndex({"virustotal_summary": -1, "info.ended": -1})
db.analysis.createIndex({"malscore": -1, "info.ended": -1})
It is working, need to fix the duplicates id output from mongo:
db.analysis.find( {$and : [{"malscore": {$gt : -1}}, {"malscore": {$lt : 4}}], "info.ended": {$lt : "2016-06-23 10:00:42"}, "virustotal_summary": {$exists: false } } , {"info.id": 1} )
{ "_id" : ObjectId("576b9ae39992744853f44f2e"), "info" : { "id" : 11 } }
{ "_id" : ObjectId("576b9a3599927449392608ef"), "info" : { "id" : 11 } }
{ "_id" : ObjectId("576ba3949992744937261c39"), "info" : { "id" : 26 } }
{ "_id" : ObjectId("576ba3bf9992744853f4803b"), "info" : { "id" : 26 } }
in order to avoid the double try removal, if "debug = true" will see:
python multiCleaner.py
2016-06-23 15:32:06 starting
found 66 samples
/home/analyst/cuckoo-advanced/storage/analyses/11
deleted: 11
/home/analyst/cuckoo-advanced/storage/analyses/11
[Errno 2] No such file or directory: '/home/analyst/cuckoo-advanced/storage/analyses/11'
/home/analyst/cuckoo-advanced/storage/analyses/26
deleted: 26
/home/analyst/cuckoo-advanced/storage/analyses/26
[Errno 2] No such file or directory: '/home/analyst/cuckoo-advanced/storage/analyses/26'
Contributor
Author
|
I have seen, the reason I created new one is to keep samples with a malscore greater than X value and/or positive to VT for comparison (malheur) etc |
Whitelisting adobe.com in misp.conf will whitelist both domains and urls containing adobe.com domain: skipped domains from misp submit: adobe.com , acroipm2.adobe.com skipped urls from misp submit: http://acroipm2.adobe.com/15/rdr/ITA/win/nooem/none/consumer/279_15_20_20039.zip
Contributor
|
check this one https://github.com/doomedraven/cuckoo-modified/blob/master/utils/remove_older.py there also your misp improvements merged |
support non utf8 chars in filename
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This script will delete samples (present into mongodb and on disk) older than X seconds (find in delta variable), with a malware score less than Y value (find in MAX_MALSCORE) and with no virustotal evidences (0 is considered a report).
Before run it, some index into monngodb is needed:
mongo cuckoo then
db.calls.createIndex({"pid": 1})
db.analysis.createIndex({"virustotal_summary": 1, "info.ended": -1})
db.analysis.createIndex({"malscore": 1, "info.ended": -1})
db.analysis.createIndex({"virustotal_summary": -1, "info.ended": -1})
db.analysis.createIndex({"malscore": -1, "info.ended": -1})
It is working, need to fix the duplicates id output from mongo:
db.analysis.find( {$and : [{"malscore": {$gt : -1}}, {"malscore": {$lt : 4}}], "info.ended": {$lt : "2016-06-23 10:00:42"}, "virustotal_summary": {$exists: false } } , {"info.id": 1} )
{ "_id" : ObjectId("576b9ae39992744853f44f2e"), "info" : { "id" : 11 } }
{ "_id" : ObjectId("576b9a3599927449392608ef"), "info" : { "id" : 11 } }
{ "_id" : ObjectId("576ba3949992744937261c39"), "info" : { "id" : 26 } }
{ "_id" : ObjectId("576ba3bf9992744853f4803b"), "info" : { "id" : 26 } }
in order to avoid the double try removal, if "debug = true" will see:
python multiCleaner.py
2016-06-23 15:32:06 starting
found 66 samples
/home/analyst/cuckoo-advanced/storage/analyses/11
deleted: 11
/home/analyst/cuckoo-advanced/storage/analyses/11
[Errno 2] No such file or directory: '/home/analyst/cuckoo-advanced/storage/analyses/11'
/home/analyst/cuckoo-advanced/storage/analyses/26
deleted: 26
/home/analyst/cuckoo-advanced/storage/analyses/26
[Errno 2] No such file or directory: '/home/analyst/cuckoo-advanced/storage/analyses/26'