
PhantomRecon is a CLI-based, modular, agent-driven red team automation tool designed to demonstrate autonomous offensive security workflows powered by AI (Google's Gemini via Agent Development Kit - ADK).
PhantomRecon is a CLI-based, modular, agent-driven red team automation tool designed to demonstrate autonomous offensive security workflows powered by AI (Google's Gemini via Agent Development Kit - ADK).
python -m phantomrecon
python -m phantomrecon --target example.com --auto \
--nmap-timeout 30 --nmap-top-ports 100 --nmap-args "-sV -Pn"
--target <domain|ip>: Target to assess--auto: Run recon → plan → route → report--nmap-timeout <seconds>: Overrides NMAP_TIMEOUT--nmap-top-ports <N>: Overrides NMAP_TOP_PORTS--nmap-args "...": Appends to Nmap args (NMAP_ARGS)--nmap-disable: Disable Nmap (sets NMAP_DISABLE=1)Environment variables are also supported directly: NMAP_TIMEOUT, NMAP_TOP_PORTS, NMAP_ARGS, NMAP_DISABLE.
.gitignore excludes reports/* except reports/sample_report.md.reports/ locally only.Built as a proof-of-concept, it simulates identifying a target, performing broad reconnaissance (Nmap, DNS, Web Search), planning an attack strategy using an LLM, executing simulated exploits conditionally, and generating a report.
phantomrecon/
├── phantomrecon/ # Main package (exported orchestrator agent)
│ ├── __init__.py
│ ├── __main__.py # CLI entrypoint (interactive and non-interactive)
│ └── agent/ # Agent graph and tools
├── agents/ # Python modules containing agent/tool logic
│ ├── recon_logic.py # Nmap, DNS (dig), seeded web analysis; ADK search enabled
│ ├── routing_logic.py # Logic for the Exploit Router agent
│ ├── exploit_web_logic.py # Functions for web exploits (currently simulated)
│ ├── exploit_sql_logic.py # Functions for SQL exploits (currently simulated)
│ └── report_logic.py # Functions for report generation using session state
├── configs/
│ └── targets.json # (Optional) Target configuration
├── data/
│ └── dummy_scan_output.json # Example Nmap data if no target specified
├── demos/
│ └── walkthrough.md # Demo steps
├── prompts/ # Prompt templates for LLM agents
├── reports/
│ └── sample_report.md # Example output report
├── requirements.txt # Python dependencies (includes google-adk)
├── .gitignore # Files excluded from version control
└── LICENSE # MIT License
recon_workflow - Parallel Agent):
nmap_tool)dns_tool)web_search_tool)aggregation_tool):
aggregated_recon_data to session state.planning_agent - LlmAgent):
attack_planner_prompt.txt to generate a JSON attack plan.attack_plan to session state.exploit_router - RouterAgent):
attack_plan from state.python3, pip, nmap, dig, whois, sqlmap, wapiti, wpscan, searchsploit.python3 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt
.env.example to .env (if example exists) or edit .This tool is for authorized security testing and educational purposes only. Do not use against systems without explicit permission.
This project is licensed under the MIT License - see the LICENSE file for details.
sudo apt install nmap or brew install nmap)sudo apt install dnsutils or brew install bind)sudo apt install whois or brew install whois)sudo apt install sqlmap or brew install sqlmap)sudo apt install wapiti or brew install wapiti)sudo apt install ruby-full then gem install wpscan or brew install wpscan)adk web interface to ask the user for the target IP/domain.dig, nslookup, dig +trace, AXFR attempt, whois)sqlmap with refined options), Wapiti scan (parsed results), WPScan (parsed results, conditional), Basic Reflected XSS, Basic Command Injection - (Real Checks)searchsploit with refined query), Post-Auth Enumeration (via sqlmap direct connect) - (Real Checks)PhantomRecon uses a fully autonomous multi-agent architecture powered by Google's Agent Development Kit (ADK).
Senior Orchestrator Agent (gemini-1.5-pro-latest)
Specialized Security Agents
The orchestrator operates like a senior penetration tester:
Key Features:
context.session.state (ADK sessions)executor_fix.py)Run via CLI (recommended):
python -m phantomrecon --target <domain|ip> --auto
Interactive console:
python -m phantomrecon
Optional ADK runner:
adk run phantomrecon -- --target <domain|ip> --auto
web_exploit_tool, sql_exploit_tool) based on the plan.exploit_results list in session state.report_tool):
.envGOOGLE_API_KEY variable.GOOGLE_GENAI_USE_VERTEXAI to True or False and configure related variables (GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION) if using Vertex AI.python -m phantomreconpython -m phantomrecon --target <target> --autoadk run phantomreconsudo apt install exploitdb or brew install exploitdb)requirements.txt (install via pip install -r requirements.txt)searchsploitssh-auditToolContext to pass data between agents/tools.