4776 : The computer attempted to validate the credentials for an account

  • Generates every time that a credential validation occurs using NTLM authentication
  • Occurs only on the computer that is authoritative for the provided credentials, domain controller for domain accounts and member servers or workstations for local accounts
  • Logs both successful and unsuccessful credential validation attempts
  • Also generates when a workstation unlock event occurs
  • Does not generate when a domain account logs on locally to a domain controller
4776The computer attempted to validate the credentials for an account
CategoryAudit Credential Validation
Event TypeSuccess, Error
ProviderMicrosoft-Windows-Security-Auditing
ChannelSecurity
CriticityLow
VolumetryMedium
Referencehttps://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4776
  • It shows only the computer name (Source Workstation) from which the authentication attempt was performed
  • By watching this event on domain controllers you can see all NTLM authentication attempts for domain accounts
  • For monitoring local account logon attempts, it’s better to use event “4624: An account was successfully logged on” because it contains more details and is more informative
  • Can be an indicator of Account Takeover attempts, or Brute Force Passwords attacks
  • Monitor if NTLM authentication shouldn’t be used for a specific account
  • Monitor if a local account should be used only locally (for example, network logon or terminal services logon isn’t allowed), monitor all events where Source Workstation and Computer (where the event was generated and the credentials are stored) have different values.
  • If you want to collect all NTLM authentication attempts in the domain, or on a local machine
  • Keep focus on high-privileged and service accounts
What to track ?Error CodeDescription
User logon with misspelled or bad user account0xC0000064
0xC000006D
Account Enumeration
– N events in the last N minutes can be an indicator of an attack
User logon with misspelled or bad password0xC000006A
0xC000006D
Brute Force Attack
– N events in the last N minutes can be an indicator of an attack
User logon with account locked
0xC0000234Brute Force Attack
– Monitor for critical accounts
User logon outside authorized hours0xC000006FAccount Compromised
– Monitor for critical accounts
User logon from unauthorized workstation0xC0000070Account Compromised
– Monitor for critical accounts
User logon to account disabled by administrator0xC0000072Account Compromised
– N events in the last N minutes can be an indicator of an account compromise
User logon with expired account0xC0000193Account Compromised
– Monitor for critical accounts
LAN Manager Authentication Level mismatch0xC000006DConfiguration Error
– Review LAN Manager authenticatiion Level between source and target
  • Event 4776 Structure
Displayed ValueXML ValueDescription
Authentication Package1PackageNameFor this event it’s always “MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
Logon AccountTargetUserNameName of the account that had its credentials validated by the Authentication Package
Source WorkstationWorkstationName of the computer from which the logon attempt originated
Error CodeStatusContains error code for Failure events. For Success events this parameter has “0x0
  • The table below contains most common error codes for this event
Error CodeError StatusDescription
0x0STATUS_SUCCESSNo errors
0xC0000022STATUS_ACCESS_DENIEDThe root cause may be various.
0xC000005ESTATUS_NO_LOGON_SERVERSNo logon servers available to service the logon request.
0xC0000064STATUS_NO_SUCH_USERThe username you typed does not exist. Bad username.
0xC000006ASTATUS_WRONG_PASSWORDAccount logon with misspelled or bad password.
0xC000006DSTATUS_LOGON_FAILURE– Generic logon failure.
Some of the potential causes for this:
– An invalid username and/or password was used
– LAN Manager Authentication Level mismatch between the source and target computers.
0xC000006ESTATUS_ACCOUNT_RESTRICTIONAccount logon with restricted account (blank password usage and not allowed, policy restrictions).
0xC000006FSTATUS_INVALID_LOGON_HOURSAccount logon outside authorized hours.
0xC0000070STATUS_INVALID_WORKSTATIONAccount logon from unauthorized workstation.
0xC0000071STATUS_PASSWORD_EXPIREDAccount logon with expired password.
0xC0000072STATUS_ACCOUNT_DISABLEAccount logon to account disabled by administrator.
0xC000009ASTATUS_INSUFFICIENT_RESSOURCESRessource issue on system that prevents Netlogon to operate properly.
0xC00000DCSTATUS_INVALID_SERVER_STATEThe SAM or the LSA was in the wrong state to perform the operation. DC is shutting down or restarting.
0xC000018ASTATUS_NO_TRUST_LSA_SECRETConnection to the domain is broken from the computer user is trying to log on to.
0xC0000192STATUS_NETLOGON_NOT_STARTEDThe netlogon service was not started.
0xC0000193STATUS_ACCOUNT_EXPIREDAccount logon with expired account.
0xC0000199STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNTComputer account used instead of user account. May happen when “Allow local system to use computer identity for NTLM” is confiured, and when the owner of the WAA group is expired, or when the computer failed to join a domain.
0xC0000224STATUS_PASSWORD_MUST_CHANGEAccount logon with “Change Password at Next Logon” flagged.
0xC0000234STATUS_ACCOUNT_LOCKED_OUTAccount logon with account locked.
0xC00002EESTATUS_UNFINISHED_CONTEXT_DELETEDSecurity context deleted before the context was completed.
0xC0000371STATUS_NO_SECRETThe local account store does not contain secret material for the specified account.
0xC0000413STATUS_AUTHENTICATION_FIREWALL_FAILEDThe computer you are loggin to is protected by a firewall, and the specified account is not allowed to authenticate.
Netlogon Error Codes
  • Get XML template of the 4776 event
