AI-powered penetration testing tool with interactive follow-up capabilities.
Double-click start-pentestgpt.bat to:
- β Check Python installation
- β Verify project structure
- β Check/install dependencies
- β Start backend server (port 8000)
- β Start frontend server (port 8080)
- β Open browser automatically
Double-click stop-pentestgpt.bat to stop all services.
Or simply close both console windows (Backend & Frontend).
cd backend
pip install -r requirements.txtCreate backend/.env file:
OPENROUTER_API_KEY=your_api_key_here
DEFAULT_MODEL=google/gemini-2.0-flash-exp:freeBackend:
cd backend
python -m uvicorn app:app --reload --host 0.0.0.0 --port 8000Frontend:
cd frontend
python -m http.server 8080Open: http://localhost:8080
- Automated Reconnaissance - Domain/IP analysis
- Port Scanning - Nmap-powered service detection
- Web Vulnerability Assessment - Directory enumeration, security headers
- AI Analysis - Vulnerability prioritization and recommendations
- Report Generation - Downloadable JSON reports
After initial scan completes:
- AI Suggestions - Context-aware next step recommendations
- Natural Language Commands - "brute force SSH on port 22"
- 10+ Security Tools - hydra, sqlmap, nikto, nmap, dirb, etc.
- Real-time Results - Live command execution and output
- Command History - Track all interactive testing
- Click "New Session"
- Enter target:
127.0.0.1or any IP/domain - Click "Start"
Watch the real-time activity feed as the scan progresses.
Look for the "π€ Continue Testing" section:
- Click "π‘ Show Suggestions" for AI recommendations
- Or type commands like:
"scan port 80 for vulnerabilities""brute force SSH with common passwords""enumerate web directories""check for SQL injection"
The backend terminal shows detailed operations:
[AI_INTERPRETER] Received command: 'brute force SSH'
[COMMAND] Executing: hydra -l root -P wordlist.txt ssh://127.0.0.1:22
[COMMAND] β
Completed: hydra
[TOOL_EXECUTOR] β
'hydra' execution completed successfully
Visual indicators:
- β Success
- β Errors
- β±οΈ Timeouts
pentestgpt-web/
βββ backend/
β βββ app.py # FastAPI application
β βββ session_manager.py # Session management
β βββ config.py # Configuration
β βββ pentest_engine/
β β βββ orchestrator.py # Main pentest orchestrator
β β βββ ai_client.py # AI integration
β β βββ command_interpreter.py # NEW: AI command parser
β β βββ tool_executor.py # NEW: Security tool executor
β β βββ ...
β βββ .env # Environment variables
βββ frontend/
β βββ index.html # Main UI
β βββ app.js # Application logic (with interactive chat)
β βββ styles.css # Styling
βββ start-pentestgpt.bat # One-click launcher
βββ stop-pentestgpt.bat # Shutdown script
| Tool | Purpose | Risk Level |
|---|---|---|
| nmap | Port scanning | Low |
| nikto | Web vulnerability scanning | Low |
| dirb | Directory enumeration | Low |
| gobuster | Directory/DNS bruteforcing | Low |
| wpscan | WordPress scanning | Low |
| sqlmap | SQL injection testing | Medium |
| hydra | Password bruteforcing | Medium |
| enum4linux | SMB enumeration | Low |
| smbclient | SMB share access | Low |
| metasploit | Exploitation (manual only) | High |
- Timeouts - All commands have max execution time
- Resource Limits - Brute force limited to 4 threads
- No Auto-Exploit - Metasploit shows manual commands only
- Tool Checks - Graceful failure with install prompts
| Endpoint | Method | Purpose |
|---|---|---|
/api/sessions |
GET | List all sessions |
/api/sessions |
POST | Create new session |
/api/sessions/{id} |
GET | Get session details |
/api/sessions/{id}/command |
POST | Execute interactive command |
/api/sessions/{id}/suggestions |
GET | Get AI suggestions |
/api/sessions/{id}/commands |
GET | Get command history |
/ws/sessions/{id} |
WebSocket | Real-time updates |
Python not found?
- Install Python 3.11+ from https://python.org
- Make sure to check "Add to PATH" during installation
Dependencies fail to install?
- Run as administrator
- Update pip:
python -m pip install --upgrade pip
Backend won't start?
- Check if port 8000 is already in use
- Verify
.envfile has API key
API connection errors?
- Verify OpenRouter API key in
backend/.env - Check internet connection
- Python 3.11+
- Windows OS (for .bat files, Linux users can run commands manually)
- OpenRouter API key (for AI features)
- Internet connection
- Implementation Plan: See
brain/implementation_plan.md - Walkthrough: See
brain/walkthrough.md - Task Checklist: See
brain/task.md
For authorized testing only. Only use this tool on systems you have explicit permission to test. Unauthorized penetration testing is illegal.
Version: 2.0 (with Interactive Follow-up)
License: MIT
Author: AI-Assisted Development