Python automation for IOC enrichment using VirusTotal, OTX, and AbuseIPDB APIs
An automated tool for gathering, analyzing, and reporting Indicators of Compromise (IOCs) using open-source threat intelligence APIs including VirusTotal, AlienVault OTX, and AbuseIPDB.
๐ฏ Designed to demonstrate scripting, API integration, and threat intel workflows using Python.
pandas for data handlingpython-dotenv for config managementThreat-Intelligence/ โโโ data/ # Output files (CSV/JSON) โโโ logs/ # Log files โโโ reports/ # Markdown reports โโโ scripts/ โ โโโ main.py # Main CLI logic โ โโโ utils.py # Helper functions โโโ tests/ # Unit tests (WIP) โโโ .env.example # Template for API keys โโโ requirements.txt # Python dependencies โโโ README.md # Project documentation
git clone https://github.com/GreyKeyStudios/CyberSecurity-Projects.git cd CyberSecurity-Projects/Threat-Intelligence Install dependencies: pip install -r requirements.txt Add your API keys to a .env file: VIRUSTOTAL_API_KEY=your_virustotal_api_key ABUSEIPDB_API_KEY=your_abuseipdb_api_key OTX_API_KEY=your_otx_api_key โก Usage Check a file hash: python scripts/main.py --hash <HASH> Check a domain: python scripts/main.py --domain shady-site.biz Check an IP address: python scripts/main.py --ip 185.130.5.231 Check all with a label and output to CSV: python scripts/main.py --threat-type "Phishing Kit" --hash <HASH> --domain shady.biz --ip 185.130.5.231 --output csv ๐ Sample Output CSV Source,IOC Type,IOC Value,Threat Label,First Seen VirusTotal,hash,e99a18c4...,Malicious,2024-05-01T19:00:00Z OTX,domain,shady-site.biz,Suspicious,2024-05-01T19:02:00Z AbuseIPDB,ip,185.130.5.231,Malicious,2024-05-01T19:01:00Z Markdown Report # Threat Intelligence Report - Phishing Kit ## Indicators of Compromise ### Domains | Domain | Source | Threat Level | First Seen | |--------------------|------------|--------------|-------------| | shady-site.biz | VirusTotal | Malicious | 2024-05-01 | --- ## ๐ How This Works (Plain English) This tool automates the process of checking Indicators of Compromise (IOCs) against multiple threat intelligence sources. Here's how it works step-by-step: ### Step 1: Parse IOC Input You provide one or more IOCs via command-line arguments: - `--hash` - File hash (MD5, SHA1, or SHA256) - `--ip` - IP address to check - `--domain` - Domain name to check - `--threat-type` - Category label (required: "Emotet", "CISA Alert", or "Phishing Kit") - `--output` - Format for results (csv, json, or report) **Example:** ```bash python scripts/main.py --ip 185.130.5.231 --threat-type "Phishing Kit" --output json
The tool makes authenticated API calls to three services:
VirusTotal API:
https://www.virustotal.com/api/v3AbuseIPDB API:
https://api.abuseipdb.com/api/v2/checkAlienVault OTX API:
https://otx.alienvault.com/api/v1The tool combines data from all sources and standardizes the format:
Results are saved in your chosen format:
CSV Format:
data/threat_intel_iocs.csvJSON Format:
data/threat_intel_iocs.jsonMarkdown Report:
reports/threat_intel_report.md/files/{hash}, /ip_addresses/{ip}, /domains/{domain}/api/v2/check (IP addresses only)/indicators/IPv4/{ip}/general, /indicators/domain/{domain}/general185.130.5.231)example.com).env file exists and contains valid API keysdata/, logs/, reports/ directoriespip install -r requirements.txt# Check if API keys are loaded python -c "from dotenv import load_dotenv; import os; load_dotenv(); print(os.getenv('VIRUSTOTAL_API_KEY'))" # Test with a known good IP (Google DNS) python scripts/main.py --ip 8.8.8.8 --threat-type "Phishing Kit" --output json # Check logs for errors cat logs/threat_intel.log
๐ง What You'll Learn
โ License MIT License
Date: 2026-02-04
Environment: Kali Linux / Ubuntu (Python venv)
APIs Verified: VirusTotal, AbuseIPDB, AlienVault OTX
# Test IP lookup python scripts/main.py --ip 8.8.8.8 --threat-type "CISA Alert" --output report # Test hash lookup python scripts/main.py --hash 44d88612fea8a8f36de82e1278abb02f --threat-type "Emotet" --output report
reports/threat_intel_report_[timestamp].mdlogs/threat_intel.logreports/, data/) automatically during verificationStatus: โ
Verified and Working
Bucket Classification: Bucket A (You Did It)
Interview Ready: Yes - Can explain and demonstrate
๐ค Author Developed by Grey Key Studios