Fixing KRB_AP_ERR_MODIFIED: Diagnosing Broken Secure Channels and Computer Password Mismatches
A technical guide to understanding, diagnosing, and resolving Kerberos 0x24 (KRB_AP_ERR_MODIFIED) errors caused by machine account password desynchronisation.
An automatically rotated 120-character secret shared between a local system’s LSA secrets and Active Directory.
The Key Distribution Center encrypts Kerberos service tickets using the long-term secret key derived from the target account’s password.
A condition where local Local Security Authority (LSA) secrets no longer match the unicodePwd attribute in Active Directory.
The Mechanics of KRB_AP_ERR_MODIFIED
Think of a Kerberos service ticket as a sealed security pouch sent from the Key Distribution Center (KDC) to a target server. The KDC locks the pouch using a secret cryptographic key derived from the target server’s computer account password stored in Active Directory. When the client presents this pouch to the server, the server uses its locally stored copy of that same password to unlock it. If the keys do not match, the target server cannot open the pouch and returns Kerberos error 0x24: KRB_AP_ERR_MODIFIED.
This error translates literally to “Message stream modified”. In practice, it rarely means an attacker intercepted and tampered with the network packet. Instead, it almost always signifies that the target server attempted to decrypt a Kerberos Ticket Granting Service (TGS) ticket using an outdated or mismatched secret key, leading to a complete decryption failure inside lsass.exe.
By default, domain-joined Windows computers auto-rotate their computer account passwords every 30 days. The machine initiates this change with a primary domain controller (PDC) emulator, updates its local LSA secrets registry hive, and writes the new password to AD. If this operation breaks halfway, or if Active Directory replication fails across sites, Kerberos authentication breaks immediately.
Enterprise Failure Patterns
In enterprise infrastructure, computer account password desynchronisation typically stems from three specific operational scenarios. Understanding these failure modes prevents long debugging sessions focused on false network or DNS leads.
The most common culprit is virtual machine snapshot restoration or SAN backup rollbacks. When an administrator restores a target application server to a snapshot taken two weeks prior, the hypervisor restores the server’s local LSA secret key to an older version. However, Active Directory retains the newer password from the most recent automatic rotation. The KDC encrypts TGS tickets using the new key, but the restored server attempts to decrypt them using the rolled-back key.
Another frequent cause is interrupted machine password rotation combined with Active Directory replication topology delays. If a application server updates its password on Domain Controller A, but a client requests a ticket from Domain Controller B before replication completes, DC B might issue a ticket encrypted with the old password key. When presented to the server, decryption fails.
Lastly, duplicate Service Principal Names (SPNs) registered across multiple accounts can trigger this exact behaviour. If an SPN is accidentally mapped to both a machine account and a managed service account, the KDC may encrypt the ticket with the wrong account’s secret key altogether.
Diagnostic Workflow and Identification
When users report authentication failures to SMB shares, IIS web applications, or SQL Server instances, start by reviewing the System Event Log on the destination host or client machine. Look for System Event ID 4 from the Microsoft-Windows-Kerberos-Client source detailing error code 0x24.
To confirm whether the issue stems from a broken secure channel on the target server itself, log into the affected machine and execute diagnostic commands against the domain trust channel.
# Verify the secure channel state against Active Directory
Test-ComputerSecureChannel -Verbose
# Query the active domain controller connection and secure channel health
nltest /sc_query:yourdomain.com
If Test-ComputerSecureChannel returns False or nltest reports status 1311 (ERROR_NO_LOGON_SERVERS) or 5 (ERROR_ACCESS_DENIED), the machine’s local password secret has diverged from Active Directory. At this point, Kerberos authentication will continuously fail until the channel is re-synchronised.
Remediation Strategies
Resolving a broken secure channel requires synchronising the local computer account secret with Active Directory without causing unnecessary system downtime or requiring an administrative reboot whenever possible.
The cleanest approach is repairing the secure channel directly in PowerShell using elevated domain administrative credentials. This forces an immediate password reset between the local LSA store and Active Directory.
# Method 1: Repair the secure channel using explicit domain credentials
$cred = Get-Credential "YOURDOMAIN\DomainAdmin"
Test-ComputerSecureChannel -Repair -Credential $cred
# Method 2: Reset the computer machine password explicitly against a specific DC
Reset-ComputerMachinePassword -Server "DC01.yourdomain.com" -Credential $cred
If PowerShell cmdlets fail due to deep LSA corruption or restricted administrative access, you can fall back to traditional command-line tooling using netdom.
# Reset computer account password via netdom
netdom resetpwd /s:DC01.yourdomain.com /ud:YOURDOMAIN\DomainAdmin /pd:*
In extreme cases where the computer account object in Active Directory has been deleted or disabled, automated repair tools will fail. The server must be disjoined from the domain, the AD stale account object cleaned up, and the server re-joined to re-establish trust.
Final Thoughts
The KRB_AP_ERR_MODIFIED error is a classic indicator of cryptographic key desynchronisation inside Kerberos. Treating it as a network or firewall issue wastes critical triage time. By understanding how the KDC uses target SPN secrets to encrypt tickets, systems administrators can swiftly identify snapshot rollbacks, replication lags, or broken secure channels and restore service within minutes.
Test-ComputerSecureChannel before attempting complex service restarts or network traces.
Understanding Kerberos Constrained Delegation (KCD) and Service Principal Name (SPN) Misconfigurations.