Detection rules › Sigma

Domain Trust Discovery Via Dsquery

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
E.M. Anhaus, Tony Lambert, oscd.community, omkar72
Source
github.com/SigmaHQ/sigma

Detects execution of "dsquery.exe" for domain trust discovery

MITRE ATT&CK coverage

TacticTechniques
DiscoveryT1482 Domain Trust Discovery

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Domain Trust Discovery Via Dsquery
id: 3bad990e-4848-4a78-9530-b427d854aac0
related:
    - id: b23fcb74-b1cb-4ff7-a31d-bfe2a7ba453b
      type: similar
    - id: 77815820-246c-47b8-9741-e0def3f57308
      type: obsolete
status: test
description: Detects execution of "dsquery.exe" for domain trust discovery
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1482/T1482.md
    - https://posts.specterops.io/an-introduction-to-manual-active-directory-querying-with-dsquery-and-ldapsearch-84943c13d7eb?gi=41b97a644843
author: E.M. Anhaus, Tony Lambert, oscd.community, omkar72
date: 2019-10-24
modified: 2023-02-02
tags:
    - attack.discovery
    - attack.t1482
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\dsquery.exe'
        - OriginalFileName: 'dsquery.exe'
    selection_cli:
        CommandLine|contains: 'trustedDomain'
    condition: all of selection_*
falsepositives:
    - Legitimate use of the utilities by legitimate user for legitimate reason
level: medium
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_dsquery_domain_trust_discovery/info.yml
simulation:
    - type: atomic-red-team
      name: Windows - Discover domain trusts with dsquery
      technique: T1482
      atomic_guid: 4700a710-c821-4e17-a3ec-9e4c81d6845f

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_img

selection_img:
    - Image|endswith: '\dsquery.exe'
    - OriginalFileName: 'dsquery.exe'

Stage 2: selection_cli

selection_cli:
    CommandLine|contains: 'trustedDomain'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • trustedDomain corpus 2 (sigma 1, splunk 1)
Imageends_with
  • \dsquery.exe corpus 2 (sigma 2)
OriginalFileNameeq
  • dsquery.exe corpus 3 (sigma 2, elastic 1)