Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/abdaullahag/threatlens
Defensive ToolsIndicator of Compromise (IOC) ManagementOSINT (Open Source Intelligence)Threat Feeds & AggregatorsVulnerability AnalysisScripting & AutomationInformation GatheringThreat IntelligenceIncident ResponseLog Analysis
GitHubabdaullahag/threatlens
8121 day agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →

ThreatLens

Python CLI tool for rapid IOC analysis (IPs, Domains, CVEs) using 6 free Threat Intel APIs. Outputs: Color-coded Excel, JSON, CSV. Uses: VT, Shodan, AbuseIPDB.

View Repository
Share
ThreatLens — Multi-Source Threat Intelligence CLI

Awesome Python License: PolyForm Noncommercial Tests CI PRs Welcome Maintained


Investigate IPs, domains, hashes, and CVEs across 6 free threat intel APIs — without switching between browser tabs.

Quick Start · Usage · Architecture · API Keys · Screenshots · Contributing


🚀 Proudly featured in the official Awesome OSINT repository.


📖 Overview

ThreatLens is a single command-line tool that unifies threat intelligence lookups across the most trusted free OSINT sources. Instead of pasting an IP into five different websites, ThreatLens queries them all in parallel, normalizes the results, and gives you a clear verdict — in the terminal, or in a polished, color-coded Excel/JSON/CSV report.

Built for SOC analysts, incident responders, threat hunters, and anyone who wants fast, reliable IOC enrichment without leaving the shell.

Why ThreatLens

  • One command instead of five browser tabs
  • Auto-extracts IOCs straight out of raw logs
  • A single failing/rate-limited API never blocks the rest
  • Works entirely on free API tiers
  • Local SQLite cache — repeated lookups are instant
  • Request budget cap prevents runaway API spend

Not for

  • Real-time/streaming detection pipelines
  • Paid/enterprise-only intel feeds
  • Replacing a full SIEM or SOAR platform

✨ Features

FeatureDetails
🎯 IOC TypesIP, Domain, URL, File Hash (MD5 / SHA1 / SHA256), CVE
🔌 Integrated APIsAbuseIPDB, VirusTotal, AlienVault OTX, Shodan, URLScan.io, NVD
📄 Log ParsingAutomatically extracts every IOC type from any log or text file
📊 ReportsExcel (color-coded), JSON, CSV
💾 Local CacheSQLite cache with configurable TTL — skip re-querying known IOCs
🛡️ SecurityRedirect blocking, host allow-listing, API-key redaction in logs, spreadsheet-formula neutralisation
🔒 Lockfilerequirements.lock with SHA-256 hashes for reproducible installs
💻 CLI ExperienceRich progress bars, colored tables, and a clean verdict summary
🧩 ArchitectureModular enrichers, typed models, strict separation of concerns
✅ Tested60 unit & integration tests with pytest; CI via GitHub Actions
⚡ ResilientOne failing API never blocks the others — errors are isolated and logged

🚀 Quick Start

root@kitploit:~
# 1. Clone & install
git clone https://github.com/AbdaullahAG/threatlens.git
cd threatlens
pip install -r requirements.txt

# 2. Configure your API keys
cp config/keys.env.example config/keys.env
# → edit config/keys.env and fill in your keys

# 3. Run your first scan
python main.py -i 45.33.32.156

💡 NVD (CVE lookups) works out of the box with no API key. Every other API offers a free tier that takes under 2 minutes to sign up for — see API Keys below.

Reproducible install (with locked dependencies)

root@kitploit:~
pip install --require-hashes -r requirements.lock

🧰 Usage

root@kitploit:~
# Investigate a single IP
python main.py -i 45.33.32.156
Basic single-IOC lookup
root@kitploit:~
# Investigate multiple IOC types at once
python main.py -i 45.33.32.156 -d malware.example.com \
  -s d41d8cd98f00b204e9800998ecf8427e -c CVE-2021-44228
Mix and match IOC types in one run
root@kitploit:~
# Parse a log file — all IOCs auto-extracted
python main.py --file /var/log/apache2/access.log
Bulk investigate straight from raw logs
root@kitploit:~
# Output JSON instead of Excel
python main.py -i 8.8.8.8 --format json
Machine-readable output for pipelines
root@kitploit:~
# Use only specific APIs
python main.py -i 8.8.8.8 --apis abuseipdb virustotal
Restrict enrichment to selected sources
root@kitploit:~
# Generate every report format at once
python main.py --file access.log --format all
Excel + JSON + CSV in a single run
root@kitploit:~
# Lookup a CVE — no API key needed
python main.py -c CVE-2021-44228 --apis nvd --format json
CVE enrichment via NIST NVD (free, no key)
root@kitploit:~
# Verbose / debug mode
python main.py -i 8.8.8.8 -v
Full request/response logging for troubleshooting
See all CLI flags
FlagDescription
-i, --ipIP address(es) to investigate
-d, --domainDomain(s) to investigate
-s, --hashFile hash(es) — MD5 / SHA1 / SHA256
-c, --cveCVE ID(s), e.g. CVE-2021-44228
--filePath to a log/text file to auto-extract IOCs from
--apisRestrict enrichment to a specific set of APIs
--formatOutput format: excel (default) | json | csv | all
--outputDirectory to save reports (default: ./output)
--no-reportPrint results to terminal only, skip saving a file
--cache-pathSQLite path for local cache (default: .threatlens/investigations.db)
--cache-ttlCache lifetime in seconds (default: 3600)
--no-cacheBypass the local cache entirely
--max-requestsCap on external API calls per run (default: 250)
--max-iocsMaximum unique IOCs per run (default: 1000)
--allow-private-iocsAllow private/loopback IPs (disabled by default)
--delayDelay between API calls, for rate-limit tuning
-v, --verboseEnable debug logging

