Threat Scanner is a cross-platform Python application that helps investigate potentially malicious IP activity. It combines live network inspection, historical log review, and third-party threat-intelligence feeds inside an approachable Tkinter UI, with a CLI for automation.
- Multi-source threat enrichment (AbuseIPDB, VirusTotal, AlienVault OTX)
- Responsive desktop UI with background scanning, progress dialog, and overflow menu for actions
- AI-assisted reporting powered by Google Gemini to generate security insights and answer follow-up questions
- Structured logging with rotating files and consistent scan telemetry
- Parallel scanning with rate-limited API access to respect free-tier quotas
- Exportable JSON reports for downstream analysis
- Python 3.8+
- Tkinter +
ttkthemes - ThreadPoolExecutor for parallel scans
- Requests for HTTP APIs
- dotenv for runtime configuration
- Custom logging handlers (see
handlers/threat_logging.py)
Threat-Scanner/
├── handlers/ # Logging helpers
├── logs/ # Rotating log files
├── scanner/ # Core scanning + AI modules
├── ui/ # Tkinter UI implementation
├── main.py # Entry point (GUI/CLI)
├── requirements.txt # Python dependencies
└── Readme.md
git clone <repository-url>
cd Threat-Scanner
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the project root:
touch .envAdd your keys (free tiers are sufficient while testing):
ABUSEIPDB_API_KEY=...
VIRUSTOTAL_API_KEY=...
ALIENVAULT_API_KEY=...
GEMINI_API_KEY=...- Windows: run PowerShell as Administrator before launching the app.
- macOS / Linux: Tkinter comes with most Python installs; if missing, install
python-tkvia Homebrew or your package manager. When running with elevated privileges, usesudo -Eso environment variables (API keys) survive.
python main.pyWhat to expect:
- Start New Scan – collects active sockets and historical connections, deduplicates, and runs a threat check per IP.
- Progress dialog – scanning happens on a background thread; the UI stays responsive and shows real-time status.
- Results table – one row per IP with scores from AbuseIPDB, VirusTotal, and AlienVault plus location metadata.
- Action bar – primary actions remain on the first row; overflow items move into a
More…menu if the window is narrow. - AI report – use “AI security report” to generate a Gemini summary and ask follow-up questions in a dedicated dialog.
# Scan specific IPs and print summary
python main.py --ip 8.8.8.8 1.1.1.1
# JSON output for automation
python main.py --ip 8.8.8.8 --json
# Use a specific provider only
python main.py --ip 8.8.8.8 --service virustotalCLI mode shares the same logging infrastructure and parallel scanning logic as the GUI. Progress bars auto-adjust to the number of targets collected during runtime.
- Logs are written to
logs/<service>.logwith rotation (10 MB × 5 files). - Log levels can be changed via
ThreatScanLogger.set_levelif needed. scanner/threat_intel.pycentralises API rate limits and normalises responses.
-
Static compilation check:
python -m compileall handlers/threat_logging.py scanner/threat_intel.py ui/gui.py
-
API calls require valid credentials; use sandbox/test IPs when exercising the code.
| Issue | Fix |
|---|---|
| GUI fails to open | Verify Tkinter installation (python -c "import tkinter; tkinter._test()"). |
| Permission errors on macOS/Linux | Run with sudo -E python main.py. |
| API quota exceeded | Reduce concurrency or wait for the provider reset; free tiers have strict limits. |
| Partial buttons in action bar | Resize window or use the More… dropdown (responsive layout is enabled). |
- Batch lookups and caching of repeated IPs
- Additional intelligence sources (e.g., Shodan, GreyNoise)
- Improved reporting (CSV/PDF exports, scheduled jobs)
- Enhanced visualisation (maps, trend charts)
MIT License – see LICENSE for full details.
This project is actively iterated on. If you spot bugs or have feature ideas:
- Open an issue with reproduction steps and log snippets where possible.
- Fork, create a feature branch, and submit a pull request.
- Tag improvements with the roadmap categories above to keep things organised.
Happy scanning!