A reproducible, end-to-end description of the AI-assisted penetration-testing workflow this project demonstrates. It follows the standard assessment lifecycle, with ShellGPT acting as a command co-pilot at each stage and a human approving every action.
⚠️ Reproduce this only against systems you own or are explicitly authorized to test — see ../DISCLAIMER.md.
Integrate ShellGPT with the OpenAI API to streamline reconnaissance, scanning, and controlled
exploitation during authorized penetration testing — improving speed and accuracy while
keeping an operator in control via the [E]xecute / [D]escribe / [A]bort gate.
| Component | Value |
|---|---|
| Platform | Kali Linux |
| Language runtimes | Python 3.12, Bash |
| AI assistant | ShellGPT (sgpt) |
| Model / API | OpenAI gpt-4o via the OpenAI API |
| Tooling | Nmap, Sublist3r, Amass, crt.sh, Nikto, Gobuster, FFUF, Hydra, Hashcat, Metasploit, Aircrack-ng suite |
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ 1. Setup & │ → │ 2. Recon & │ → │ 3. Scanning │ → │ 4. Exploit & │ → │ 5. Reporting │
│ Integration │ │ OSINT │ │ & Vuln. │ │ Post-exploit│ │ & Cleanup │
└──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
│ │ │ │ │
sgpt key subdomains/ ports/services/ searchsploit/ document &
+ smoke test DNS/certs NSE vuln scans msf/hydra (sup.) de-scope
pip install shell-gpt --break-system-packagesexport OPENAI_API_KEY="sk-..."(or a git-ignored.env).- Smoke test:
sgpt "Generate an Nmap command for scanning all ports on a target". - (Optional)
./scripts/install-roles.shto load the pentest roles.
Full detail: 01-installation-setup.md.
- Subdomain enumeration:
amass enum -d <domain>,sublist3r -d <domain>, crt.sh viacurl. - DNS interrogation:
dig/nslookup, zone-transfer attempt. - WHOIS/ASN ownership context.
- Generate helper tooling on demand with
sgpt --code.
Full detail: 02-reconnaissance-osint.md.
- Nmap port/service/OS discovery (
-p-,-sV,-sC,-A) viasgpt --chat nmap. - NSE vulnerability scanning (
--script=vuln). - Host discovery automation (ping sweep).
- Web scanning: Nikto, Gobuster, FFUF.
Full detail: 03-scanning-vulnerability-assessment.md.
- Map service/version → exploit with
searchsploit. - Scaffold Metasploit modules with explicit placeholders.
- Controlled credential testing (Hydra) and offline cracking (Hashcat) within scope.
- Privilege-escalation enumeration (
find / -perm -4000, kernel/sudo/cron checks).
Full detail: 04-exploitation-post-exploitation.md.
- Preserve scan output for the report (kept out of version control).
- Record which AI-generated commands were executed vs. aborted.
- Remove tooling, drop shells, restore changes, and de-scope.
Every --shell invocation surfaces the generated command behind [E]xecute / [D]escribe / [A]bort. The operator — not the model — decides what runs. AI output is treated as a draft
to review, never as trusted input to pipe directly into a shell.
- Repetitive command crafting offloaded to the AI co-pilot across all phases.
- Fewer transcription/syntax errors; commands reviewed once rather than retyped.
- Reproducible recon→scan→exploit flows via prompts and roles.
- Total OpenAI spend for the full demonstration: ~$0.02 (text-only usage).