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

Variable reference is not valid #38

Open KINGSABRI opened 1 year ago

KINGSABRI commented 1 year ago
PS C:\Tools> Import-Module .\DomainPasswordSpray\DomainPasswordSpray.ps1

At C:\Tools\DomainPasswordSpray\DomainPasswordSpray.ps1:261 char:21
+         Write-Host "$Message: Waiting for $($Seconds/60) minutes. $($ ...
+                     ~~~~~~~~~
Variable reference is not valid. ':' was not followed by a valid variable name character. Consider using ${} to delimit the
name.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : InvalidVariableReferenceWithDrive

https://github.com/dafthack/DomainPasswordSpray/blob/b13d64a5834694aa73fd2aea9911a83027c465a7/DomainPasswordSpray.ps1#L261

Fix:

Change line 261 to

Write-Host "${Message}: Waiting for $($Seconds/60) minutes. $($Seconds - $Count)"