Potential Kerberos Relay Attack against a Computer Account
Detects potential relay attacks by identifying coercion attempts followed by authentication events using a target server's computer account, originating from a different host. This may indicate that an attacker has captured and relayed the server's computer account hash to execute code on behalf of the compromised system.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2025/06/18"
3integration = ["system", "windows"]
4maturity = "production"
5updated_date = "2025/06/18"
6min_stack_comments = "An EQL bug involving sequences with conditions involving keys and non-keys was fixed in 8.18.6 and above."
7min_stack_version = "8.18.6"
8
9[rule]
10author = ["Elastic"]
11description = """
12Detects potential relay attacks by identifying coercion attempts followed by authentication events using a target
13server's computer account, originating from a different host. This may indicate that an attacker has captured and
14relayed the server's computer account hash to execute code on behalf of the compromised system.
15"""
16from = "now-9m"
17index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
18language = "eql"
19license = "Elastic License v2"
20name = "Potential Kerberos Relay Attack against a Computer Account"
21note = """## Triage and analysis
22
23> **Disclaimer**:
24> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
25
26### Investigating Potential Kerberos Relay Attack against a Computer Account
27
28### Possible investigation steps
29
30- Compare the source.ip to the target server host.ip addresses to make sure it's indeed a remote use of the machine account.
31- Examine the source.ip activities as this is the attacker IP address used to relay.
32- Review all relevant activities such as services creation, file and process events on the target server within the same period.
33- Verify the machine account names that end with a dollar sign ($) to ensure they match the expected hostnames, and investigate any discrepancies.
34- Check the network logon types to confirm if they align with typical usage patterns for the identified machine accounts.
35- Investigate the context of the source IP addresses that do not match the host IP, looking for any signs of unauthorized access or unusual network activity.
36- Correlate the findings with other security logs and alerts to identify any patterns or additional indicators of compromise related to the potential relay attack.
37
38### False positive analysis
39
40- Machine accounts performing legitimate network logons from different IP addresses can trigger false positives. To manage this, identify and whitelist known IP addresses associated with legitimate administrative tasks or automated processes.
41- Scheduled tasks or automated scripts that use machine accounts for network operations may be flagged. Review and document these tasks, then create exceptions for their associated IP addresses and hostnames.
42- Load balancers or proxy servers that alter the source IP address of legitimate authentication requests can cause false alerts. Ensure these devices are accounted for in the network architecture and exclude their IP addresses from the rule.
43- Temporary network reconfigurations or migrations might result in machine accounts appearing to log in from unexpected hosts. During such events, temporarily adjust the rule parameters or disable the rule to prevent unnecessary alerts.
44- Regularly review and update the list of exceptions to ensure they reflect current network configurations and operational practices, minimizing the risk of overlooking genuine threats.
45
46### Response and Remediation
47
48- Initiate the incident response process based on the outcome of the triage.
49- Isolate the involved hosts to prevent further post-compromise behavior.
50 - If the involved server is a Domain Controller, coordinate the isolation of the server with infrastructure and identity teams to contain the threat while preserving service availability and forensic evidence. Prioritize this step if active compromise or attacker persistence is confirmed.- Reset the domain controller's machine account password, along with any accounts suspected to be compromised or exposed. Ensure strong, unique credentials are used and apply tiered credential hygiene where applicable.
51- Reset the domain controller's machine account password, along with any accounts suspected to be compromised or exposed. Ensure strong, unique credentials are used and apply tiered credential hygiene where applicable.
52- Analyze recent authentication logs, event logs, and network traffic, focusing on suspicious activity and the source IPs referenced in the alert. Correlate findings to identify any lateral movement or additional compromised systems.
53- Strengthen network segmentation, especially between domain controllers, administrative workstations, and critical infrastructure. This limits the attack surface and impedes credential relay or reuse across systems.
54- Escalate the incident to the SOC or incident response team to coordinate a full investigation, containment, and recovery plan. Ensure stakeholders are kept informed throughout the response.
55- Enhance detection mechanisms by tuning alerts and deploying additional telemetry focused on credential relay patterns, anomalous authentication, and NTLM-related activity.
56- Conduct a structured post-incident review, documenting findings, identifying control gaps, and updating playbooks, configurations, or security policies to reduce the likelihood of similar incidents in the future.
57"""
58references = [
59 "https://github.com/p0dalirius/windows-coerced-authentication-methods",
60 "https://www.thehacker.recipes/a-d/movement/mitm-and-coerced-authentications",
61 "https://www.synacktiv.com/publications/ntlm-reflection-is-dead-long-live-ntlm-reflection-an-in-depth-analysis-of-cve-2025",
62 "https://blog.redteam-pentesting.de/2025/reflective-kerberos-relay-attack/",
63 "https://googleprojectzero.blogspot.com/2021/10/using-kerberos-for-authentication-relay.html",
64 "https://github.com/CICADA8-Research/RemoteKrbRelay/blob/main/README.md",
65 "https://github.com/Orange-Cyberdefense/ocd-mindmaps/blob/main/excalimap/mindmap/ad/authenticated.md",
66]
67risk_score = 73
68rule_id = "2d58f67c-156e-480a-a6eb-a698fd8197ff"
69severity = "high"
70tags = [
71 "Domain: Endpoint",
72 "OS: Windows",
73 "Use Case: Threat Detection",
74 "Tactic: Credential Access",
75 "Data Source: Elastic Defend",
76 "Data Source: Active Directory",
77 "Use Case: Active Directory Monitoring",
78 "Data Source: Windows Security Event Logs",
79 "Resources: Investigation Guide",
80]
81timestamp_override = "event.ingested"
82type = "eql"
83
84query = '''
85sequence by winlog.computer_name, source.ip with maxspan=5s
86
87/* Filter for an event that indicates coercion against known abused named pipes using an account that is not the host */
88[file where host.os.type == "windows" and event.code : "5145" and
89 not startswith~(winlog.computer_name, substring(user.name, 0, -1)) and
90 file.name : (
91 "Spoolss", "netdfs", "lsarpc", "lsass", "netlogon", "samr", "efsrpc", "FssagentRpc",
92 "eventlog", "winreg", "srvsvc", "dnsserver", "dhcpserver", "WinsPipe"
93 )]
94
95/* Detects a logon attempt using the Kerberos protocol resulting from the coercion coming from the same IP address */
96[authentication where host.os.type == "windows" and event.code in ("4624", "4625") and
97 endswith~(user.name, "$") and winlog.logon.type : "network" and
98 winlog.event_data.AuthenticationPackageName : "Kerberos" and
99
100 /* Filter for a machine account that matches the hostname */
101 startswith~(winlog.computer_name, substring(user.name, 0, -1)) and
102
103 /* Verify if the Source IP belongs to the host */
104 not endswith(string(source.ip), string(host.ip)) and
105 source.ip != null and source.ip != "::1" and source.ip != "127.0.0.1"]
106'''
107
108
109[[rule.threat]]
110framework = "MITRE ATT&CK"
111[[rule.threat.technique]]
112id = "T1187"
113name = "Forced Authentication"
114reference = "https://attack.mitre.org/techniques/T1187/"
115
116[[rule.threat.technique]]
117id = "T1557"
118name = "Adversary-in-the-Middle"
119reference = "https://attack.mitre.org/techniques/T1557/"
120[[rule.threat.technique.subtechnique]]
121id = "T1557.001"
122name = "LLMNR/NBT-NS Poisoning and SMB Relay"
123reference = "https://attack.mitre.org/techniques/T1557/001/"
124
125
126
127[rule.threat.tactic]
128id = "TA0006"
129name = "Credential Access"
130reference = "https://attack.mitre.org/tactics/TA0006/"
Triage and analysis
Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
Investigating Potential Kerberos Relay Attack against a Computer Account
Possible investigation steps
- Compare the source.ip to the target server host.ip addresses to make sure it's indeed a remote use of the machine account.
- Examine the source.ip activities as this is the attacker IP address used to relay.
- Review all relevant activities such as services creation, file and process events on the target server within the same period.
- Verify the machine account names that end with a dollar sign ($) to ensure they match the expected hostnames, and investigate any discrepancies.
- Check the network logon types to confirm if they align with typical usage patterns for the identified machine accounts.
- Investigate the context of the source IP addresses that do not match the host IP, looking for any signs of unauthorized access or unusual network activity.
- Correlate the findings with other security logs and alerts to identify any patterns or additional indicators of compromise related to the potential relay attack.
False positive analysis
- Machine accounts performing legitimate network logons from different IP addresses can trigger false positives. To manage this, identify and whitelist known IP addresses associated with legitimate administrative tasks or automated processes.
- Scheduled tasks or automated scripts that use machine accounts for network operations may be flagged. Review and document these tasks, then create exceptions for their associated IP addresses and hostnames.
- Load balancers or proxy servers that alter the source IP address of legitimate authentication requests can cause false alerts. Ensure these devices are accounted for in the network architecture and exclude their IP addresses from the rule.
- Temporary network reconfigurations or migrations might result in machine accounts appearing to log in from unexpected hosts. During such events, temporarily adjust the rule parameters or disable the rule to prevent unnecessary alerts.
- Regularly review and update the list of exceptions to ensure they reflect current network configurations and operational practices, minimizing the risk of overlooking genuine threats.
Response and Remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved hosts to prevent further post-compromise behavior.
- If the involved server is a Domain Controller, coordinate the isolation of the server with infrastructure and identity teams to contain the threat while preserving service availability and forensic evidence. Prioritize this step if active compromise or attacker persistence is confirmed.- Reset the domain controller's machine account password, along with any accounts suspected to be compromised or exposed. Ensure strong, unique credentials are used and apply tiered credential hygiene where applicable.
- Reset the domain controller's machine account password, along with any accounts suspected to be compromised or exposed. Ensure strong, unique credentials are used and apply tiered credential hygiene where applicable.
- Analyze recent authentication logs, event logs, and network traffic, focusing on suspicious activity and the source IPs referenced in the alert. Correlate findings to identify any lateral movement or additional compromised systems.
- Strengthen network segmentation, especially between domain controllers, administrative workstations, and critical infrastructure. This limits the attack surface and impedes credential relay or reuse across systems.
- Escalate the incident to the SOC or incident response team to coordinate a full investigation, containment, and recovery plan. Ensure stakeholders are kept informed throughout the response.
- Enhance detection mechanisms by tuning alerts and deploying additional telemetry focused on credential relay patterns, anomalous authentication, and NTLM-related activity.
- Conduct a structured post-incident review, documenting findings, identifying control gaps, and updating playbooks, configurations, or security policies to reduce the likelihood of similar incidents in the future.
References
Related rules
- Potential Computer Account Relay Activity
- Potential NTLM Relay Attack against a Computer Account
- Potential Machine Account Relay Attack via SMB
- Active Directory Forced Authentication from Linux Host - SMB Named Pipes
- Service Creation via Local Kerberos Authentication