Skip to content

Repository files navigation

๐Ÿ•ต๏ธ Passive Recon โ€” Enterprise OSINT/EASM/CTEM Agent

Zero-touch, purely passive external asset discovery platform

No probes sent to targets. No logs generated on their side. Just 15+ public data sources cross-validated.

CI Python License PRs Welcome

๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡็‰ˆ

Status: Actively maintained โ€” daily data source updates and CI runs on every commit.


๐ŸŒŸ What is Passive Recon?

Passive Recon is a purely passive OSINT/EASM/CTEM platform that discovers an organization's external assets by querying 15+ public data sources โ€” certificate transparency logs, DNS records, search engines, network mapping, GitHub, Wayback Machine, and more โ€” without ever touching the target's systems.

One command, any target:

pip install -r requirements.txt
python cli.py collect "Tsinghua University"
python cli.py collect --domain example.com "Acme Corp"

The system auto-infers the target domain, runs all 15 sources in parallel, and produces a comprehensive asset report with risk findings.


โœจ Features

Capability Description
Passive Asset Discovery 15+ cross-validated data sources, auto domain inference
Subdomain Enumeration crt.sh, HackerTarget, URLScan, Wayback, DNSDumpster, and more
IP & Port Mapping C-segment clustering, exposed port detection
Risk Detection VPN exposure, OA systems, weak ciphers, known vulnerabilities
Compliance Guardrail R1 compliance check on every outbound call โ€” fail-closed
Rate Limiting Per-IP sliding window โ‰ค95%, queue never drops tasks
Approval Workflow High-risk outbound requires manual approval
Audit Trail Full operation audit log
Static Guard CI scan that blocks active-scan code from entering production
Web Dashboard python cli.py serve โ€” one-click panel
Scheduled Tasks python cli.py schedule --targets targets.txt โ€” daily auto-collection
Auto-save Reports Markdown report saved to data/report_<target>_<domain>.md
๐Ÿค– AI Domain Inference DeepSeek-powered domain inference for any target (no lookup table needed)
๐Ÿค– AI Risk Scoring Automatic risk scoring (0-100) with false positive filtering
๐Ÿค– AI Report Summary Auto-generated analysis report after each collection
๐Ÿค– AI Chat Query python cli.py ask "What VPNs does Tsinghua have?" โ€” natural language asset search
๐Ÿ“Œ CVE Vulnerability Intel Auto-correlate discovered assets with NVD/OSV for known vulnerabilities
๐Ÿ“Š CVE Lookup python cli.py cve CVE-2024-xxxx โ€” query CVE details from NVD + OSV
๐Ÿ” Change Tracking Scheduled runs compare snapshots and flag new/changed assets

๐Ÿค– AI Features

Passive Recon integrates with DeepSeek (no additional cost, free tier available) to provide AI-powered enhancements:

Feature Command Description
AI Domain Inference python cli.py collect "any target" Auto-infers domain for any target via AI, not just lookup table entries
AI Risk Scoring python cli.py collect "target" Scores each risk 0-100, filters false positives, suggests fixes
AI Report Summary python cli.py collect "target" Generates a natural language analysis report after collection
AI Chat Query python cli.py ask "question" Ask natural language questions about your asset database

Examples:

# AI domain inference works for any target, not just known ones
python cli.py collect "some unknown company"

# AI risk scoring with severity visualization
python cli.py collect "Tsinghua University"
# Output: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 85 [P1] VPN entry exposed: vpn.tsinghua.edu.cn
#               ๐Ÿ’ก Suggest restricting VPN entry to an IP allowlist and enabling MFA

# AI chat query โ€” ask questions in natural language
python cli.py ask "What VPNs does Tsinghua University have?"
python cli.py ask "List all discovered mail servers"
python cli.py ask "What are the most critical risks?"

To skip AI processing (faster, no API call):

python cli.py collect "target" --no-ai

Environment variable: Set DEEPSEEK_API_KEY (already configured if you have it) to enable AI features. The free DeepSeek tier is sufficient for personal use.


๐Ÿ“ก Data Sources

