Welcome to VT_Tool by THA-CERT!
VirusTotal analysis tool with local caching and optional MISP integration.
vt_tool retrieves analysis information for IP addresses, hashes, URLs, and domains using the VirusTotal v3 API.
It supports interactive and non-interactive modes, local result caching via SQLite, structured CSV/TXT export, and MISP integration.
-
Query VirusTotal for:
- IPv4 addresses
- File hashes (MD5, SHA-1, SHA-256)
- URLs
- Domains
-
Automatic quota checking (hourly VT API quota)
-
Local SQLite caching (avoids re-querying existing values)
-
CSV and TXT report generation
-
Template-based input processing
-
Optional MISP event creation/update
-
Proxy support
-
Interactive CLI (Rich UI)
-
Fully non-interactive automation mode
CLI (argparse)
│
├── Input Handling (file / template / CLI args)
├── Validator (IP / hash / URL / domain)
├── Local SQLite cache
├── VirusTotal API v3 client
├── Report processing
│ ├── CSV export
│ └── TXT formatted report
└── Optional MISP integration- Python 3.8+
- VirusTotal API key
- Internet access
- Optional: MISP instance (for integration)
Dependencies are listed in requirements.txt.
git clone https://github.com/thalesgroup-cert/vt_tool.git
cd vt_tool
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtYou can provide the API key in one of three ways:
export VTAPIKEY="your_api_key"--api_key YOUR_KEY--api_key_file path/to/keyfile.txtYou cannot use both
--api_keyand--api_key_fileat the same time.
--proxy http://127.0.0.1:8080python vt_tools.py [OPTIONS] VALUES...If no values or input file are provided, execution stops with error.
| Option | Short | Description |
|---|---|---|
--template_file |
-tf |
Template file to use for structured IOC input. |
--input_file |
-f |
File containing IOCs to analyze. |
--output_dir |
-o |
Directory where output reports are saved. |
--type |
-t |
Type of values to analyze: ips, hashes, urls, domains, all (default: all). |
--non_interactive |
-n |
Disable interactive prompts. Required for automation. |
--case_id |
-c |
Case ID or MISP event UUID (zero-padded to 6 digits). |
--api_key |
-a |
VirusTotal API key. |
--api_key_file |
-af |
Path to file containing API key. |
--proxy |
-p |
Proxy URL for outbound requests. |
values |
— | One or more IPs, hashes, URLs, or domains. |
| Type | CLI Value |
|---|---|
| IP addresses | ips |
| File hashes | hashes |
| URLs | urls |
| Domains | domains |
| All types | all |
python vt_tools.py -t ips 8.8.8.8 1.1.1.1python vt_tools.py -f iocs.txtFile format:
8.8.8.8
example.com
44d88612fea8a8f36de82e1278abb02fpython vt_tools.py -tf template.csvTemplate options available:
| Option | Template Structure |
|---|---|
| 1 | value,comment |
| 2 | value,comment,source |
| 3 | value,category,type,comment,to_ids,tag1,tag2 |
Interactive selection will prompt template choice.
- Prompts for analysis type
- Prompts for MISP integration
- Displays Rich UI panels
python vt_tools.py -n -t ips -f iocs.txt- No prompts
- No MISP interactive selection
- Logging output instead of Rich prompts
Before analysis begins:
- The tool queries VirusTotal hourly quota.
- If quota is exhausted, execution stops.
- If requested IOCs exceed remaining quota, a warning is shown.
- Already cached IOCs do not consume quota.
-
SQLite database:
vttools.sqlite -
Automatically created if not present
-
Prevents re-querying existing values
-
Skips:
- Private IPs
- Loopback IPs
- Reserved IP ranges
- Unsupported hash types (SHA-224, SHA-384, SHA-512, SSDEEP)
For each analysis type:
Generated automatically. Contains structured VT results.
Formatted table version of results.
Files are saved in:
- Current directory (default)
- Or
--output_dirif provided
If:
- Running in interactive mode
- Or using template mode
The tool can:
- Create new MISP event
- Update existing MISP event (via
--case_id)
Non-interactive mode skips MISP integration.
python vt_tools.py -t ips 8.8.8.8python vt_tools.py -t hashes -f hashes.txtpython vt_tools.py -n -t all -f iocs.txt --api_key YOUR_KEYpython vt_tools.py -tf template.csv -c 123456The tool handles:
- Invalid IOCs
- Unsupported value types
- Quota exhaustion
- API failures
- Network errors
- Duplicate DB entries
Errors are counted and reported at the end of execution.
Execution ends with:
- Total time taken
- Remaining quota
- Number of skipped values
- Number of errors
- INFO level logging enabled by default
- Errors logged to console
- In non-interactive mode, logs replace UI prompts
- API keys are never logged
- Proxy support for controlled outbound traffic
- Local DB prevents unnecessary API calls
- Invalid or sensitive IP ranges are filtered
python vt_tools.py --helpInitializator→ handles DB, validator, reporterValueReader→ parses input/template filesdb_handler→ manages SQLitereporter→ calls VT APIvalidator→ validates IOC format
See LICENSE file.