🏗️ Architecture

root@kitploit:~
threat_intel_tool/
├── main.py                      # CLI entry point & argument parser
├── requirements.txt             # Runtime dependencies
├── requirements-dev.txt         # Dev/CI tooling (ruff, bandit, pip-audit, pip-tools)
├── requirements.lock            # Pinned lockfile with SHA-256 hashes
├── pytest.ini                   # pytest configuration (marks, etc.)
├── config/
│   └── keys.env                 # API keys (copy from keys.env.example)
├── output/                      # Generated reports land here
├── src/
│   ├── engine.py                # Main orchestrator (collect → enrich → report)
│   ├── models.py                # IOC & EnrichmentResult dataclasses
│   ├── storage.py               # SQLite cache & investigation history
│   ├── parsers/
│   │   └── ioc_parser.py        # Regex-based IOC extractor with validation
│   ├── enrichers/
│   │   ├── base.py              # Abstract base — safe HTTP client (redirect-block, budget, retry)
│   │   ├── registry.py          # Enricher dispatcher
│   │   ├── abuseipdb.py         # AbuseIPDB      (IP)
│   │   ├── virustotal.py        # VirusTotal     (IP / Domain / URL / Hash)
│   │   ├── otx.py               # AlienVault OTX (IP / Domain / URL / Hash)
│   │   ├── shodan.py            # Shodan         (IP)
│   │   ├── urlscan.py           # URLScan.io     (URL / Domain)
│   │   └── nvd.py               # NVD / NIST     (CVE — no key required)
│   ├── reporters/
│   │   ├── excel_reporter.py    # Color-coded Excel reports
│   │   ├── other_reporters.py   # JSON & CSV output
│   │   └── terminal_display.py  # Rich terminal tables
│   └── utils/
│       ├── config.py            # API key loader & runtime config
│       ├── logger.py            # Rich logging setup
│       ├── banner.py            # ASCII banner
│       ├── quota.py             # Per-run request budget (thread-safe)
│       └── security.py         # IOC validation, formula neutralisation, secret redaction
└── tests/
    ├── conftest.py              # pytest fixtures & --run-e2e flag
    ├── test_core.py             # IOC parser, verdict logic, cache round-trip (34 tests)
    ├── test_enrichers.py        # BaseEnricher HTTP edge-cases — mock only (9 tests)
    ├── test_reporters.py        # Excel/CSV formula protection + SQLite integration (17 tests)
    └── test_cli_e2e.py          # Full CLI run against real NVD API (opt-in, --run-e2e)

Design principles

  • Pluggable enrichers — adding a new intel source only requires a new file in src/enrichers/ that subclasses BaseEnricher. No changes needed elsewhere.
  • Typed IOCs — IOC types are enums, not raw strings, catching mistakes at development time instead of runtime.
  • Safe HTTP client — BaseEnricher.get() enforces HTTPS-only, host allow-listing, redirect blocking, 429/Retry-After handling, and request budget capping in one place.
  • CI/CD-friendly config — keys are read from config/keys.env with a fallback to system environment variables.
  • Per-enricher rate limiting — configurable delay (--delay) keeps you within each API's free-tier limits.
  • Fault isolation — every enricher error is caught, logged, and stored in result.errors; a single failing API never brings down the whole scan.
  • Spreadsheet safety — all values written to Excel and CSV are neutralised against formula-injection (=, +, -, @ prefixes).

🔑 API Keys

ProviderSign UpFree Tier
AbuseIPDBFree1,000 checks/day
VirusTotalFree4 req/min · 500 req/day
AlienVault OTXFreeUnlimited (public feed)
ShodanFreeLimited lookups
URLScan.ioFree5,000 req/day (search is free)
NVD / NISTOptionalNo key required

🧪 Testing

root@kitploit:~
# Run all unit and integration tests (no network required)
pytest tests/ -v --ignore=tests/test_cli_e2e.py

