Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

A VirusTotal CLI tool made using VirusTotal v3 API and python

License

Notifications You must be signed in to change notification settings

Soumyo001/VirusTotal-CLI

Repository files navigation


VirusTotal-CLI banner


VirusTotal CLI Tool

Python
License

A fast, modern and user-friendly command-line interface for interacting with the VirusTotal v3 API.
Designed for security researchers, malware analysts, and DFIR / SOC workflows — directly from the terminal. Scan files/URLs, fetch intelligence for domains and IPs, inspect account quotas, and self-update with a single command.


Features

  • API Key Management

    • vt setup --apikey <API_KEY>: Save your VirusTotal API key.
    • vt key show: View your saved API key.
    • vt key remove [--force]: Remove your API key with confirmation bypass.
  • File Operations

    • Scan files (vt file scan <path>).
    • Retrieve reports (vt file report <hash>).
    • Request rescan (vt file rescan <hash>).
    • Supports large files (>32MB) using VirusTotal upload URLs.
  • URL Analysis

    • Scan URLs (vt url scan <url>).
    • Retrieve URL reports (vt url report <url_or_base64>).
  • Domain & IP Intelligence

    • Query domains (vt domain report <domain_name>).
    • Query IP addresses (vt ip report <ip_address>).
  • User Account Information

    • vt account info: Get account details (email, API key, quotas, privileges).
  • Analysis Lookup

    • vt analysis <id>: Retrieve analysis details by ID.
  • Automatic Updates

    • vt update: Check for the latest version and update the CLI automatically.
    • Handles Git detection and Python dependencies.
  • Cross-Platform Support

    • Works on Linux (Debian/Ubuntu/Kali/Arch) and Windows (PowerShell).

Installation

Linux (Debian/Ubuntu/Kali/Arch)

# Clone repository
git clone https://github.com/Soumyo001/VirusTotal-CLI.git
cd VirusTotal-CLI
chmod +x install.sh

# Run installer
./install.sh

The installer will create a Python virtual environment, install all dependencies, and set up the CLI.

Windows (PowerShell)

  • Set Executionpolicy to unrestricted
Set-ExecutionPolicy Unrestricted -Scope CurrentUser
  • Clone and run the script
# Clone repository
git clone https://github.com/Soumyo001/VirusTotal-CLI.git
cd VirusTotal-CLI

# Run PowerShell installer
powershell -Executionpolicy Bypass .\install.ps1

Git must be installed and in PATH for the installer and update commands.


Usage

API Key Setup

vt setup --apikey <YOUR_API_KEY>          # Setup your VirusTotal API key
vt key show                               # Show stored API key
vt key remove                             # Remove API key with warning
vt key remove --force                     # Remove API key without warning

File Operations

vt file scan <path_to_file> [--json]      # Scan a file
vt file report <hash> [--json]            # Get report by file hash
vt file rescan <hash> [--json]            # Request file rescan

URL Operations

vt url scan <url> [--json]                # Scan a URL
vt url report <id_or_url> [--json]        # Get URL report by ID or raw URL

Domain

vt domain report example.com
vt domain rescan example.com

IP

vt ip report 8.8.8.8
vt ip rescan 8.8.8.8

Account Info & Quotas

vt account info [--json]                  # Show account info

Analysis Lookup

vt analysis <analysis_id> [--json]        # Get analysis details

Update CLI

vt update

Project Structure

VirusTotal-CLI/
├── api
│   ├── api_client.py
│   └── __init__.py
├── cli
│   ├── __init__.py
│   └── vtcli.py
├── data
│   ├── api_constants.py
│   ├── CHANGELOG.txt
│   ├── constants.py
│   └── __init__.py
├── images
│   └── photo.png
├── __init__.py
├── install.ps1
├── install.sh
├── LICENSE
├── main.py
├── README.md
├── requirements.txt
├── utils
│   ├── handlers
│   │   ├── uninstall_handler.py
│   │   └── update_handler.py
│   ├── helpers
│   │   ├── get_home_dir.py
│   │   ├── hash.py
│   │   ├── __init__.py
│   │   ├── key_helper.py
│   │   ├── printer_helper
│   │   │   ├── __init__.py
│   │   │   ├── print_domain_helper.py
│   │   │   ├── print_file_behaviour.py
│   │   │   ├── print_file_helper.py
│   │   │   ├── print_ip_helper.py
│   │   │   ├── print_url_helper.py
│   │   │   └── print_user.py
│   │   └── url_to_vt_id_helper.py
│   ├── __init__.py
│   └── validators
│       ├── __init__.py
│       └── url_validator.py
└── version.txt

🔐 API Key Storage

VirusTotal-CLI securely stores your API key in your system user configuration directory. No manual setup is required — the directory is created automatically on first use with proper rights.


Development

  • Python 3.12+ required.
  • Dependencies listed in requirements.txt.
  • Recommended workflow: git clone → virtual environment → install dependencies.
  • After any change, the version updates need to be in the following paths:
VirusTotal-CLI/version.txt
VirusTotal-CLI/cli/__init__.py
  • the update description should be in :
VirusTotal-CLI/data/CHANGELOG.txt
  • Inside project directory, run:
python3 -m venv venv
source venv/bin/activate      # Linux
powershell -Executionpolicy Bypass ".\venv\Scripts\activate.ps1"     # Windows or just set executionpolicy to unrestricted and do .\venv\Scripts\activate.ps1
pip install -r requirements.txt

Contributing

Contributions are welcome! Please:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature-name).
  3. Commit your changes (git commit -m "Feature description").
  4. Push the branch (git push origin feature-name).
  5. Open a Pull Request.

Roadmap / Future Work

  • Windows installer and update support (complete PowerShell UX)
  • Packaged executables (PyInstaller / MSI)
  • Official PyPI package & Homebrew tap for easier install
  • More VirusTotal endpoints (private collections, retrohunt, intelligence)
  • CI: tests + release automation (GitHub Actions)

License

This project is licensed under the BSD 3-Clause License. See LICENSE for details.