Source Key Required Type
crt.sh โŒ Free Certificate Transparency
HackerTarget โŒ Free DNS / Subdomain
URLScan.io โŒ Free Historical Snapshots
AlienVault OTX โŒ Free Passive DNS / Threat Intel
Wayback Machine โŒ Free Historical URLs / Subdomains
DNSDumpster โŒ Free DNS Mapping / MX/NS Records
CommonCrawl โŒ Free Web Crawl Archive
GitHub โŒ Free (rate-limited) Code Leak Search
Hunter (Yingtu) โœ… Required Network Space Mapping
FOFA โœ… Required Network Space Search
SecurityTrails โœ… Required Subdomain / Passive DNS
Shodan โœ… Required Internet Device Search
VirusTotal โœ… Required Passive DNS / Subdomain
ZoomEye โœ… Required Network Space Mapping
Qichacha โœ… Required Chinese Enterprise Registry
NVD โŒ Free CVE Vulnerability Database
OSV.dev โŒ Free Open Source Vulnerability Database

๐Ÿš€ Quick Start

1. Install Dependencies

pip install -r requirements.txt

2. Configure API Keys (choose one)

Option A: Environment Variables (recommended โ€” never written to disk)

# Linux / macOS
export PASSIVE_API_KEYS='{"hunter":["key1","key2"],"qichacha":{"app_key":"xxx","secret_key":"xxx"}}'

# Windows PowerShell
$json='{"hunter":["key1","key2"],"qichacha":{"app_key":"xxx","secret_key":"xxx"}}'
[Environment]::SetEnvironmentVariable('PASSIVE_API_KEYS', $json, 'User')

Option B: config.json

cp config.example.json config.json
# Edit config.json with your keys

Zero-config mode: run python cli.py serve --demo to start with mock data โ€” no API keys needed for evaluation.

3. Run Asset Discovery

# One-shot: any target, auto domain inference
python cli.py collect "Tsinghua University"
python cli.py collect --domain example.com "Acme Corp"

# Batch mode
python cli.py batch targets.txt

# One-click web dashboard
python cli.py serve

# Daily scheduled collection (2:00 AM)
python cli.py schedule --targets targets.txt

๐Ÿ“Š Sample Output

After running python cli.py collect "Tsinghua University":

๐ŸŽฏ Target: Tsinghua University
๐ŸŒ Auto-inferred domain: tsinghua.edu.cn

# Tsinghua University Passive Asset Collection Report
> Main domain: tsinghua.edu.cn | Sources: 15
> Total: 285

## ๐Ÿ“Š Asset Overview
| Type | Count |
|------|-------|
| subdomain | 270 |
| IP address | 178 |
| port | 2 |
| **Total** | **285** |

## ๐Ÿšจ Risk Findings
- ๐Ÿ”ด [P1] VPN entry exposed: vpn.tsinghua.edu.cn
- ๐Ÿ”ด [P1] WebVPN remote access exposed: webvpn.tsinghua.edu.cn

๐Ÿ”ง Environment Variables

Variable Type Description Required
PASSIVE_API_KEYS JSON string Data source API keys (see below) โœ… For some sources
PASSIVE_API_TOKENS Comma-separated REST API auth tokens Optional
PASSIVE_API_KEY String Single token fallback Optional
PASSIVE_DB_PATH Path SQLite path (default: data/agent.db) Optional
PASSIVE_LOG_PATH Path Audit log path (default: data/audit.jsonl) Optional
PASSIVE_PII_SALT String PII de-identification salt Optional
PASSIVE_PII_KEY String PII encryption key Optional

API Key JSON Format

{
  "hunter": ["key1", "key2"],
  "qichacha": {
    "app_key": "your_app_key",
    "secret_key": "your_secret_key"
  },
  "shodan": "your_shodan_key",
  "virustotal": "your_vt_key",
  "zoomeye": "your_zoomeye_key"
}

๐Ÿ“ Project Structure