# With coverage report
pytest tests/ -v --ignore=tests/test_cli_e2e.py --cov=src --cov-report=term-missing

# Run the end-to-end CLI test (makes a real NVD request)
pytest tests/test_cli_e2e.py --run-e2e -v

What's tested

Test fileCoverage
test_core.pyIOC parser (all types + edge cases), verdict logic, SQLite cache round-trip
test_enrichers.pyBaseEnricher.get() — redirect blocking, budget exhaustion, 429+Retry-After, API-key redaction in logs, non-JSON response, invalid JSON, host allow-list, HTTP scheme block
test_reporters.pyExcel & CSV formula-injection neutralisation (7 prefix variants), numeric passthrough, SQLite TTL expiry, upsert, investigation recording
test_cli_e2e.pyFull subprocess run: python main.py -c CVE-2021-44228 --apis nvd --format json → exit 0, valid JSON, correct verdict

🔐 Security

ControlImplementation
HTTPS-onlyBaseEnricher.get() rejects any non-https:// URL before making a request
Host allow-listEach enricher declares allowed_hosts; requests to unknown hosts are silently dropped
Redirect blockingAll requests use allow_redirects=False
429 / Retry-AfterSingle automatic retry respecting the Retry-After header (capped at 15 s)
Request budget--max-requests hard-caps total API calls per run
API-key redactionExceptions and log lines have raw key values replaced with [REDACTED]
Formula injectionAll Excel and CSV cell values are sanitised with spreadsheet_value()
IOC validationEvery CLI-supplied IOC is validated and normalised before enrichment
Private IP guardPrivate/loopback addresses are rejected by default (--allow-private-iocs to override)
Dependency auditpip-audit runs in CI; requirements.lock pins all hashes for reproducible installs

📊 Sample Output

Terminal:

root@kitploit:~
╭──────────────────────────── IOC Collection ─────────────────────────────╮
│ Found 4 IOCs to investigate                                              │
│   CVE: 1  Domain: 1  Hash: 1  IP: 1                                     │
╰──────────────────────────────────────────────────────────────────────────╯
✓ Active APIs: abuseipdb, virustotal, otx, shodan, urlscan, nvd

🌐 IP Address Results
┌─────────────────┬──────────────┬──────────┬─────────┬────────────────────┐
│ IP Address      │ Verdict      │ Abuse %  │ Country │ ISP / Org          │
├─────────────────┼──────────────┼──────────┼─────────┼────────────────────┤
│ 45.33.32.156    │ Suspicious   │ 42       │ US      │ Linode             │
└─────────────────┴──────────────┴──────────┴─────────┴────────────────────┘

⚠️  CVE Results
┌──────────────────┬──────────┬──────┬──────────────┐
│ CVE ID           │ Severity │ CVSS │ Published    │
├──────────────────┼──────────┼──────┼──────────────┤
│ CVE-2021-44228   │ Critical │ 10.0 │ 2021-12-10   │
└──────────────────┴──────────┴──────┴──────────────┘

Excel Report: Multi-sheet workbook with color-coded verdicts (🔴 malicious · 🟡 suspicious · 🟢 clean), saved to output/ThreatLens_Report_<timestamp>.xlsx


🖼️ Screenshots

IP Usage Combo lookup #2 Combo lookup #1 Clean IP verdict Malicious and safe IP comparison Hash lookup


🗺️ Roadmap

  • Local SQLite cache with TTL
  • Per-run request budget
  • IOC validation & private-IP guard
  • Spreadsheet formula-injection protection
  • API-key redaction in logs
  • Pinned lockfile with SHA-256 hashes
  • CI pipeline (GitHub Actions)
  • Async/parallel enrichment for faster multi-IOC scans
  • Optional Docker image
  • STIX/TAXII export format
  • Web dashboard (read-only) for report browsing
  • Additional enrichers (GreyNoise, IPQualityScore)

Have an idea? Open an issue — contributions and suggestions are welcome.


🤝 Contributing

Contributions are welcome and appreciated!

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Add tests for any new behavior
  4. Make sure pytest tests/ -v --ignore=tests/test_cli_e2e.py passes and ruff check . is clean
  5. Open a pull request with a clear description of the change

New enrichers, bug fixes, documentation improvements, and test coverage are all great first contributions — see Architecture for how enrichers are structured.


📄 License

This project is licensed under the PolyForm Noncommercial License 1.0.0.

You're free to use, study, modify, and share this code for personal, educational, or research purposes. Commercial use is not permitted without prior written permission from the author ([email protected]).


⚠️ Legal Disclaimer

This tool is intended for educational and authorized security testing purposes only. The user is solely responsible for complying with the terms of service of the integrated APIs and all applicable laws. The author assumes no liability and is not responsible for any misuse, illegal activity, or damage caused by this program.


If ThreatLens saved you time, consider giving it a ⭐ — it helps others discover the project.

Download Tool