Investigation · Access
When did the attacker first get in? Building the initial access timeline
Work backward from a known-bad indicator to the earliest confirmed access, pairing logons, remote-entry and first-execution events into one UTC timeline.
When you would ask thisYou have one confirmed sign of compromise and need to establish the earliest point of entry to scope the incident and set a dwell time.
Steps
- 1
Anchor on the first anomalous successful logon
Begin from an indicator you already trust (a malicious binary, a known-bad IP) and find the 4624 that best explains how the actor was present: an external or unexpected IpAddress, an off-hours time, or an account used where it does not belong. Record LogonType (10 RDP, 3 network, 2 interactive) and TargetLogonId. This first credible logon is your working point of entry, which you will then try to push earlier and corroborate rather than accept at face value.
Merge logon successes and failures into a time-ordered viewGet-WinEvent -Path .\Security.evtx -FilterXPath "*[System[EventID=4624 or EventID=4625]]" | Sort-Object TimeCreated | Select-Object TimeCreated, Id, @{ n='User'; e={ ([xml]$_.ToXml()).Event.EventData.Data.Where({ $_.Name -eq 'TargetUserName' }).'#text' } }, @{ n='IP'; e={ ([xml]$_.ToXml()).Event.EventData.Data.Where({ $_.Name -eq 'IpAddress' }).'#text' } } - 2
Pull the failures that preceded it
An entry is rarely the first attempt. Look for 4625 failures from the same source or against the same account in the hours before your anchor logon, which would make the entry the end of a brute-force or spray. On the domain controller, 4771 (Kerberos pre-auth failures) and 4776 (NTLM validation) show the same pressure domain-wide. A cluster of failures ending exactly at your anchor time both confirms the entry and dates the campaign's start earlier than the successful logon.
- 3
Identify the remote-entry channel
Match the anchor logon to how the actor arrived. RDP shows as LocalSessionManager 21 plus RemoteConnectionManager 1149 (source IP) and RdpCoreTS 131 at the transport layer. WinRM or PowerShell Remoting shows as winrm 91 on the destination. A pure network logon that touched a share shows as 5140. Pinning the channel tells you which other source hosts to collect and often reveals an even earlier reconnaissance connection (a 131 with no logon) before the first successful session.
- 4
Find the first execution
The first attacker process often slightly precedes or follows the entry logon. Process creation 4688 and Sysmon 1 give the earliest suspicious command line, its parent and (from Sysmon) its hash; PowerShell 4104 gives the first script block; task-scheduler 106 the first task registered; and System 7045 the first tool installed as a service. The earliest of these that you can attribute to the actor sharpens the entry time and marks the transition from access to action.
- 5
Normalize and assemble the timeline
Convert every event to UTC, sort, and join sessions across hosts by TargetLogonId and by RDP SessionID so one intrusion reads as one thread. Mark the earliest confirmed malicious action as T0 and label everything before the first successful logon as attempts or reconnaissance. Keep the anchoring indicator visible so a reviewer can retrace your logic from known-bad back to entry, rather than trusting an unexplained 'first' event.
- 6
Test the timeline against lost evidence
Before you commit to a first-access time, check whether earlier evidence could have been destroyed. A 1102 or System 104 clear, or a log that rolled over, means the earliest event you can see is bounded by retention, not by the attacker's first action. Note any such gap explicitly, because an undetected clear makes 'earliest observed' look like 'earliest occurred' and understates dwell time. State the confidence bound rather than asserting a precise entry moment you cannot defend.
Where it goes wrong
- At the default 20 MB a DC's Security log may hold only hours, so the earliest logon you can see is often a retention floor, not the true first access.
- Clock skew between hosts can reorder events across machines; reconcile against a reliable time source before trusting cross-host ordering.
- An attacker using valid stolen credentials produces a logon that looks entirely benign, so the entry may carry no failure burst or anomaly and must be found from later activity working backward.
- With NLA, RDP generates a Type 3 logon just before the Type 10, so do not misread the Type 3 as a separate earlier intrusion.
- LogonIds repeat after a reboot, so a TargetLogonId match across a restart boundary is coincidental, not the same session.
- A cleared or rolled log (1102, 104) can hide an earlier entry entirely; always state the evidence's time bound rather than an absolute first-access claim.
Beyond event logs
Amcache and ShimCache
C:\Windows\AppCompat\Programs\Amcache.hve and the AppCompatCache value in the SYSTEM hive
Both record program execution (Amcache with SHA-1 and first-seen times, ShimCache with path and a timestamp) and frequently reach further back than the event logs, extending the timeline before the first logged process.
Prefetch
C:\Windows\Prefetch\*.pf
First and last run times and run counts for executables, independent of event logging, useful for dating an attacker tool's first execution.
SRUM and $MFT
C:\Windows\System32\sru\SRUDB.dat and the volume $MFT
SRUM dates application and network usage; $MFT file creation timestamps date when attacker files first landed on disk, which can predate any logon event you retained.
Keep going
- InvestigationWho connected to this host over RDP, from where, and when did they leave?
- InvestigationIs this a brute-force or password-spray attack, and did any attempt succeed?
- InvestigationWhere did this account log on, and was it used for lateral movement?
- Attack signalsPassword Spraying
- Attack signalsPass the Hash
- Lateral movementRDP lateral movement
- Lateral movementWinRM and PowerShell Remoting
- Lateral movementPsExec and service-based execution