Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Fixed:
- Domain Parameter was ignored, current domain was always used
- Corrected Issue dafthack#31
- Merged PR dafthack#22
  • Loading branch information
bluecurby authored Aug 23, 2022
1 parent b13d64a commit 47b8690
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions DomainPasswordSpray.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function Countdown-Timer
)
if ($quiet)
{
Write-Host "$Message: Waiting for $($Seconds/60) minutes. $($Seconds - $Count)"
Write-Host "$($Message): Waiting for $($Seconds/60) minutes. $($Seconds - $Count)"
Start-Sleep -Seconds $Seconds
} else {
foreach ($Count in (1..$Seconds))
Expand Down Expand Up @@ -414,7 +414,7 @@ function Get-DomainUserList
}

$UserSearcher = New-Object System.DirectoryServices.DirectorySearcher([ADSI]$CurrentDomain)
$DirEntry = New-Object System.DirectoryServices.DirectoryEntry
$DirEntry = New-Object System.DirectoryServices.DirectoryEntry($CurrentDomain)
$UserSearcher.SearchRoot = $DirEntry

$UserSearcher.PropertiesToLoad.Add("samaccountname") > $Null
Expand Down Expand Up @@ -530,7 +530,7 @@ function Invoke-SpraySinglePassword
$curr_user = 0
if ($OutFile -ne ""-and -not $Quiet)
{
Write-Host -ForegroundColor Yellow "[*] Writing successes to $OutFile"
Write-Host -ForegroundColor Yellow "[*] Writing successes to $OutFile"
}
$RandNo = New-Object System.Random

Expand Down Expand Up @@ -566,6 +566,7 @@ function Get-ObservationWindow($DomainEntry)
{
# Get account lockout observation window to avoid running more than 1
# password spray per observation window.
$DomainEntry = [ADSI]$DomainEntry
$lockObservationWindow_attr = $DomainEntry.Properties['lockoutObservationWindow']
$observation_window = $DomainEntry.ConvertLargeIntegerToInt64($lockObservationWindow_attr.Value) / -600000000
return $observation_window
Expand Down

0 comments on commit 47b8690

Please sign in to comment.