Enumerating Domain Trusts via DSQUERY.EXE
Identifies the use of dsquery.exe for domain trust discovery purposes. Adversaries may use this command-line utility to enumerate trust relationships that may be used for Lateral Movement opportunities in Windows multi-domain forest environments.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2023/01/27"
3integration = ["endpoint", "windows"]
4maturity = "production"
5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
6min_stack_version = "8.3.0"
7updated_date = "2023/02/22"
8
9[rule]
10author = ["Elastic"]
11description = """
12Identifies the use of dsquery.exe for domain trust discovery purposes. Adversaries may use this command-line utility to
13enumerate trust relationships that may be used for Lateral Movement opportunities in Windows multi-domain forest
14environments.
15"""
16false_positives = [
17 "Domain administrators may use this command-line utility for legitimate information gathering purposes.",
18]
19from = "now-9m"
20index = ["winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*", "endgame-*"]
21language = "eql"
22license = "Elastic License v2"
23name = "Enumerating Domain Trusts via DSQUERY.EXE"
24note = """## Setup
25
26If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
27"""
28references = [
29 "https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc732952(v=ws.11)",
30 "https://posts.specterops.io/a-guide-to-attacking-domain-trusts-971e52cb2944",
31]
32risk_score = 21
33rule_id = "06a7a03c-c735-47a6-a313-51c354aef6c3"
34severity = "low"
35tags = ["Elastic", "Host", "Windows", "Threat Detection", "Discovery", "Elastic Endgame"]
36timestamp_override = "event.ingested"
37type = "eql"
38
39query = '''
40process where host.os.type == "windows" and event.type == "start" and
41 (process.name : "dsquery.exe" or process.pe.original_file_name: "dsquery.exe") and
42 process.args : "*objectClass=trustedDomain*"
43'''
44
45
46[[rule.threat]]
47framework = "MITRE ATT&CK"
48[[rule.threat.technique]]
49id = "T1482"
50name = "Domain Trust Discovery"
51reference = "https://attack.mitre.org/techniques/T1482/"
52[[rule.threat.technique]]
53id = "T1018"
54name = "Remote System Discovery"
55reference = "https://attack.mitre.org/techniques/T1018/"
56
57[rule.threat.tactic]
58id = "TA0007"
59name = "Discovery"
60reference = "https://attack.mitre.org/tactics/TA0007/"
Setup
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define event.ingested
and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate event.ingested
to @timestamp for this rule to work.