Lateral movement: the evidence each technique leaves on Windows and Linux
What lateral movement is, the common techniques, and the logs and artifacts each leaves on the source and destination host, with a real example.
Lateral movement is the set of techniques attackers use to move from the first machine they compromise to other machines on the same network, usually with stolen or newly created credentials, until they reach the systems and data they are after. It sits between initial access and the attacker's objective in almost every serious intrusion, and MITRE ATT&CK lists it as its own tactic (TA0008).
For defenders it has a useful property: every hop leaves evidence on two machines. The source records that something reached out, the destination records that something arrived, and the domain controller often records the authentication in between. This article explains how lateral movement works, then goes technique by technique through the logs and artifacts each one leaves, with an example from an intrusion we staged and investigated in our lab.
How lateral movement works
A typical sequence after initial access:
- Discovery. The attacker learns where they are:
whoami,net user,net localgroup administrators,nltest,ipconfig, and lists of hosts and shares. - Credential access. They collect credentials they can reuse: passwords in files and scripts, saved credentials, hashes from memory or the SAM, Kerberos tickets, or simply a new account they create.
- Movement. They use those credentials with a remote service on another host: Remote Desktop, SMB and admin shares, remote service or task creation, WMI, WinRM and PowerShell remoting, or SSH on Linux.
- Repeat. On each new host they look around, take more credentials and move again, often towards domain controllers, file servers, backups and databases.
Because the movement uses valid credentials and built-in remote management features, each individual event can look like administration. What gives it away is the pattern: an account appearing on hosts it never used, at hours it is never active, from a workstation rather than an admin jump host, in a sequence that follows a discovery burst.
Attacks that depend on lateral movement
- Ransomware. Modern ransomware operators spend hours or days moving to domain controllers, file servers and backup systems before encrypting, so that the encryption is as wide and as hard to recover from as possible. The lateral movement is the window in which they can still be stopped.
- Data theft and espionage. The data an attacker wants is rarely on the first machine they reach. Movement towards file shares, databases and email is how they get there, often slowly to stay unnoticed.
- Domain compromise. Reaching a domain controller, or an account that administers one, gives control of every machine in the domain. Much lateral movement is a search for that account.
- Persistence across the estate. Attackers plant access on several hosts so that cleaning one does not remove them.
The common techniques
| Technique | ATT&CK | What the attacker does |
|---|---|---|
| Remote Desktop | T1021.001 | Logs on to the next host interactively with RDP |
| SMB and admin shares | T1021.002 | Connects to C$ or ADMIN$ to copy tools and files |
| Remote service creation (PsExec and similar) | T1569.002, T1543.003 | Copies a program over SMB and starts it as a service |
| Remote scheduled task | T1053.005 | Creates a task on the remote host that runs a command |
| WMI | T1047 | Starts a process remotely through Windows Management Instrumentation |
| WinRM and PowerShell remoting | T1021.006 | Runs commands or an interactive session through WinRM |
| Pass the hash, pass the ticket | T1550.002, T1550.003 | Authenticates with a stolen hash or Kerberos ticket instead of a password |
| SSH | T1021.004 | Logs on to Linux hosts with stolen passwords or planted keys |
The evidence each technique leaves
The tables below list the main sources on each side. Not every source exists on every system: process creation (4688), share access (5140 and 5145) and some operational logs depend on audit settings, and logs roll over. Check several sources and expect gaps.
Remote Desktop (RDP)
| On the source | On the destination |
|---|---|
| 4648 explicit credentials (when credentials are typed or stored) | 4624 logon type 10 (with Network Level Authentication, a type 3 first; a type 7 when taking over an existing session) |
| TerminalServices-RDPClient operational log: event 1024 (connecting to a server) | TerminalServices-RemoteConnectionManager: event 1149 (authentication succeeded, with the source address) |
| RDP connection history in the user's NTUSER.DAT (Terminal Server Client\Servers) | TerminalServices-LocalSessionManager: 21 (logon), 24 (disconnect), 25 (reconnect) |
| mstsc.exe in Prefetch, Jump Lists and process creation | 4778 and 4779 session reconnect and disconnect; RDP bitmap cache on the client side |
Every RDP event ID on both ends, with the order they appear in, is in the RDP event logs guide.
SMB, admin shares and remote services (PsExec and similar)
| On the source | On the destination |
|---|---|
| 4648 with the target server; net use, copy \\host\c$ or the tool in process creation and Prefetch | 4624 logon type 3, followed by 4672 for an administrator |
| PsExec's licence acceptance in the user's registry (Sysinternals EULA key) | 5140 and 5145 share access to C$ or ADMIN$ (when file share auditing is on) |
| The tool itself in Amcache and ShimCache | 7045 new service (PSEXESVC or a random name) and its executable in Prefetch |
| New files under Windows or ProgramData, visible in the USN Journal and $MFT |
The PsExec forensics guide walks through this sequence step by step on both hosts, including PsExec's imitators.
Remote scheduled tasks
| On the source | On the destination |
|---|---|
| schtasks /create /s host or at in process creation | 4624 type 3, then 4698 task created and the task XML in C:\Windows\System32\Tasks |
| Task Scheduler operational log: 106 (registered), 200 and 201 (run) |
WMI
| On the source | On the destination |
|---|---|
| wmic.exe or PowerShell (Invoke-WmiMethod, Invoke-CimMethod) in process creation and Prefetch | 4624 type 3, then a process started by wmiprvse.exe (4688 shows WmiPrvSE as the parent) |
| WMI-Activity operational log entries; permanent event subscriptions if WMI was also used for persistence |
WinRM and PowerShell remoting
| On the source | On the destination |
|---|---|
| PowerShell with Enter-PSSession or Invoke-Command in process creation and 4104 script blocks | 4624 type 3, then wsmprovhost.exe running the remote session |
| WinRM operational log on the client | WinRM operational log; 4104 script blocks of the remote commands |
Pass the hash and pass the ticket
| On the source | On the destination and domain controllers |
|---|---|
| A logon type 9 with logon process seclogo when a tool runs a process with injected credentials | Type 3 logons with NTLM authentication for accounts that normally use Kerberos (pass the hash) |
| Credential theft tools in execution artifacts | 4776 NTLM validation on a domain controller; 4769 service tickets without a matching 4768 (forged or stolen tickets) |
SSH on Linux
| On the source | On the destination |
|---|---|
| ssh commands in shell history; the destination in ~/.ssh/known_hosts | "Accepted password" or "Accepted publickey" in auth.log, secure or the journal, with the source address |
| Private keys in the user's ~/.ssh directory, and agent forwarding | New entries in authorized_keys; login records in wtmp |
Our earlier article on tracing lateral movement through SSH logs covers the Linux side in depth.
A real example: two hops in two minutes
In our Windows lab case (the Halden Freight office intrusion), an attacker who had guessed a.berg's password on workstation HF-WS01 moved to HF-WS02 and back again. Times are UTC, from the hosts' own logs.
The first hop, RDP from HF-WS01 to HF-WS02:
- 22:10:49 on HF-WS01: a registry change set the Remote Desktop client's AuthenticationLevelOverride to 0, which suppresses the server authentication prompt.
- 22:10:54 on HF-WS01:
cmdkeystored a credential for TERMSRV/HF-WS02 as HF-WS02\m.lund, with the password on the command line (recorded by process creation auditing). - 22:10:58 on HF-WS01:
mstsc /v:HF-WS02 /fstarted, and the RDP client log recorded the connection to HF-WS02. - 22:10:59 on HF-WS01: 4648, a.berg's session using m.lund's credentials towards HF-WS02.
- 22:10:59 on HF-WS02: 4624 logon type 3 for m.lund from 10.211.55.6 (HF-WS01), followed at 22:11:01 by a type 7 unlock: the RDP connection took over m.lund's open desktop session.
The second hop, SMB from HF-WS02 back to HF-WS01:
- 22:12:18 on HF-WS02:
net use \\HF-WS01\C$with HF-WS01\svc_backup, a local administrator account the attacker had created on HF-WS01 at 22:09:40. - 22:12:18 on HF-WS01: 4624 logon type 3 for svc_backup from 10.211.55.7 (HF-WS02).
- 22:12:19 on HF-WS02: 4648, m.lund's session using svc_backup's credentials towards HF-WS01.
- 22:12:35 on HF-WS02: the attacker's script was copied from \HF-WS01\C$\ProgramData, and a scheduled task identical to the one on HF-WS01 was created at 22:13:26 (4698).
Every hop shows on both machines, and the two sides confirm each other: the 4648 on the source names the target and the account, and the 4624 on the target names the source address and the same account within a second. Read only the destination, and you know someone arrived. Read both, and you know who sent them, with which stored credential, from which session.
When we asked Arcsentry's AI investigator how the attacker got in and what they did, it reconstructed both hops with these events cited, and the sessions view drew them as a graph without a query.
Detecting and investigating lateral movement
Questions that find it
- Which accounts logged on to more hosts than usual? Count distinct destination hosts per account per day from 4624 types 3 and 10, across every host you collected, and compare with a normal week.
- Which workstations connect to other workstations? Administration normally comes from jump hosts or admin workstations. Workstation-to-workstation RDP or SMB is rare and worth listing.
- Which privileged sessions came from unusual sources? Join 4624 with 4672 and list source addresses per admin account.
- Where were credentials supplied explicitly? 4648 events whose process is mstsc.exe, net.exe, cmd.exe or powershell.exe, in user sessions.
- Which services and tasks appeared on several hosts at once? The same 7045 service name or 4698 task on several machines within minutes is remote execution.
Telling it apart from administration
The same techniques are what administrators, deployment tools and monitoring systems use every day, so expect matches that are innocent. Software deployment and backup agents create services and use admin shares on many hosts at once; help desk staff RDP to users' machines; vulnerability scanners log on over the network to everything. Build a short list of the accounts, source hosts and service names that do this legitimately, and look at what falls outside it. An attacker using an administrator's own account from the administrator's own workstation is the hard case; there, the time of day, the order of actions and what was run in each session separate the two.
Investigating it step by step
- Start from a known compromised host and account.
- List every outgoing connection from that host in the window: 4648, RDP client events and history,
net useand remote execution commands. - For each target, collect it and confirm the arrival (4624 with the matching source and account).
- On each new host, repeat: what was run, what persisted, where it went next.
- Check the domain controllers' 4769 service tickets for the account: they show hosts it reached that you have not yet collected.
- Build the hop list into one timeline and graph, and keep going until no new host appears.
In Arcsentry, logons and Remote Desktop events from every host are rebuilt into sessions automatically, and the graph draws account, source and destination. A query in AQL for remote logons by account and source across all hosts:
filter event_code == "4624" && event_log_logon_type ~= "^(3|7|10) " && source_ip != "-"
group {user_target_name, source_ip} (aggregate {n = count this, first_seen = (earliest timestamp), last_seen = (latest timestamp)})
sort {first_seen}Preventing lateral movement
- Separate administration. Admin accounts used only from dedicated admin workstations or jump hosts, never for email or browsing; different admin accounts for workstations, servers and domain controllers.
- Unique local administrator passwords on every machine (Windows LAPS), so one stolen local password does not open every workstation.
- Restrict who can log on remotely. Remote Desktop Users and remote management rights limited to the people who need them, and workstation-to-workstation RDP and SMB blocked by host firewalls.
- Protect credentials. Credential Guard, the Protected Users group for administrators, RDP Restricted Admin mode or Remote Credential Guard, and no passwords in scripts or command lines.
- Log the evidence you will need. Process creation with command lines, larger Security logs, PowerShell script block logging, and domain controller logs forwarded centrally.
Frequently asked questions
What is lateral movement in cyber security?
Lateral movement is how attackers move from one compromised computer to others on the same network, using stolen or newly created credentials and remote access features such as Remote Desktop, SMB, WMI, PowerShell remoting or SSH. It is the ATT&CK tactic TA0008.
What are examples of lateral movement techniques?
Remote Desktop logons, copying tools over admin shares and running them as services (PsExec-style), remote scheduled tasks, WMI and PowerShell remoting, pass the hash and pass the ticket on Windows, and SSH with stolen keys on Linux.
How do you detect lateral movement?
Look for accounts logging on to more hosts than usual, workstation-to-workstation connections, privileged logons from unusual sources, explicit credential use (4648) and the same new service or task appearing on several hosts. Confirm each hop on both the source and the destination.
Which Windows event IDs show lateral movement?
On the destination: 4624 (logon types 3, 10 and 7), 4672, 5140 and 5145 (share access), 7045 (service installed), 4698 (task created), and the RDP events 21, 25 and 1149. On the source: 4648 and the RDP client log. On domain controllers: 4768, 4769 and 4776.
What is the difference between lateral movement and privilege escalation?
Privilege escalation gains higher rights on a system (for example from a user to administrator). Lateral movement uses rights to reach other systems. Attackers usually alternate between them: escalate, take credentials, move, escalate again.
How we wrote this
Drafted with AI from evidence in our own lab, with Laura Pompeu responsible for the article. The evidence comes from Halden Freight office intrusion (Windows, two hosts), built and investigated in our lab, so every example can be checked against real records.
Sources
- MITRE ATT&CK TA0008: Lateral Movement, MITRE
- MITRE ATT&CK T1021: Remote Services, MITRE
- Advanced security audit policy and event documentation (4624, 4648, 4672, 5140, 7045), Microsoft
- SANS DFIR poster: Hunt Evil / Windows Forensic Analysis (lateral movement artifacts), SANS Institute
See it on your own evidence. Free for 7 days.
Tell us what you want to investigate. A person replies within one business day with the download and a trial licence.
Request a trial