โ”œโ”€โ”€ cli.py                          โ† CLI entry point (one command to rule them all)
โ”œโ”€โ”€ config.example.json             โ† Config template
โ”œโ”€โ”€ requirements.txt                โ† Python dependencies
โ”‚
โ”œโ”€โ”€ passive_agent/                  โ† ๐ŸŽฏ Core source
โ”‚   โ”œโ”€โ”€ main.py                     โ† FastAPI app + dashboard API
โ”‚   โ”œโ”€โ”€ config.py                   โ† Config loader (env > config.json)
โ”‚   โ”œโ”€โ”€ api/                        โ† REST API routes
โ”‚   โ”œโ”€โ”€ collector/                  โ† 15 passive data source collectors
โ”‚   โ”œโ”€โ”€ enumerator/                 โ† Subject enumeration engine
โ”‚   โ”œโ”€โ”€ verifier/                   โ† DNS-only verification pipeline
โ”‚   โ”œโ”€โ”€ compliance/                 โ† Compliance guardrail
โ”‚   โ”œโ”€โ”€ gateway/                    โ† Proxy gateway + rate limiter
โ”‚   โ”œโ”€โ”€ orchestrator/               โ† Orchestration scheduler
โ”‚   โ”œโ”€โ”€ approval/                   โ† Approval workflow
โ”‚   โ”œโ”€โ”€ audit/                      โ† Audit logging
โ”‚   โ”œโ”€โ”€ inventory/                  โ† Asset inventory
โ”‚   โ”œโ”€โ”€ graph/                      โ† Knowledge graph (planned)
โ”‚   โ”œโ”€โ”€ metrics/                    โ† Metrics (planned)
โ”‚   โ”œโ”€โ”€ scheduler/                  โ† Daily scheduled tasks
โ”‚   โ”œโ”€โ”€ storage/                    โ† SQLite + JSON persistence
โ”‚   โ”œโ”€โ”€ common/                     โ† Shared components
โ”‚   โ””โ”€โ”€ static/                     โ† Frontend static files
โ”‚
โ”œโ”€โ”€ tests/                          โ† Test suite
โ”œโ”€โ”€ scripts/                        โ† CI guard scripts
โ”œโ”€โ”€ docs/                           โ† Design documents
โ””โ”€โ”€ data/                           โ† Runtime data (gitignored)

Full design docs live in docs/ โ€” system design, sequence diagrams, and class diagrams.


๐Ÿงช Running Tests

# Full test suite
pytest

# Passive egress guard (CI gate)
pytest tests/test_passive_egress.py -v

# Static guard โ€” ensures no active-scan code enters production
python scripts/guard_passive.py

The passive egress guard and static guard run automatically in CI (.github/workflows/ci.yml) and block any active-scan code from merging.


๐Ÿ›ก๏ธ Core Principles

  1. Purely Passive โ€” Never send a single packet to the target
  2. Zero Logs โ€” Never touch the target's logging systems
  3. Compliant Egress โ€” Every outbound call must pass compliance_client.check()
  4. Fail-Closed โ€” If in doubt, deny; if misconfigured, deny; if no token, deny
  5. Auditable โ€” Every operation writes to the audit log (data/audit.jsonl) for compliance review

๐Ÿค Contributing

PRs are welcome! Whether it's adding a new data source adapter, improving the dashboard, or fixing a bug โ€” all contributions help make passive recon more powerful.


๐Ÿ“œ License

MIT


Passive Recon โ€” Star โญ on GitHub
Made with โค๏ธ for the OSINT / EASM / CTEM community


License & Usage Notice

Source-Available ยท All Rights Reserved

This project is source-available and all rights are reserved by the author. The code is provided for viewing and evaluation purposes only โ€” access does not grant any right to copy, modify, redistribute, use commercially, or create derivative works. Unauthorized reuse may carry legal risk. Contact the author for explicit written permission before any other use.

ๆœฌไป“ๅบ“ไธบใ€Œๆบ็ ๅฏๆŸฅใ€ๆƒๅˆฉไฟ็•™ใ€้กน็›ฎ๏ผˆsource-available / all-rights-reserved๏ผ‰ใ€‚ไปฃ็ ไป…ไพ›ๆŸฅ็œ‹ไธŽ่ฏ„ไผฐ๏ผŒๆœชๆŽˆๆƒไปปไฝ•ๅคๅˆถใ€ๅ†ๅˆ†ๅ‘ใ€ไฟฎๆ”นใ€ๅ•†็”จๆˆ–่ก็”Ÿๅˆ›ไฝœใ€‚ๆ“…่‡ชๅ€Ÿ็”จไปฃ็ ๅญ˜ๅœจๆณ•ๅพ‹้ฃŽ้™ฉ๏ผ›ๅฆ‚ๆœ‰้œ€่ฆ่ฏทๅ…ˆ่”็ณปไฝœ่€…่Žทๅ–ๆ˜Ž็กฎไนฆ้ข่ฎธๅฏใ€‚

About

๐Ÿ•ต๏ธ Purely passive OSINT/EASM/CTEM platform โ€” 15+ data sources, zero-touch asset discovery, risk detection

Topics

Resources

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages