Skip to content

Lesson 4 of 19 · 22m

Lateral Movement: The Windows Events That Prove They Left the First Box

LogonType semantics, Kerberos ticket flows, and share/service artifacts — reading 4624, 4769, 5140 and friends to prove exactly which machines the attacker crossed.

The question on every scoping call is the same: did they leave the first box? Windows answers it — but only in a grammar of five-digit event IDs, and only if you know which fields inside those events actually carry the meaning. 4624 alone tells you almost nothing. 4624 with LogonType=3 and AuthenticationPackage=NTLM tells you the attacker presented a stolen hash against a second machine, which is a different incident than LogonType=10 and AuthenticationPackage=Negotiate.

The logon-type grammar

Every interactive and remote authentication writes a 4624 (success) or 4625 (failure) into the Security log, and the LogonType field is the whole story:

LogonTypeNameWhat actually happened
2InteractiveHands on the console
3NetworkSMB, NTLM auth, net use, PsExec-style service auth, WinRM
8NetworkCleartextIIS basic auth and similar — credentials sent plaintext
9NewCredentialsrunas /netonly — local logon only, deliberately leaves no event on the target
10RemoteInteractiveRDP

The wrong mental model: "type 3 means they logged in from the network." Type 3 with NTLM is the pass-the-hash signature — the attacker never typed a password anywhere; they replayed the hash lifted from the first host's memory. A Kerberos type 3 instead means they had a valid ticket, which is pass-the-ticket or straight credential use. The Authentication Package field — NTLM vs Kerberos vs Negotiate — is what separates "password compromised" from "hash compromised" from "ticket stolen." Those scope differently.

Two more Security events close the loop on the source box. 4648 fires when credentials are explicitly specified — runas, net use /u:, schtasks /s /u, PsExec with -u — and names which account was wielded. 4672 means the logon got admin-tier privileges. And remember the blind spot: runas /netonly (LogonType 9) authenticates the local shell but produces nothing on the remote end until the spawned process authenticates as someone else. Absence of 4624 does not mean absence of movement — a stolen TGT skips authentication entirely and only shows up as 4769 service-ticket requests on the DC.

The domain controller is the movement ledger

Kerberos events on DCs map every account to every service it touched:

  • 4768 — TGT issued
  • 4769 — service ticket issued. A workstation account requesting tickets for fourteen servers in twenty minutes is the enumeration sweep.
  • 4771 with failure code 0x18 — bad password via preauth. Hundreds across many accounts in minutes is the spray.
  • 4662 — directory-service object access carrying replication GUIDs 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2 or 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2 requested by a non-DC account: that is DCSync, the attacker now holds every hash in the domain.

The transport-layer fingerprints

How they moved writes different artifacts:

  • PsExec / service exec: the service lands via an ADMIN$ write (5140/5145 share-access on the target), then System 7045 + Security 4697 — a service installed. PsExec's default PSEXESVC name is trivially renamed; hunt on the pattern, not the name.
  • RDP: RemoteConnectionManager event 1149 (auth succeeded) precedes TerminalServices-LocalSessionManager 21/23/24/25 session events plus the 4624 type 10. On the client box, %LOCALAPPDATA%\TermSrv\Bts bitmap-cache files hold rendered tiles of the remote screen — partial proof of what they were looking at.
  • WinRM: events 91 and 168 on the receiving host.
  • WMI remote exec: wmiprvse.exe spawning the attacker's process — Sysmon event 1 with ParentImage=wmiprvse.exe. Same pattern for DCOM under dllhost.exe.

Building the pivot picture

Pull the union of 4624s across every host into one table — SIEM, or Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4624} per box — and pivot on account × source IP × LogonType. One source IP fanning NTLM type-3s to a dozen targets inside an hour is movement, not admin noise. Feed each confirmed destination into scoping as a new "first box": it now needs its own triage, its own evidence preservation, and its own memory capture before anything gets rebooted.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.