FortiSIEM Rules

Windows: Potential Active Directory Reconnaissance/Enumeration Via LDAP

Rule ID

PH_Rule_SIGMA_1162

Default Status

Enabled

Description

Detects potential Active Directory enumeration via LDAP. This rule is adapted from https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/ldap/win_ldap_recon.yml

Severity

5

Category

Security

MITRE ATT&CK® Tactics

Discovery

Discovery consists of techniques an adversary may use to gain knowledge about the system and internal network. These techniques help adversaries observe the environment and orient themselves before deciding how to act. They also allow adversaries to explore what they can control and what’s around their entry point in order to discover how it could benefit their current objective. Native operating system tools are often used toward this post-compromise information-gathering objective.

https://attack.mitre.org/tactics/TA0007

MITRE ATT&CK® Techniques


T1482

Domain Trust Discovery

Adversaries may attempt to gather information on domain trust relationships that may be used to identify lateral movement opportunities in Windows multi-domain/forest environments. Domain trusts provide a mechanism for a domain to allow access to resources based on the authentication procedures of another domain. Domain trusts allow the users of the trusted domain to access resources in the trusting domain. The information discovered may help the adversary conduct SID-History Injection, Pass the Ticket, and Kerberoasting.

https://attack.mitre.org/techniques/T1482

Impacts

Server

Data Source

Windows Security log via OMI or FortiSIEM Agent

Detection

Correlation

Remediation Guidance

No remediation guidance specified

Time Window

If the following pattern or patterns match an ingested event within the given time window in seconds, trigger an incident.

300 seconds

Trigger Conditions

If the following defined pattern/s occur within a 300 second time window.

Filter

SubPattern Definitions

SubPattern Name: Filter

This is the named definition of the event query, this is important if multiple subpatterns are defined to distinguish them.

SubPattern Query

This is the query logic that matches incoming events

((eventType REGEXP "Win-.*-30[^\d]*" AND queryFilter REGEXP ".*Domain Admins.*|.*\(groupType:1\.2\.840\.113556\.1\.4\.803:=2147483648\).*|.*\(groupType:1\.2\.840\.113556\.1\.4\.803:=2147483650\).*|.*\(groupType:1\.2\.840\.113556\.1\.4\.803:=2147483652\).*|.*\(groupType:1\.2\.840\.113556\.1\.4\.803:=2147483656\).*|.*\(objectCategory=Computer\).*|.*\(objectCategory=domain\).*|.*\(objectCategory=groupPolicyContainer\).*|.*\(objectCategory=group\).*|.*\(objectCategory=nTDSDSA\).*|.*\(objectCategory=organizationalUnit\).*|.*\(objectCategory=person\).*|.*\(objectCategory=server\).*|.*\(objectCategory=user\).*|.*\(objectClass=computer\).*|.*\(objectClass=group\).*|.*\(objectClass=server\).*|.*\(objectClass=trustedDomain\).*|.*\(objectClass=user\).*|.*\(primaryGroupID=512\).*|.*\(primaryGroupID=515\).*|.*\(primaryGroupID=516\).*|.*\(primaryGroupID=521\).*|.*\(sAMAccountType=268435456\).*|.*\(sAMAccountType=268435457\).*|.*\(sAMAccountType=536870912\).*|.*\(sAMAccountType=536870913\).*|.*\(sAMAccountType=805306368\).*|.*\(sAMAccountType=805306369\).*|.*\(schemaIDGUID=\*\).*|.*objectGUID=\\.*") AND (eventType NOT REGEXP "Win-.*-30[^\d]*" OR queryFilter NOT REGEXP ".*\(domainSid=.*\).*|.*\(objectSid=.*\).*")) OR (eventType REGEXP "Win-.*-30[^\d]*" AND queryFilter REGEXP ".*\!\(UserAccountControl:1\.2\.840\.113556\.1\.4\.803:=2\).*|.*\!\(userAccountControl:1\.2\.840\.113556\.1\.4\.803:=1048574\).*|.*\(accountExpires=0\).*|.*\(accountExpires=9223372036854775807\).*|.*\(adminCount=1\).*|.*\(userAccountControl:1\.2\.840\.113556\.1\.4\.803:=2097152\).*|.*\(userAccountControl:1\.2\.840\.113556\.1\.4\.803:=4194304\).*|.*\(userAccountControl:1\.2\.840\.113556\.1\.4\.803:=524288\).*|.*\(userAccountControl:1\.2\.840\.113556\.1\.4\.803:=544\).*|.*\(userAccountControl:1\.2\.840\.113556\.1\.4\.803:=65536\).*|.*\(userAccountControl:1\.2\.840\.113556\.1\.4\.803:=8192\).*|.*ms-MCS-AdmPwd.*|.*msDS-AllowedToActOnBehalfOfOtherIdentity.*|.*msDS-AllowedToDelegateTo.*|.*msDS-GroupManagedServiceAccount.*")

Group by Attributes

This defines how matching events are aggregated, only events with the same matching attribute values are grouped into one unique incident ID

hostName,queryFilter

Aggregate Constraint

This is most typically a numerical constraint that defines when the rule should trigger an incident

COUNT(*) >= 1

Incident Attribute Mapping

This section defines which fields in matching raw events should be mapped to the incident attributes in the resulting incident.

The available raw event attributes to map are limited to the group by attributes and the aggregate event constraint fields for each subpattern

hostName = Filter.hostName,
queryFilter = Filter.queryFilter