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
- Reads the URLs from
file.txtand removes duplicates. - Submits each URL to VirusTotal through the API v3.
- Polls the analysis status until the result is ready.
- Reads the detection stats and classifies the URL.
- Writes the URL to
clean.txtormalicious.txtand 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
requestslibrary - A VirusTotal API key
Usage
Install the dependencies:
pip install -r requirements.txt
python scanner.py
Output
clean.txt: URLs with zero malicious detectionsmalicious.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.
