Who logged in to this Windows computer, and when?
Windows writes an event each time an account logs on, fails to log on or logs off. This workflow shows how to export the event logs from an image, read the logon events, check Remote Desktop activity and list the accounts on the computer.
This workflow was written from the tools' documentation and published references. It has not yet been checked step by step on the practice data. If a step does not match what you see, please report it.
What you will be able to answer
- Which accounts logged on, and how (at the keyboard, over the network or by Remote Desktop)
- When each logon started and ended
- Which logons failed, and from which address
- Whether someone used Remote Desktop, and from where
- Which local accounts exist and when each was last used
What you need
- A forensic image of the Windows computer, or exported .evtx files, or a practice image (see the practice section on this page)
- A Windows workstation to run EvtxECmd and Timeline Explorer (they need the .NET 10 runtime, or .NET Framework 4.7.2 for EvtxECmd)
- The time zone setting of the computer, which you will read in step 2
Steps
- 1
Work on an image, never the original
If you start from a real computer, make a forensic image through a write blocker and write down its hash value. Open the image in Autopsy or FTK Imager. If someone gave you only exported log files, hash them on arrival and note who gave them to you and when.
- 2
Export the log files and registry hives
Copy the files below out of the image. In Autopsy, right-click a file and choose Extract File(s). In the log folder, file names show a slash in the log name as %4. From the SYSTEM hive, read TimeZoneInformation for the time zone, and the value ShutdownTime under Control\Windows for the last clean shutdown. Event times in the file are UTC, so you need the time zone to explain them in local time. Export the hive .LOG1 and .LOG2 files too.
Windows\System32\winevt\Logs\Security.evtxWindows\System32\winevt\Logs\Microsoft-Windows-TerminalServices-LocalSessionManager%4Operational.evtxWindows\System32\winevt\Logs\Microsoft-Windows-TerminalServices-RemoteConnectionManager%4Operational.evtxWindows\System32\config\SAMWindows\System32\config\SYSTEMWindows\System32\config\SOFTWARESYSTEM\ControlSet001\Control\TimeZoneInformationSYSTEM\ControlSet001\Control\Windows - 3
Turn the Security log into a table
An .evtx file is a binary format, so you need a parser. EvtxECmd reads it and writes a CSV file with one row per event. Keep its Maps folder next to the program: the maps fill columns such as UserName, RemoteHost and PayloadData1 to PayloadData6. Open the CSV in Timeline Explorer, which lets you sort, filter and search. Run the parser again for each log file. Options --inc and --exc keep or drop event IDs, and --sd and --ed set a UTC date range.
EvtxECmd.exe -f "Security.evtx" --csv "C:\case\out" --csvf security.csv
- 4
Read the successful logons (event 4624)
Filter the table for event ID 4624. Read the New Logon account, not the Subject: the Subject is usually the system that asked for the logon. Logon types: 2 interactive (keyboard), 3 network (for example a shared folder), 4 batch, 5 service, 7 unlock, 8 network with clear password, 9 new credentials, 10 Remote Desktop, 11 cached credentials. Many rows are system accounts and services, so filter those out. Note the source address and the Logon ID.
The Logon ID ties a logon to its logoff and to other events of the same session. It is only unique until the computer restarts. Elevated Token Yes means the session has administrator rights.
ToolsTimeline Explorer - 5
Add failures, logoffs and special logons
4625 is a failed logon. Its Status codes give the reason: 0xC000006A is a bad password, 0xC0000064 an unknown user name, 0xC0000072 a disabled account, 0xC0000234 a locked account. 4634 means a session ended and 4647 means the user asked to log off. You usually see both for a normal logoff. 4648 is a logon with explicit credentials, which also happens in normal use. 4672 means the session got sensitive privileges, normal for administrators. Match by Logon ID.
Computer start and stop leave marks too: 4608 is Windows starting up and 1100 is the event log service shutting down.
- 6
Check Remote Desktop activity
Parse the two Remote Desktop logs the same way. In LocalSessionManager, event 21 is a session logon, 23 a logoff, 24 a disconnect and 25 a reconnect. In RemoteConnectionManager, event 1149 is user authentication, with the source address. Authentication is not a full session, so compare with 4624 of type 10. In the Security log, 4778 is a reconnect and 4779 a disconnect. On the client computer, NTUSER.DAT keeps the servers each user connected to under Terminal Server Client\Servers.
NTUSER.DAT\Software\Microsoft\Terminal Server Client\ServersA source address of 127.0.0.1 or ::1 often means the connection came through a tunnel or port forward on the computer itself, so the real origin is hidden. A reconnect can show as logon type 7, not 10.
- 7
Triage fast, then look for gaps
Hayabusa has a logon-summary command that counts successful and failed logons by user name. Its eid-metrics command counts events by ID, which shows the span of the log. Chainsaw hunts with detection rules. Treat their output as leads to check in the raw events. Then look for gaps: event 1102 in the Security log means the log was cleared, and names the account. The first and last dates in the file show how far back it reaches.
hayabusa.exe logon-summary -d "C:\case\export\Logs" -o logon-summary.csv
A detection rule can flag normal activity. Always open the original event before you write a conclusion.
- 8
List the accounts in the SAM hive
The SAM hive stores the local user accounts. Open it in Registry Explorer under SAM\Domains\Account\Users, or run the samparse plugin of RegRipper (below). You get account names, creation dates, last logon times and last password change. Compare the last logon time with the newest 4624 event for the same account. Domain accounts are not in the local SAM, and SIDs map to profile folders under ProfileList in SOFTWARE.
rip.exe -r "C:\case\export\SAM" -p samparse > sam.txt
SAM\Domains\Account\UsersSOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList - 9
Cross-check and write it down
Confirm each important logon from two sources, for example a 4624 event and a LocalSessionManager event, or a last logon time in SAM and the event log. In your notes, record tool names and versions, the source file of each event, the Logon ID, the first and last date of each log and the computer's time zone.
Where the evidence is stored
Security.evtx, event 4624 and 4625Windows\System32\winevt\LogsSuccessful and failed logons, with account, logon type and source address
Security.evtx, events 4634, 4647, 4648, 4672Windows\System32\winevt\LogsLogoffs, explicit credentials and sessions with sensitive privileges
TerminalServices-LocalSessionManager log, events 21, 23, 24, 25Windows\System32\winevt\LogsRemote Desktop and local session logon, logoff, disconnect and reconnect
TerminalServices-RemoteConnectionManager log, event 1149Windows\System32\winevt\LogsSuccessful Remote Desktop authentication, with source address
Security event 1102Security.evtxThe Security log was cleared, and which account did it
SAM hiveWindows\System32\config\SAMLocal accounts, creation date, last logon and last password change
TimeZoneInformation and ShutdownTimeSYSTEM hiveThe computer's time zone setting and last clean shutdown time
Terminal Server ClientNTUSER.DAT of each userServers this user connected to with Remote Desktop from this computer
Check your result
- Match each 4624 logon to its 4634 or 4647 logoff by Logon ID, and check that the times are in a sensible order.
- Compare a Remote Desktop logon in 4624 (type 10) with events 21 and 1149 for the same minute.
- Compare the last logon time in SAM with the newest 4624 event for the same account.
- Run Hayabusa logon-summary and compare its counts with your own filter in Timeline Explorer.
Common mistakes
- Reading the Subject account of a 4624 event instead of the New Logon account.
- Counting system and service logons (types 0, 5 and the computer accounts ending in $) as people.
- Using the Logon ID across a restart. It can be reused after the computer starts again.
- Treating event 1149 as a full Remote Desktop session. It only records authentication.
- Not writing down the first and last date of each log, and so mistaking old overwritten events for a quiet period.
Write it up
A short, careful way to state this kind of finding in a report. Change the details to match your own results.
The Security log in the examined image (hash <hash>) covers <first date> to <last date> (UTC). It records a successful logon of account <account> with Logon ID <id> at <date and time> (<time zone>), logon type <type>, from source address <address>. This shows the account was used. It does not show which person used it.
What this does not prove
- A logon record shows that an account was used. It does not show which person typed the password or sat at the computer.
- The Security log only holds what the audit policy told Windows to record. If logon auditing was off, the events are not there.
- Logs roll over. When a log reaches its size limit, old events are overwritten, so a quiet period may only mean the events are gone.
- A log can be cleared. Event 1102 shows that it happened, but the cleared events are not recoverable from the log itself.
- Event times are stored in UTC, but some tools show local time. Mixing the two is a common mistake, so write down which one you used.
- A network address in a logon event can belong to a router, a VPN, a tunnel or a shared computer. It does not identify a person.
- Event IDs and fields differ a little between Windows versions. Check the documentation for the version you examine.
Practise on public data
NIST CFReDS: Data Leakage Case
A simulated company data leak on a Windows 7 computer, with a PC image of about 5 GB as a compressed DD file, or about 7.3 GB in E01 format. The case asks about the user accounts (question 6), the last user to log on (7), the last shutdown (8) and the logon and logoff traces (12). NIST publishes an answer document, so you can check your result. The page was online when this workflow was reviewed.
Your task. Answer questions 6, 7 and 12. Export Security.evtx and the SAM and SYSTEM hives, list the 4624 and 4647 events for 24 March 2015, and compare with the answer document. Its table shows 4608, 4624, 4647 and 1100 events. The answers use US Eastern time. Convert your UTC times with the offset from the TimeZoneInformation key, and remember that daylight saving time had started in March 2015.
Event IDs 4608, 4624 and 1100 are in the answer table, so the Security log is there. Some Remote Desktop logs in step 6 may be missing or empty on Windows 7. If a log is empty, write that down. For more practice with plain .evtx files, the public EVTX-ATTACK-SAMPLES repository on GitHub collects samples of attack techniques. Check its own README before you use it.
Where to go next
- Which programs were run on this Windows computer? Check which programs were run in the same session
- Which websites were visited on this Windows computer? Check which websites were visited in the same session
- Was a USB drive connected to this Windows computer? Check whether a USB drive was connected while the account was logged on
- How do I make a forensic copy of a drive and prove it is exact? Make sure the image and its hash are documented correctly
Sources and further reading
- Microsoft: event 4624, an account was successfully logged on
- Microsoft: event 4625, an account failed to log on
- Microsoft: event 4647, user initiated logoff
- Magnet Forensics: RDP artifacts in incident response
- EvtxECmd on GitHub
A study guide written in our own words. It is not a legal or laboratory procedure. Follow your own lab's approved method on real cases. Last reviewed 24 Nov 2026.