A simple Python-based command-line script to interact with blacktop's virustotal-api.
GPLv3
python setup.py install
A configuration file is used to store your VirusTotal API key. It uses the following format:
[virustotal]
apikey: <your API key here>
The configuration file can be specified using the --config
command-line option. By default $HOME/.vtapi
is used.
Submit a file to be scanned.
python vt_driver.py file-scan [-h] file
Positional arguments:
file File path
Optional arguments:
-h, --help Show this help message and exit
Rescan previously submitted file(s) without having to resubmit, thus saving bandwidth.
python vt_driver.py rescan [-h] hash [hash ...]
Positional arguments:
hash List of MD5/SHA1/SH256 hashes (up to 25)
Optional arguments:
-h, --help Show this help message and exit
Retrieve file scan results.
python vt_driver.py file-report [-h] hash [hash ...]
Positional arguments:
hash List of MD5/SHA1/SHA256 hashes (up to 25)
Optional arguments:
-h, --help Show this help message and exit
Get a report on the behaviour of a file in a sandbox environment.
python vt_driver.py behaviour [-h] hash
Positional arguments:
hash An MD5/SHA1/SHA256 hash
Optional arguments:
-h, --help Show this help message and exit
Get a dump of the network traffic generated by the file.
python vt_driver.py pcap [-h] [-o OUTPUT_DIR] hash
Positional arguments:
hash An MD5/SHA1/SHA256 hash
Optional arguments:
-h, --help Show this help message and exit
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
Output directory to write downloaded pcap file to
(defaults to the current working directory)
Search for files.
python vt_driver.py search [-h] [-o OFFSET] query
Positional arguments:
query A comma-separated search query. See
https://www.virustotal.com/intelligence/help/file-search/#search-modifiers
for valid search modifiers
Optional arguments:
-h, --help Show this help message and exit
-o, --offset
Offset returned by the previous search query. Allows for
pagenation of results
Download a file.
python vt_driver.py download [-h] [-o OUTPUT_DIR] hash
Positional arguments:
hash An MD5/SHA1/SHA256 hash
Optional arguments:
-h, --help Show this help message and exit
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
Output directory to write downloaded file to
(defaults to the current working directory)
Submit URL(s) to be scanned.
python vt_driver.py url-scan [-h] url [url ...]
Positional arguments:
url URL(s) (up to 25)
Optional arguments:
-h, --help Show this help message and exit
Get URL scan results.
python vt_driver.py url-report [-h] url [url ...]
Positional arguments:
url URL(s) (up to 25)
Optional arguments:
-h, --help Show this help message and exit
Get information about an IP address.
python vt_driver.py ip-report [-h] ip
Positional arguments:
ip An IPv4 address
Optional arguments:
-h, --help Show this help message and exit
Get information about a domain.
python vt_driver.py domain-report [-h] domain
Positional arguments:
domain A domain name
Optional arguments:
-h, --help Show this help message and exit