Programming & Scripting for Pentesters
Bash Scripting & Automation
Glue your tools together into fast recon and exploitation pipelines.
On Linux, Bash is the fastest way to chain tools. Great pentesters automate their recon so a single command feeds subdomains → live hosts → ports → screenshots.
#!/usr/bin/env bash
# Tiny recon pipeline
domain=$1
subfinder -d "$domain" -silent \
| httpx -silent \
| tee live_hosts.txt \
| nuclei -silent -severity high,critical
- Pipes (|) and redirection (>, >>) chain and capture output.
- Loops — for host in $(cat hosts.txt); do ...; done.
- xargs / parallel — run tasks concurrently across a list.
- grep / awk / sed / cut — parse and reshape tool output.