Last active
April 6, 2018 19:27
-
-
Save juancarlospaco/7d3fade1eb063add1dc96c37be1c0ce5 to your computer and use it in GitHub Desktop.
Quick and Dirty CGI Hacks from Bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir cgi-bin | |
echo '#!/usr/bin/env python3' > cgi-bin/test.py | |
echo 'print("Content-type:text/html\n\n"+__import__("calendar").HTMLCalendar().formatyearpage(2017).decode("utf-8"))' >> cgi-bin/test.py | |
chmod +x cgi-bin/test.py | |
python3 -m http.server --cgi & | |
xdg-open http://127.0.0.1:8000/cgi-bin/test.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment