CTF mode deploys the swarm against a single machine IP with one goal: capture all flags. The solver iterates through enumeration, initial foothold, privilege escalation, and flag collection — generating a structured writeup at the end. It is designed for retired HackTheBox machines, TryHackMe rooms, and personal lab targets where you have explicit access.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Armur-Ai/Pentest-Swarm-AI/llms.txt
Use this file to discover all available pages before exploring further.
Supported platforms
| Platform | Short code | Notes |
|---|---|---|
| HackTheBox | htb | Uses the HTB API (labs.hackthebox.com/api/v4). Retired machines only by default. |
| TryHackMe | thm | Uses the THM API. Requires your TryHackMe API key. |
| Generic / lab | generic | No platform API calls — just solve against the raw IP. |
Solve a CTF machine
The solver does not manage VPN connections. You must connect to the HackTheBox or TryHackMe VPN before running the solver — the machine’s IP must be reachable from your host.
# HackTheBox — download your .ovpn from the HTB dashboard
sudo openvpn --config ~/htb.ovpn &
# TryHackMe — download from tryhackme.com/access
sudo openvpn --config ~/thm.ovpn &
The
--follow flag streams live agent events — recon findings, exploitation attempts, privilege escalation chains — as they happen. [recon] nmap: open ports 21/ftp, 22/ssh, 139/smb, 445/smb
[recon] httpx: no web service on common ports
[classify] CVE-2007-2447 matched: Samba 3.0.20 usermap script RCE
[exploit] attack chain: SMB → usermap → reverse shell
[exploit] foothold established as daemon
[privesc] checking SUID binaries, cron, writable PATH...
[flags] user.txt captured: /home/makis/user.txt
[flags] root.txt captured: /root/root.txt
[report] writeup written to ./reports/Lame-htb-writeup.md
CTF: Find all flags (user.txt and root.txt). Focus on privilege escalation
chains, SUID binaries, cron jobs, writable scripts, kernel exploits, and
password reuse. Check /home/*/user.txt and /root/root.txt.
# View the writeup
cat ./reports/Lame-htb-writeup.md
# Retrieve the writeup for a previously-completed campaign
pentestswarm ctf writeup <campaign-id>
# Lame — HTB Writeup
**Time:** 4m32s
**Result:** Solved
---
## Enumeration
- [recon] nmap: open ports 21/ftp 22/ssh 139/smb 445/smb
...
## Exploitation
- [exploit] attack chain: SMB → usermap → reverse shell
...
## Flags
- **user flag**: `...`
- Path: /home/makis/user.txt
- Method: ...
- **root flag**: `...`
- Path: /root/root.txt
- Method: ...
CTF solver playbook
The built-inctf-solver.yaml playbook defines the four-phase solve loop. The difficulty variable controls the agent-hour budget allocated to the campaign:
CTF-specific behaviours
Flag detection — The solver monitors all agent events for strings containingflag, user.txt, or root.txt. Matching events are parsed into typed Flag objects (user or root) with the capture path and method recorded.
Writeup generation — GenerateWriteup builds a structured markdown document from the event stream, separating enumeration events (recon, subfinder, naabu, httpx) from exploitation events (exploit, attack, chain). The writeup is machine-readable and suitable for publishing on platforms like Hack The Box writeup sites.
Budget by difficulty — The difficulty variable maps to agent-hour budgets: easy is tighter, hard allocates significantly more time for complex multi-step chains.
Shell stabilisation — The solver’s initial_foothold post-analysis prompt explicitly requires stabilizing any shell into a proper TTY before moving to privilege escalation. This prevents common failure modes where privesc tools fail without a real terminal.
List available machines
/api/v4/machine/list) and returns machines filtered by difficulty:
Retrieve a writeup
ctf solve run.
Playbooks
Customize the CTF solver playbook or author your own for specific box types.
MCP Integration
Drive CTF solves interactively from Claude Desktop with live event streaming.
Bug Bounty
Apply the same recon and exploitation skills to real bug bounty programs.
GitHub Actions
Run the CI/CD security playbook to find vulns in your own repos.