This update adds pseudo-field sha256 which can be used to calculate the sha256 hash of the content (compressed or decompressed): -E sha256:data -E sha256:data:decompress -E sha256:decompress -E sha256:extra
This update brings function= to the definition of a resolve command.
Key-value pair function is optional. If provided, the value will be interpreted as a Python function and called when there is a match. The function must inspect the request and update the reply. Arguments to the function are request, reply and dCommand. The function must return a list with 2 values: first one is True when NXDOMAIN must be returned (and False if there is an answer), second one is an integer with the rcode value, it must be None if there is no rcode set by the function.
An extra Python script (for example with function definitions) can be loaded using option -s.
I added a quota feature to virustotal-search.py’s -l (–limitrequests) option.
-l is an option to limit the number of requests: you specify the maximum number of requests to make, and virustotal-search.py will stop once that maximum is reached. Remark that virustotal-search.py does 4 hash lookups per requests, thus if your remaining quota for the day is 1000, you can use -l 250 to perform a maximum of requests without exceeding your total quota (250 = 1000 / 4).
With this new version, you can also instruct virustotal-search.py to calculate (via the API) how much remaining quota you have, and use that to decide how much queries to perform. This is done with keyword quota:. The syntax is: -l quota:groupid,maximum,reserve.
groupid is the group ID your account belongs to. For example sans_isc.
maximum is your daily API quota: how many lookups can you do in one day.
And reserve is the number of lookups you want to save: how many lookups should remain when virustotal-search.py has finished.
Let’s try an example: assume you want virustotal-search.py to do as much queries as possible, but leave a reserve of 100 lookups. Option -l will look like this: -l quota:sans_isc,10000,100.
sans_isc is your group ID, 10000 is the daily API quota, 100 is the reserve.
If you want virustotal-search.py to query your remaining quota, without doing any lookups, use string query as reserve. Like this: l quota:sans_isc,10000,query.
In this example, 3896 lookups have been consumed, and that gives 10000 – 3896 = 6104 remaining lookups. To lookup file hashes, that means there are 6104 / 4 = 1526 remaining queries.
Thus in this case, starting virustotal-search.py with option -l quota:sans_isc,10000,0 would be the same as -l 1526. The difference is that in the first case, you don’t have to calculate the value 1526, virustotal-search does this for you.
You can combine this feature with option –sleep to have virustotal-search.py use the remaining lookups at the end of the day.
For example, virustotal-search.py –sleep 01:45:00 -l quota:sans_isc,10000,10 will have virustotal-search.py wait until it’s 01:45:00 (15 minutes before UTC midnight in CEST), then query the amount of remaining lookups, and do the lookups so as not to exceed the quota and to leave 10 lookups available.
-W stdout: will write all items to stdout (binary) without any end-of-line. To include an end-of-line, specify a Python string, like this: -W stdout:’\n’ this will add a newline to the end of the item -W stdout:’\r’ this will add a carriage return to the end of the item -W stdout:’\r\n’ this will add a carriage return and newline to the end of the item