dafthack / DomainPasswordSpray

DomainPasswordSpray is a tool written in PowerShell to perform a password spray attack against users of a domain. By default it will automatically generate the userlist from the domain. BE VERY CAREFUL NOT TO LOCKOUT ACCOUNTS!
MIT License
1.78k stars 377 forks source link

Running in a loop with multiple domains #18

Open darqangels opened 4 years ago

darqangels commented 4 years ago

Hello,

I noticed when running in a loop with multiple domains it will fail. I solved this by commenting out the lines below as they will change the context from the provided $domain variable to actually pulling the current domain in the context of the powershell.exe window.

$DirEntry = New-Object System.DirectoryServices.DirectoryEntry
$UserSearcher.SearchRoot = $DirEntry