sequence by winlog.computer_name, source.ip with maxspan=5s
/* Filter for an event that indicates coercion against known abused named pipes using an account that is not the host */
[file where host.os.type == "windows" and event.code : "5145" and
not startswith~(winlog.computer_name, substring(user.name, 0, -1)) and
file.name : (
"Spoolss", "netdfs", "lsarpc", "lsass", "netlogon", "samr", "efsrpc", "FssagentRpc",
"eventlog", "winreg", "srvsvc", "dnsserver", "dhcpserver", "WinsPipe"
)]
/* Detects a logon attempt using the Kerberos protocol resulting from the coercion coming from the same IP address */
[authentication where host.os.type == "windows" and event.code in ("4624", "4625") and
endswith~(user.name, "$") and winlog.logon.type : "network" and
winlog.event_data.AuthenticationPackageName : "Kerberos" and
/* Filter for a machine account that matches the hostname */
startswith~(winlog.computer_name, substring(user.name, 0, -1)) and
/* Verify if the Source IP belongs to the host */
not endswith(string(source.ip), string(host.ip)) and
source.ip != null and source.ip != "::1" and source.ip != "127.0.0.1"]
Install detection rules in Elastic Security
Detect Potential Kerberos Relay Attack against a Computer Account in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(opens in a new tab or window).