(Get-WinEvent -ListProvider Microsoft-Windows-Security-Auditing).Events | ? {$_.Id -eq '4776'}

  • Powershell script to export in a CSV file all 4776 events containing error codes for the current domain.
# Audit 4776 Events (the computer attempted to validate the credentials for an account)
# EventID_4776_ComputerAttemptedToValidateCredentialForUser(NTLMv1).ps1
# wiki.l0ran.xyz
# September 5th, 2024

# Audit 4776 Events with error code != 0x0
$filterxpath = "*[System[(EventID=4776)]] and *[EventData[Data[@Name='Status']!='0x0']]"

# CSV Output folder
$CSVOutputFolder = 'C:\tmp'

# CSV Outfile
$CSVOutFile = "$CSVOutputFolder\EventID_4776_NTLMv1-CredentialsValidated.csv"

$dom = @()
$DCList = @()
$dom = (Get-ADDomainController).domain
$DCList = (Get-ADDomainController -filter * -server $dom).hostname

function get-4776
{param
( [Object]
[Parameter(Mandatory=$true, ValueFromPipeline=$true, HelpMessage="Data to process")]
$Event
)
process
{$eventXml_4776 = ([xml]$Event.ToXml()).Event
[PSCustomObject]@{
Date = [DateTime]$eventXml_4776.System.TimeCreated.SystemTime
RecordID = $eventXml_4776.System.EventRecordID
Computer = $eventXml_4776.System.Computer
Provider = $eventXml_4776.System.Provider.Name
Level = $eventXml_4776.System.Level
EventID = $eventXml_4776.System.EventID
Keywords = $eventXml_4776.System.Keywords
PackageName = $eventXml_4776.EventData.data[0].'#text'
TargetUserName = $eventXml_4776.EventData.data[1].'#text'
Workstation = $eventXml_4776.EventData.data[2].'#text'
Status = $eventXml_4776.EventData.data[3].'#text'}}
} # End function get-4776

foreach ($DC in $DCList)
{write-host "Working on $DC" -ForegroundColor Cyan
Get-WinEvent -Logname security -ComputerName $DC -FilterXPath $filterxpath -ea 0 |
get-4776 |
Export-Csv -Delimiter ';' -path $CSVOutFile -NoTypeInformation -Append}

# Remove duplicates records (if so)
$FilteredCSV = import-csv -Path $CSVOutFile -Delimiter ";"
$FilteredCSV = ((($FilteredCSV) | Sort-Object -Property RecordID -Unique) | Sort-Object -Descending -Property Date) |
Export-Csv -Delimiter ";" -path $CSVOutFile -NoTypeInformation

  1. Note  Authentication package is a DLL that encapsulates the authentication logic used to determine whether to permit a user to log on. Local Security Authority (LSA) authenticates a user logon by sending the request to an authentication package. The authentication package then examines the logon information and either authenticates or rejects the user logon attempt. ↩︎