Skip to content

Commit

Permalink
Using virustotal.conf as the default conf file and updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelsante committed Jul 6, 2015
1 parent e7da906 commit 8b80443
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
14 changes: 5 additions & 9 deletions doc/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,11 @@ VirusTotal is a free service that analyzes suspicious files and URLs and
facilitates the quick detection of viruses, worms, trojans, and all kinds
of malware.

Thug supports VirusTotal but you need to get an API key to use the
VirusTotal Public API 2.0. To do so, just sign-up on the service at
https://www.virustotal.com/ and get your own API Key.

To set up a static VirusTotal key that will be used every time you run Thug with the
--vtquery and --vtscan options, just rename the file src/virustotal/virustotal.conf.sample
in src/virustotal/virustotal.conf and insert your own API key in the configuration file
as shown below. Please note that you can avoid redefining both scanurl and reporturl if
you are happy with the default values, which can be found in src/virustotal/virustotal.default.conf
Thug supports VirusTotal and a default API key is now included in the default
configuration file (many thanks to the VirusTotal crew for this!). Please
consider getting your own API key by signing-up on the service at
https://www.virustotal.com/. To change the default VirusTotal key with your
own, simply edit *src/Analysis/virustotal/virustotal.conf* as follows:

.. code-block:: sh
Expand Down
14 changes: 4 additions & 10 deletions src/Analysis/virustotal/VirusTotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,13 @@ def __init__(self):
def __init_config(self):
config = ConfigParser.ConfigParser()

# virustotal.default.conf should contain at least scanurl and reporturl
default_conf_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'virustotal.default.conf')
if not os.path.isfile(default_conf_file):
conf_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'virustotal.conf')

if not os.path.isfile(conf_file):
self.enabled = False
return

with open(default_conf_file, 'rb') as default_conf:
config.read_file(default_conf)

conf_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'virustotal.conf')

if os.path.isfile(conf_file):
config.read(conf_file)
config.read(conf_file)

for option in config.options('VirusTotal'):
self.opts[option] = config.get('VirusTotal', option)
Expand Down

0 comments on commit 8b80443

Please sign in to comment.