| name | ctf-recon |
| description | Target reconnaissance and enumeration for CTF challenges. Use when you need to scan ports, discover services, enumerate web directories, or fingerprint technology stacks. |
| user-invocable | false |
| allowed-tools | ["Bash","Read","Write","Edit","Glob","Grep","Task","WebFetch","WebSearch"] |
CTF Reconnaissance & Enumeration
Web Reconnaissance
Initial Checks
curl -v http://target/
curl -s http://target/ | head -100
for path in robots.txt sitemap.xml .env .git/HEAD .well-known/ admin api debug; do
code=$(curl -s -o /dev/null -w "%{http_code}" "http://target/$path")
[ "$code" != "404" ] && echo "[+] /$path -> $code"
done
curl -sI http://target/ | grep -iE "(server|x-|powered|content-type|set-cookie)"
curl -s http://target/ | grep -iE "(<!--|flag|secret|admin|api|token|password)"
Technology Fingerprinting
curl -sI http://target/ | grep -i "server:"
curl -s http://target/ | grep -ioE "(react|angular|vue|next|nuxt|flask|django|express|laravel|rails)"
curl -s http://target/ | grep -oE 'src="[^"]*\.js"' | head -20
curl -s http://target/main.js.map -o /dev/null -w "%{http_code}"
Directory/File Discovery
ffuf -u http://target/FUZZ -w wordlist.txt -mc 200,301,302,403
ffuf -u http://target/FUZZ -w wordlist.txt -e .php,.txt,.html,.js,.bak
gobuster dir -u http://target/ -w wordlist.txt
API Enumeration
for path in api api/v1 api/v2 graphql api/docs swagger.json openapi.json; do
code=$(curl -s -o /dev/null -w "%{http_code}" "http://target/$path")
[ "$code" != "404" ] && echo "[+] /$path -> $code"
done
curl -s http://target/static/js/main.js | grep -oE '"/api/[^"]*"' | sort -u
curl -s http://target/graphql -H "Content-Type: application/json" \
-d '{"query":"{__schema{types{name fields{name}}}}"}'
Network Reconnaissance
Port Scanning
nmap -sV -sC -T4 target
nmap -p- -T4 target
nmap -sU --top-ports 20 target
nmap -sV -p PORT target
Service Interaction
nc -v target port
echo "" | nc -w3 target port
openssl s_client -connect target:443 </dev/null 2>/dev/null | openssl x509 -noout -text
dig target ANY
dig -t txt target
dig axfr @ns.target target
Source Code Reconnaissance
Git Exposure
curl -s http://target/.git/HEAD
curl -s http://target/.git/config
git-dumper http://target/.git/ ./dumped-repo
cd dumped-repo && git log --all --oneline
git diff HEAD~5..HEAD
git log --all --diff-filter=D --name-only
git show HEAD~3:secret.txt
Backup File Discovery
for ext in .bak .old .orig .save .swp ~; do
curl -s -o /dev/null -w "%{http_code}" "http://target/index.php${ext}"
done
curl -s http://target/.index.php.swp
curl -s http://target/index.php~
CTF-Specific Patterns
- Challenge description is ALWAYS a hint — read every word
- Challenge title often reveals the technique (e.g., "Inject" = injection, "Token" = JWT)
- Points/difficulty indicate expected complexity
- If a port is unusual, try connecting with nc first to see the banner
- Multiple open ports often means chaining vulnerabilities across services
- Always check for custom HTTP headers in responses (X-Flag, X-Hint, etc.)