Detection rules › Sigma
DNS Server Discovery Via LDAP Query
Detects DNS server discovery via LDAP query requests from uncommon applications
Known false positives
- Likely
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 22: DNSEvent (DNS query) |
Rule body
title: DNS Server Discovery Via LDAP Query
id: a21bcd7e-38ec-49ad-b69a-9ea17e69509e
status: test
description: Detects DNS server discovery via LDAP query requests from uncommon applications
references:
- https://github.com/redcanaryco/atomic-red-team/blob/980f3f83fd81f37c1ca9c02dccfd1c3d9f9d0841/atomics/T1016/T1016.md#atomic-test-9---dns-server-discovery-using-nslookup
- https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/7fcdce70-5205-44d6-9c3a-260e616a2f04
author: frack113
date: 2022-08-20
modified: 2023-09-18
tags:
- attack.discovery
- attack.t1482
logsource:
product: windows
category: dns_query
detection:
selection:
QueryName|startswith: '_ldap.'
filter_main_generic:
Image|contains:
- ':\Program Files\'
- ':\Program Files (x86)\'
- ':\Windows\'
filter_main_defender:
Image|contains: ':\ProgramData\Microsoft\Windows Defender\Platform\'
Image|endswith: '\MsMpEng.exe'
filter_main_unknown:
Image: '<unknown process>'
filter_optional_azure:
Image|startswith: 'C:\WindowsAzure\GuestAgent'
filter_main_null:
Image: null
filter_optional_browsers:
# Note: This list is for browsers installed in the user context. To avoid basic evasions based on image name. Best to baseline this list with the browsers you use internally and add their full paths.
Image|endswith:
- '\chrome.exe'
- '\firefox.exe'
- '\opera.exe'
condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
- Likely
# Note: Incrase the level once a baseline is established
level: low
Stages and Predicates
Stage 0: condition
selection and not 1 of filter_main_* and not 1 of filter_optional_*Stage 1: selection
selection:
QueryName|startswith: '_ldap.'
Stage 2: not filter_main_*
filter_main_generic:
Image|contains:
- ':\Program Files\'
- ':\Program Files (x86)\'
- ':\Windows\'
filter_main_defender:
Image|contains: ':\ProgramData\Microsoft\Windows Defender\Platform\'
Image|endswith: '\MsMpEng.exe'
filter_main_unknown:
Image: '<unknown process>'
filter_main_null:
Image: null
Stage 3: not filter_optional_*
filter_optional_azure:
Image|startswith: 'C:\WindowsAzure\GuestAgent'
filter_optional_browsers:
Image|endswith:
- '\chrome.exe'
- '\firefox.exe'
- '\opera.exe'
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
Image | ends_with | \MsMpEng.exe | excludes:Image field:"Image" value:"\MsMpEng.exe" |
Image | match | :\ProgramData\Microsoft\Windows Defender\Platform\ | excludes:Image field:"Image" value:":\ProgramData\Microsoft\Windows Defender\Platform\" |
Image | eq | <unknown process> | excludes:Image field:"Image" value:"<unknown process>" |
Image | is_null | excludes:Image | |
Image | match | :\Program Files (x86)\ | excludes:Image field:"Image" value:":\Program Files (x86)\" |
Image | match | :\Program Files\ | excludes:Image field:"Image" value:":\Program Files\" |
Image | match | :\Windows\ | excludes:Image field:"Image" value:":\Windows\" |
Image | ends_with | \chrome.exe | excludes:Image field:"Image" value:"\chrome.exe" |
Image | ends_with | \firefox.exe | excludes:Image field:"Image" value:"\firefox.exe" |
Image | ends_with | \opera.exe | excludes:Image field:"Image" value:"\opera.exe" |
Image | starts_with | C:\WindowsAzure\GuestAgent | excludes:Image field:"Image" value:"C:\WindowsAzure\GuestAgent" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
QueryName | starts_with |
| field:"QueryName" kind:starts_with value:"_ldap." |