Reading Logon Events
Who signed in, from where, how and with what rights, read from 4624 in the Security log.
Why It Matters
Most attacks that reuse credentials first show as a logon that does not fit its account, such as the wrong machine, the wrong protocol or the wrong logon type. Reading each field for what it records is how you see it.
What Happens
Start with Logon Type in event 4624 in the Security log, which says how the session began and so what it may have left behind. Then read the account and its domain, where a machine name means a local account, and Workstation Name and Source Network Address for where it came from. Authentication Package says how it was proved, by Kerberos, NTLM or Negotiate.
Which network fields are filled depends on the protocol and the service, so an empty one proves nothing alone. For NTLM, Workstation Name is what the client claimed and Source Network Address is where the connection came from. When the two disagree, find out why.
Package Name (NTLM only) shows NTLM V1, NTLM V2 or LM, and anything but NTLM V2 is a weakness to fix. Elevated Token Yes marks an administrator session, with event 4672 beside it in the same log listing the special privileges. Expect many logons from SYSTEM, LOCAL SERVICE, NETWORK SERVICE, ANONYMOUS LOGON and computer accounts (names ending in $), and learn their normal pattern before filtering, because a computer account signing in somewhere new can matter.
Logon ID ties a session's events together on one machine until it restarts. Event 4624 opens the session, 4647 shows a user logging off and 4634 closes it, all in the Security log, though logoffs are not always written. Linked Logon ID pairs the two sessions an administrator's interactive sign-in gets under User Account Control, one full and one filtered.
Impersonation Level says how far a server may act as the user, and Delegation means on other machines too. Restricted Admin Mode, filled only for Remote Desktop, says whether the admin's credentials stayed off the server. Disconnecting a Remote Desktop session writes event 4779 to the Security log and reconnecting writes 4778, each with Client Name and Client Address, and a disconnected session keeps its credentials until it ends.
Logon Types
Logon Type in events 4624 and 4625 in the Security log says how a session began. Each value below is the number Windows writes, with its name and what it means on the machine.
| Logon Type | Name | What Happened |
|---|---|---|
| 2 | Interactive | A user signed in at the machine, or through RunAs |
| 3 | Network | A user or computer reached the machine over the network, such as a share, remote management or PowerShell remoting |
| 4 | Batch | A scheduled task ran as an account |
| 5 | Service | The Service Control Manager started a service as an account |
| 7 | Unlock | A locked session was unlocked |
| 8 | NetworkCleartext | A network logon that handed over the password itself, as CredSSP and IIS Basic authentication do |
| 9 | NewCredentials | A process kept its own identity locally but used other credentials on the network |
| 10 | Remote | Remote Desktop |
| 11 | Cached | A user signed in with cached credentials, and no domain controller was asked |
| 12 | Cached | The same as RemoteInteractive, recorded this way for internal auditing |
| 13 | CachedUnlock | An attempt to unlock a workstation |
Status and Sub Status in Event 4625
When a logon fails, event 4625 in the Security log gives the reason as a code in Status and Sub Status. Read Sub Status whenever Status is the general 0xC000006D.
| Code | Meaning |
|---|---|
| 0xC0000064 | The user name does not exist |
| 0xC000006A | The user name exists but the password is wrong |
| 0xC000006D | A bad user name or bad authentication information, with Sub Status giving the detail |
| 0xC000006F | Outside the hours the account may sign in |
| 0xC0000070 | From a workstation the account may not use |
| 0xC0000072 | The account is disabled |
| 0xC0000193 | The account has expired |
| 0xC0000234 | The account is locked out |
| 0xC000015B | The account lacks the right to this logon type on this machine |
What Is Logged
Each event below names the log it is written to, the machine that writes it and the audit setting that switches it on, then what to read in it for this page.
| Event and Log | Written On | Switch It On | What It Tells You |
|---|---|---|---|
| 4624 An account was successfully logged on (opens in a new tab) Security log | The computer that was logged on to | Audit Logon | Read Logon Type, the account, Workstation Name, Source Network Address, Authentication Package, Elevated Token and Logon ID together. |
| 4625 An account failed to log on (opens in a new tab) Security log | The computer where the logon was attempted | Audit Logon, and Audit Account Lockout for a locked-out account | Status and Sub Status give the reason. One source failing across many names, or one name failing from many sources, points to password guessing. |
| 4672 Special privileges assigned to new logon (opens in a new tab) Security log | The computer that was logged on to | Audit Special Logon | The new session was given sensitive privileges, listed in Privileges. Every SYSTEM logon writes one too, which is normal. |
| 4634 An account was logged off (opens in a new tab) Security log | The computer the session was on | Audit Logoff | The session closed. Pair it with its 4624 in the same log by Logon ID to see how long the session lasted, knowing logoffs can be missing. |
| 4647 User initiated logoff (opens in a new tab) Security log | The computer the user logged off from | Audit Logoff | A user chose to log off an interactive or Remote Desktop session, and a 4634 in the same log usually follows. |
| 4778 A session was reconnected to a Window Station (opens in a new tab) Security log | The computer the session is on | Audit Other Logon/Logoff Events | A Remote Desktop session reconnected, and Client Name and Client Address say from where. |
| 4779 A session was disconnected from a Window Station (opens in a new tab) Security log | The computer the session is on | Audit Other Logon/Logoff Events | A Remote Desktop session disconnected but stayed open, credentials and all. |
Check It on a Machine
These Windows Registry keys hold the settings this page names. Open one to see where it lives and how to read it on a machine.
Attacks That Hook in Here
These attacks work through what this page describes. Each card says what the attack is and, where it uses one of these steps, what it does there.
- Password Spraying
One guessed password tried against many accounts, over Kerberos and NTLM.
- NTLM Relay
Passes a victim's NTLM sign-in to another server and keeps the session it opens.
- Pass-the-Hash
Signs in over NTLM with a stolen NT hash, never needing the password.
- LSASS Memory Theft
Reads the hashes and tickets that sign-ins left on a machine out of LSASS memory.
- Clearing and Silencing Logs
Clears a log or switches a channel off, so the record of what happened is gone.
Hunt It
Each tool below runs the same search. Its note names the log or table it reads and what has to be switched on or collected first.
Reads the DeviceLogonEvents table in Defender XDR advanced hunting, from devices onboarded to Defender for Endpoint, for each Remote Desktop logon with its source and whether the account is a local admin. The table documents no column for Restricted Admin Mode or for reconnects, so read events 4624, 4778 and 4779 in the Security log for those.
// Remote Desktop logons, with the source and local admin rightsDeviceLogonEvents| where Timestamp > ago( 30d)| where LogonType == "RemoteInteractive"| project Timestamp, DeviceName, ActionType, AccountDomain, AccountName, RemoteIP, RemoteDeviceName, IsLocalAdmin, LogonId| order by DeviceName asc, Timestamp ascSources
- Microsoft Learn: Security Event 4624 (opens in a new tab)
- Microsoft Learn: Security Event 4625 (opens in a new tab)
- Microsoft Learn: Security Event 4634 (opens in a new tab)
- Microsoft Learn: Security Event 4647 (opens in a new tab)
- Microsoft Learn: Security Event 4672 (opens in a new tab)
- Microsoft Learn: Security Event 4778 (opens in a new tab)
- Microsoft Learn: Security Event 4779 (opens in a new tab)
- Microsoft Learn: Audit Logoff (opens in a new tab)
- Microsoft Learn: SECURITY_LOGON_TYPE Enumeration (opens in a new tab)
- Microsoft Learn: Mapped Drives from an Elevated Prompt (UAC's Two Linked Logon Sessions) (opens in a new tab)
- Microsoft Learn: Security Identifiers (the Well-Known Accounts) (opens in a new tab)
- Velociraptor: Windows.EventLogs.RDPAuth (opens in a new tab)