|

VirusTotal URL Scanner Tool

A Python tool that automates URL analysis with the VirusTotal API v3. It reads URLs from a text file, submits them for scanning, polls for the results, and sorts every URL by the detection stats reported by the security engines.

Checking a long list of URLs one by one in the browser is slow. This tool does it in bulk and leaves you with two clean output files.

How it works

  1. Reads the URLs from file.txt and removes duplicates.
  2. Submits each URL to VirusTotal through the API v3.
  3. Polls the analysis status until the result is ready.
  4. Reads the detection stats and classifies the URL.
  5. Writes the URL to clean.txt or malicious.txt and prints a summary.

Classification logic

The tool uses one simple detection-based rule:

  • Malicious: at least one security engine reports a malicious detection.
  • Clean: no malicious detections are reported.

Clean is an operational label based on this rule. It does not guarantee that a URL is safe.

Features

  • Bulk URL scanning from a text file
  • VirusTotal API v3 integration
  • Automated analysis status polling
  • Duplicate URL removal
  • Separate output files for each verdict
  • Handling of HTTP and connection errors
  • Scanning progress and summary statistics

Requirements

  • Python 3.x
  • The requests library
  • A VirusTotal API key

Usage

Install the dependencies:

pip install -r requirements.txt

python scanner.py

Output

  • clean.txt: URLs with zero malicious detections
  • malicious.txt: URLs with at least one malicious detection

Limitations

  • A single engine detection is enough to mark a URL as malicious, so some results may be false positives.
  • A clean result only means no engine flagged the URL at scan time. It is not a safety verdict.
  • VirusTotal API usage is subject to its rate limits and terms of service.

Source code

View on GitHub →

Similar Posts