Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import BaseHTTPServer
  2.  
  3. HOST_NAME = ''
  4. PORT_NUMBER=8000
  5.  
  6. postVars = ''
  7.  
  8. class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
  9.  
  10. def do_POST(s):
  11. global postVars
  12. s.send_response(200)
  13. s.end_headers()
  14. varLen = int(s.headers['Content-Length'])
  15. postVars = s.rfile.read(varLen)
  16. print postVars
  17.  
  18. server_class = BaseHTTPServer.HTTPServer
  19. httpd = server_class((HOST_NAME, PORT_NUMBER), MyHandler)
  20.  
  21. try:
  22. httpd.handle_request()
  23. except KeyboardInterrupt:
  24. pass
  25.  
  26. print postVars
  27. httpd.server_close()
  28. postVars is valued during the Handler, but not after MyHandler
  29.  
  30. user=jhon&domain=domain.com&pass=mypassword
  31.  
  32. import os
  33. value1="user"
  34. value2="domain"
  35. value3="pass"
  36. os.system("./usersprivetes.sh %s %s %s" % (value1,value2,value3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement