Suspicious Kerberos Enumeration via LDAP Search
Description
Identifies a list of common LDAP search queries used for Kerberoasting and AS-REP Roasting reconnaissance to identify potential target accounts.
Query · eql
api where process.Ext.api.name == "ldap_search" and user.id != "S-1-5-18" and
not process.executable :
("?:\\Program Files\\Azure Advanced Threat Protection Sensor\\*\\Microsoft.Tri.Sensor.exe",
"?:\\Windows\\ADFS\\Microsoft.IdentityServer.ServiceHost.exe",
"?:\\Windows\\ADWS\\Microsoft.ActiveDirectory.WebServices.exe") and
process.Ext.api.parameters.search_filter : (
// Kerberoasting SPN enumeration
"(&(samAccountType=805306368)(servicePrincipalName=?))",
"(&(samAccountType=805306368)(servicePrincipalName=?)(!samAccountName=krbtgt))",
"(&(samAccountType=805306368)(servicePrincipalName=?)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))",
"(&(samAccountType=805306368)(servicePrincipalName=?)(!samAccountName=krbtgt)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))",
"(&(samAccountType=805306369)(servicePrincipalName=?))",
"(&(objectCategory=user)(!(samAccountName=krbtgt)(servicePrincipalName=?)))",
"(servicePrincipalName=?)",
// Delegation-related SPN enumeration
"(&(servicePrincipalName=?)(userAccountControl:1.2.840.113556.1.4.803:=524288))", // Trusted for delegation
"(&(userAccountControl:1.2.840.113556.1.4.803:=524288))", // Trusted for delegation
"(&(servicePrincipalName=?)(userAccountControl:1.2.840.113556.1.4.803:=16777216))", // Trusted to auth for delegation
"(&(servicePrincipalName=?)(userAccountControl:1.2.840.113556.1.4.803:=1048576))", // Account not delegated
// AS-REP Roasting enumeration
"(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=4194304))",
"(&(samAccountType=805306368)(userAccountControl:1.2.840.113556.1.4.803:=4194304))"
)