sequence by process.entity_id with maxspan=3m
[library where host.os.type == "windows" and
dll.name : ("System.DirectoryServices*.dll", "System.IdentityModel*.dll") and
not user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
not process.executable :
("?:\\windows\\system32\\dsac.exe",
"?:\\program files\\powershell\\?\\pwsh.exe",
"?:\\windows\\system32\\windowspowershell\\*.exe",
"?:\\windows\\syswow64\\windowspowershell\\*.exe",
"?:\\program files\\microsoft monitoring agent\\*.exe",
"?:\\windows\\adws\\microsoft.activedirectory.webservices.exe")]
[network where host.os.type == "windows" and destination.port == 9389 and source.port >= 49152 and
network.direction == "egress" and network.transport == "tcp" and not cidrmatch(destination.ip, "127.0.0.0/8", "::1/128")]
Install detection rules in Elastic Security
Detect Potential Enumeration via Active Directory Web Service 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).