fork download
  1. import urllib2
  2. import sys
  3.  
  4. TARGET = 'http://c...content-available-to-author-only...t.com/po?er='
  5. #--------------------------------------------------------------
  6. # padding oracle
  7. #--------------------------------------------------------------
  8. class PaddingOracle(object):
  9. def query(self, q):
  10. target = TARGET + urllib2.quote(q) # Create query URL
  11. req = urllib2.Request(target) # Send HTTP request to server
  12. try:
  13. f = urllib2.urlopen(req) # Wait for response
  14. print 'success'
  15. except urllib2.HTTPError, e:
  16. print "We got: %d" % e.code # Print response code
  17. if e.code == 404:
  18. return True # good padding
  19. return False # bad padding
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/py_compile.py", line 117, in compile
    raise py_exc
py_compile.PyCompileError: Sorry: IndentationError: unexpected indent (prog.py, line 14)
stdout
Standard output is empty