BugTraceAI-CLI
April 7, 2026 Β· View on GitHub
π Table of Contents
- π¨ Disclaimer
- β¨ Features
- π¬ Core Methodology
- ποΈ Architecture
- π οΈ Technology Stack
- π Getting Started
- π€ AI Assistant Setup (MCP)
- βοΈ Configuration
- π Output
- π License
π The First Agentic Framework Intelligently Designed for Bug Bounty Hunting
BugTraceAI-CLI is an autonomous offensive security framework that combines LLM-driven analysis with deterministic exploitation tools. Unlike passive analysis tools, BugTraceAI-CLI actively exploits vulnerabilities using real payloads, SQLMap integration, and browser-based validation to deliver confirmed, actionable findings.
The core philosophy is "Think like a pentester, execute like a machine, validate like an auditor" - using AI for intelligent hypothesis generation, but relying on real tools for exploitation and validation.
π¨ Disclaimer
This tool is for authorized security testing only.
BugTraceAI-CLI performs active exploitation including:
- Real SQL injection payloads via SQLMap
- XSS payload execution in browsers
- Template injection testing
- Server-side request forgery probing
By using this tool, you acknowledge and agree that:
- You will only test applications for which you have explicit, written permission
- You understand this tool sends actual attack payloads to targets
- The creators assume no liability for any misuse or damage caused
Unauthorized access to computer systems is illegal.
β¨ Features
BugTraceAI-CLI implements a 6-phase pipeline that mirrors a professional penetration testing workflow.
Phase 1: Reconnaissance
- π·οΈ GoSpider Integration: Fast async crawling with JavaScript rendering and sitemap parsing
- π Parameter Extraction: Automatic identification of injectable parameters
- π API Endpoint Enrichment: Detail URL discovery from list endpoints
- π§ SPA Route Inference: Infers API endpoints from frontend routes
Phase 2: Discovery (DASTySAST)
- π§ Multi-Persona Analysis: 6 different AI "personas" analyze each URL (bug bounty hunter, code auditor, pentester, etc.)
- β Consensus Voting: Requires 4/5 agreement from analysis personas to reduce false positives
- π Skeptical Review: The 6th "Skeptical" persona (Claude Haiku) performs final filtering
- π― Nuclei CVE Scanning: Template-based detection of known vulnerabilities (runs in parallel)
- π‘οΈ Parallel Execution: All personas analyze simultaneously for speed
Phase 3: Strategy
- π― ThinkingConsolidationAgent: Central brain that routes findings to specialists
- π Deduplication: Eliminates redundant findings across URLs
- β‘ Priority Routing: High-confidence findings get tested first
- π‘οΈ SQLi Bypass: SQL injection candidates always reach SQLMap (tool decides, not LLM)
- π§© Auto-Dispatch: Framework detection triggers specialist agents automatically (e.g., Angular β CSTIAgent)
Phase 4: Exploitation
Real tools, real payloads, real results β 14 autonomous specialist agents:
| Agent | Target | Method |
|---|---|---|
| π₯ XSSAgent | Cross-Site Scripting | Playwright browser + 6-level escalation pipeline |
| π SQLiAgent | SQL Injection | SQLMap with WAF bypass tamper scripts |
| π CSTIAgent | Client/Server-Side Template Injection | AngularJS, Vue, Jinja2, Twig, Mako |
| π SSRFAgent | Server-Side Request Forgery | OOB callback verification |
| π XXEAgent | XML External Entity | DTD injection + OOB exfiltration |
| π IDORAgent | Insecure Direct Object Reference | ID manipulation + path segment testing |
| π LFIAgent | Local File Inclusion | Path traversal with filter evasion |
| π§© PrototypePollutionAgent | Prototype Pollution | Browser-based property verification |
| π APISecurityAgent | API Security | Broken Object Level Authorization (BOLA) testing |
| π JWTAgent | JWT Vulnerabilities | Algorithm confusion, weak secrets, token forging |
| π OpenRedirectAgent | Open Redirect | HTTP 3xx + DOM-based redirect detection |
| π RCEAgent | Remote Code Execution | Command injection + deserialization testing |
| π¨ HeaderInjectionAgent | Header Injection | CRLF injection + response splitting |
| π¦ MassAssignmentAgent | Mass Assignment | Parameter pollution + privilege escalation |
| π KaliAgent | Advanced Exploitation | Full Kali Linux terminal toolset via MCP (Nmap, Metasploit, etc.) |
| π΅οΈ ReconAgent | Automated Recon | Fully automated ReconFTW orchestration for deep reconnaissance |
Phase 5: Validation
- π₯οΈ Chrome DevTools Protocol: Low-level browser verification for XSS
- ποΈ Vision AI: Screenshot analysis confirms visual vulnerabilities
- πΈ Evidence Capture: Every confirmed finding includes proof
Phase 6: Reporting
- π AI-Powered Reports: LLM-generated executive and technical assessments
- π Multiple Formats: JSON (machine-readable), Markdown, and HTML reports
- π¬ PoC Enrichment: Batch proof-of-concept generation for confirmed findings
- π Specialist Audit Trail: Per-agent WET/DRY/Results traceability
Intelligence Systems
- π LLM Shifting: Automatic fallback through model tiers (Gemini β DeepSeek β Claude β Qwen)
- π‘οΈ WAF Detection: Identifies Cloudflare, Akamai, AWS WAF, ModSecurity
- π― Adaptive Bypass: Encoding, chunking, and case mixing strategies per WAF type
- π‘οΈ Ecosystem Robustness: Built-in circuit breakers for infinite loops, adaptive rate-limiting, and cross-interface (LAN/Remote) compatibility.
π¬ Core Methodology
BugTraceAI-CLI uses a multi-layered approach to maximize accuracy while minimizing false positives.
Multi-Persona Analysis
Instead of a single AI scan, each URL is analyzed by 6 different "personas" providing diverse perspectives:
- Bug Bounty Hunter: Focuses on high-impact, reward-worthy issues (RCE, SQLi, SSRF)
- Code Auditor: analyzing code patterns, input validation, and logic flaws
- Pentester: Standard attack-surface mapping and OWASP Top 10 exploitation
- Security Researcher: Novel attack vectors, race conditions, and edge cases
- Red Team Operator: Advanced attack chains, privilege escalation, and lateral movement
- Skeptical Reviewer: A separate "critic" agent that aggressively filters false positives
Consensus + Skeptical Review
5 Analysis Personas run in parallel
β
Consensus voting (Agreement analysis)
β
6th Persona "Skeptical Agent" Review (Claude Haiku)
β
Passed to specialist agents
Tool-Based Validation
The key differentiator: AI hypothesizes, tools validate.
- SQLi findings β SQLMap confirms with real injection
- XSS findings β Playwright executes payload in browser
- All findings β CDP + Vision AI provides evidence
This eliminates the "hallucination problem" of pure-AI scanners.
ποΈ Reactor Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BUGTRACE REACTOR β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ β
β β Phase 1 β β Phase 2 β β Phase 3 β β Phase 4 β β
β β Recon β β β Discovery β β β Strategy β β βExploitationβ β
β β GoSpider β β DASTySAST β β ThinkingAg.β β 14 Agents β β
β β URL Enrich β β 6 Personas β β Dedup β β SQLMap β β
β β SPAβAPI β β + Nuclei β β Routing β β Playwright β β
β ββββββββββββββ ββββββββββββββ ββββββββββββββ βββββββ¬βββββββ β
β β β
β βΌ β
β ββββββββββββββ β
β β Phase 5 β β
β β Validation β β
β β CDP β β
β β Vision AI β β
β βββββββ¬βββββββ β
β β β
β βΌ β
β ββββββββββββββ β
β β Phase 6 β β
β β Reporting β β
β βJSON/MD/HTMLβ β
β ββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Parallelization Control
Each phase runs with independent concurrency:
| Phase | Concurrency | Configurable | Notes |
|---|---|---|---|
| Reconnaissance | 1 | No | GoSpider is already fast |
| Discovery | 5 | Yes | Parallel DAST per URL |
| Strategy | 1 | No | Sequential dedup + routing |
| Exploitation | 10 | Yes | Parallel specialist agents |
| Validation | 1 | No | CDP limitation (hardcoded) |
| Reporting | 1 | No | Sequential report generation |
Why is Validation = 1? Chrome DevTools Protocol doesn't support multiple simultaneous connections. Additionally,
alert()popups from XSS payloads block CDP indefinitely. Single-threaded with timeouts prevents crashes.
π οΈ Technology Stack
- Language: Python 3.10+
- AI Provider: OpenRouter (Gemini, Claude, DeepSeek, Qwen)
- Local AI: BAAI/bge-small-en-v1.5 (SOTA Embeddings & Semantic Search)
- Browser Automation: Playwright (exploitation), Chrome CDP (validation)
- SQL Injection: SQLMap via Docker
- Crawling: GoSpider via Docker
- CVE Scanning: Nuclei via Docker
- Database: SQLite with WAL mode
- Async: asyncio + aiohttp
π Getting Started
Prerequisites
- For Docker: Docker & Docker Compose
- For Local: Python 3.10+, Docker (for some agents), nmap (optional)
- OpenRouter API key (get one here)
π― Quick Installation (Recommended)
Use the interactive installation wizard for automatic setup:
# Clone the repository
git clone https://github.com/BugTraceAI/BugTraceAI-CLI
cd BugTraceAI-CLI
# Run the installation wizard
./install.sh
The wizard will:
- β Check system requirements automatically
- π Detect and use free ports for Docker (no conflicts!)
- βοΈ Set up environment configuration
- π³ Build and start Docker containers OR configure local Python environment
- π¨ Provide beautiful, interactive terminal UI
Installation Options:
- Local Installation - Python virtual environment (best for development)
- Docker Installation - Containerized deployment (best for production)
π Manual Installation
Click to expand manual installation instructions
Local Installation
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Install browser
playwright install chromium
# Configure environment
cp .env.example .env
# Edit .env and add your OPENROUTER_API_KEY
Docker Installation
# Configure environment
cp .env.example .env
# Edit .env and add your OPENROUTER_API_KEY
# Build and start
docker-compose up -d
# View logs
docker-compose logs -f
Quick Start
# Full scan
./bugtraceai-cli scan https://target.com
# Clean scan (reset database)
./bugtraceai-cli scan https://target.com --clean
# Resume interrupted scan
./bugtraceai-cli scan https://target.com --resume
# Start API server (for Web UI)
./bugtraceai-cli serve --port 8000
Docker Users:
# API is already running at http://localhost:8000
# (or whatever port was auto-selected during installation)
# Execute scans via API or Web UI
curl http://localhost:8000/health
π€ AI Assistant Setup (MCP)
BugTraceAI is MCP-compatible β control your security scans directly from your AI assistant through natural conversation.
Works with OpenClaw (Telegram-based AI assistant), Claude Code, Cursor, and any MCP-compatible client. Deploy once, control from anywhere.
How It Works
BugTraceAI exposes its scanning engine as MCP tools via the Model Context Protocol β the open standard for connecting AI assistants to external tools. Your AI assistant can start scans, monitor progress, query findings, and retrieve reports β all through chat.
Quick Setup for AI Agents
Using OpenClaw or another AI assistant? Just tell it:
Clone https://github.com/BugTraceAI/BugTraceAI-CLI and deploy it with Docker. Copy
.env.exampleto.envand ask me for theOPENROUTER_API_KEY. Rundocker compose up -dto start both the API and MCP server. Then add the MCP server to your config with base URLhttp://localhost:8001/sse.
Manual MCP Setup
# 1. Clone and configure
git clone https://github.com/BugTraceAI/BugTraceAI-CLI
cd BugTraceAI-CLI
cp .env.example .env
# Edit .env β add your OPENROUTER_API_KEY
# 2. Start services (API + MCP)
docker compose up -d
# 3. Verify endpoints
curl -f http://localhost:8000/health # API health check
curl -sf http://localhost:8001/sse # MCP SSE endpoint
Connect Your AI Assistant
Add BugTraceAI to your MCP client configuration:
{
"mcpServers": {
"bugtraceai": {
"baseUrl": "http://localhost:8001/sse",
"description": "BugTraceAI Security Scanner"
}
}
}
Available MCP Tools
Once connected, your AI assistant can use these tools:
| Tool | Description |
|---|---|
start_scan | Start a security scan on a target URL |
get_scan_status | Check scan progress and current phase |
query_findings | Retrieve vulnerability findings with filtering |
stop_scan | Stop a running scan gracefully |
export_report | Get scan report (summary, critical findings, or full) |
Prerequisites
- Docker & Docker Compose installed and running
- OpenRouter API key (get one here)
- An MCP-compatible AI assistant (OpenClaw, Claude Code, Cursor, or any MCP client)
Ports
| Service | Port | Description |
|---|---|---|
| API | 8000 | REST API + health check |
| MCP | 8001 | SSE transport for AI assistants |
βοΈ Configuration
All settings in bugtraceaicli.conf:
[API]
OPENROUTER_API_KEY = sk-or-v1-xxxxx
[SCAN]
MAX_URLS = 100
MAX_CONCURRENT_ANALYSIS = 5
MAX_CONCURRENT_SPECIALISTS = 10
[SCANNING]
MANDATORY_SQLMAP_VALIDATION = True
STOP_ON_CRITICAL = False
[VALIDATION]
CDP_ENABLED = True
VISION_ENABLED = True
Model Configuration
[LLM_MODELS]
DEFAULT_MODEL = google/gemini-2.0-flash-thinking-exp:free
SKEPTICAL_MODEL = anthropic/claude-3.5-haiku:beta
VISION_MODEL = google/gemini-2.0-flash-thinking-exp:free
π Output
Reports
Generated in /reports/:
report_*.json- Machine-readable findingsreport_*.md- Markdown summaryreport_*.html- Executive presentation
Logs
Located in /logs/:
execution.log- Detailed tracellm_audit.jsonl- Every AI prompt/responseerrors.log- Error tracking
Finding Status Flow
CANDIDATE β PENDING_VALIDATION β CONFIRMED / FALSE_POSITIVE β PROBE_VALIDATED
π License
AGPL-3.0 License
Copyright (c) 2026 BugTraceAI
See LICENSE for details.
Made with β€οΈ by Albert C. @yz9yt