fork download
  1. import urllib2
  2. import sys
  3.  
  4. TARGET = 'http://c...content-available-to-author-only...t.com/po?er='
  5.  
  6. #--------------------------------------------------------------
  7. # padding oracle
  8. #--------------------------------------------------------------
  9. class PaddingOracle(object):
  10. def query(self, q):
  11. target = TARGET + urllib2.quote(q) # Create query URL
  12. req = urllib2.Request(target) # Send HTTP request to server
  13. try:
  14. f = urllib2.urlopen(req) # Wait for response
  15. print 'Success!!!'
  16. except urllib2.HTTPError, e:
  17. print "We got: %d" % e.code # Print response code
  18. if e.code == 404:
  19. return True # good padding
  20. return False # bad padding
Success #stdin #stdout 0.04s 12848KB
stdin
Standard input is empty
stdout
Standard output is empty