AdFind Command Activity

This rule detects the Active Directory query tool, AdFind.exe. AdFind has legitimate purposes, but it is frequently leveraged by threat actors to perform post-exploitation Active Directory reconnaissance. The AdFind tool has been observed in Trickbot, Ryuk, Maze, and FIN6 campaigns. For Winlogbeat, this rule requires Sysmon.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/10/19"
  3integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
  4maturity = "production"
  5updated_date = "2024/11/02"
  6min_stack_version = "8.14.0"
  7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12This rule detects the Active Directory query tool, AdFind.exe. AdFind has legitimate purposes, but it is frequently
 13leveraged by threat actors to perform post-exploitation Active Directory reconnaissance. The AdFind tool has been
 14observed in Trickbot, Ryuk, Maze, and FIN6 campaigns. For Winlogbeat, this rule requires Sysmon.
 15"""
 16from = "now-9m"
 17index = [
 18    "logs-endpoint.events.process-*",
 19    "winlogbeat-*",
 20    "logs-windows.forwarded*",
 21    "logs-windows.sysmon_operational-*",
 22    "endgame-*",
 23    "logs-system.security*",
 24    "logs-m365_defender.event-*",
 25    "logs-sentinel_one_cloud_funnel.*",
 26    "logs-crowdstrike.fdr*",
 27]
 28language = "eql"
 29license = "Elastic License v2"
 30name = "AdFind Command Activity"
 31note = """## Triage and analysis
 32
 33### Investigating AdFind Command Activity
 34
 35[AdFind](http://www.joeware.net/freetools/tools/adfind/) is a freely available command-line tool used to retrieve information from Active Directory (AD). Network discovery and enumeration tools like `AdFind` are useful to adversaries in the same ways they are effective for network administrators. This tool provides quick ability to scope AD person/computer objects and understand subnets and domain information. There are many [examples](https://thedfirreport.com/category/adfind/) of this tool being adopted by ransomware and criminal groups and used in compromises.
 36
 37#### Possible investigation steps
 38
 39- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
 40- Identify the user account that performed the action and whether it should perform this kind of action.
 41- Examine the command line to determine what information was retrieved by the tool.
 42- Contact the account owner and confirm whether they are aware of this activity.
 43- Investigate other alerts associated with the user/host during the past 48 hours.
 44
 45### False positive analysis
 46
 47- This rule has a high chance to produce false positives as it is a legitimate tool used by network administrators.
 48- If this rule is noisy in your environment due to expected activity, consider adding exceptions — preferably with a combination of user and command line conditions.
 49- Malicious behavior with `AdFind` should be investigated as part of a step within an attack chain. It doesn't happen in isolation, so reviewing previous logs/activity from impacted machines can be very telling.
 50
 51### Related rules
 52
 53- Windows Network Enumeration - 7b8bfc26-81d2-435e-965c-d722ee397ef1
 54- Enumeration of Administrator Accounts - 871ea072-1b71-4def-b016-6278b505138d
 55- Enumeration Command Spawned via WMIPrvSE - 770e0c4d-b998-41e5-a62e-c7901fd7f470
 56
 57### Response and remediation
 58
 59- Initiate the incident response process based on the outcome of the triage.
 60- Isolate the involved host to prevent further post-compromise behavior.
 61- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
 62- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 63- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 64- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
 65"""
 66references = [
 67    "http://www.joeware.net/freetools/tools/adfind/",
 68    "https://thedfirreport.com/2020/05/08/adfind-recon/",
 69    "https://www.fireeye.com/blog/threat-research/2020/05/tactics-techniques-procedures-associated-with-maze-ransomware-incidents.html",
 70    "https://www.cybereason.com/blog/dropping-anchor-from-a-trickbot-infection-to-the-discovery-of-the-anchor-malware",
 71    "https://www.fireeye.com/blog/threat-research/2019/04/pick-six-intercepting-a-fin6-intrusion.html",
 72    "https://usa.visa.com/dam/VCOM/global/support-legal/documents/fin6-cybercrime-group-expands-threat-To-ecommerce-merchants.pdf",
 73]
 74risk_score = 21
 75rule_id = "eda499b8-a073-4e35-9733-22ec71f57f3a"
 76severity = "low"
 77tags = [
 78    "Domain: Endpoint",
 79    "OS: Windows",
 80    "Use Case: Threat Detection",
 81    "Tactic: Discovery",
 82    "Resources: Investigation Guide",
 83    "Data Source: Elastic Endgame",
 84    "Data Source: Elastic Defend",
 85    "Data Source: System",
 86    "Data Source: Microsoft Defender for Endpoint",
 87    "Data Source: Sysmon",
 88    "Data Source: SentinelOne",
 89    "Data Source: Crowdstrike",
 90]
 91timestamp_override = "event.ingested"
 92type = "eql"
 93
 94query = '''
 95process where host.os.type == "windows" and event.type == "start" and
 96  (process.name : "AdFind*.exe" or ?process.pe.original_file_name == "AdFind.exe") and
 97  process.args : ("objectcategory=computer", "(objectcategory=computer)",
 98                  "objectcategory=person", "(objectcategory=person)",
 99                  "objectcategory=subnet", "(objectcategory=subnet)",
100                  "objectcategory=group", "(objectcategory=group)",
101                  "objectcategory=organizationalunit", "(objectcategory=organizationalunit)",
102                  "objectcategory=attributeschema", "(objectcategory=attributeschema)",
103                  "domainlist", "dcmodes", "adinfo", "dclist", "computers_pwnotreqd", "trustdmp")
104'''
105
106
107[[rule.threat]]
108framework = "MITRE ATT&CK"
109[[rule.threat.technique]]
110id = "T1016"
111name = "System Network Configuration Discovery"
112reference = "https://attack.mitre.org/techniques/T1016/"
113
114[[rule.threat.technique]]
115id = "T1018"
116name = "Remote System Discovery"
117reference = "https://attack.mitre.org/techniques/T1018/"
118
119[[rule.threat.technique]]
120id = "T1069"
121name = "Permission Groups Discovery"
122reference = "https://attack.mitre.org/techniques/T1069/"
123[[rule.threat.technique.subtechnique]]
124id = "T1069.002"
125name = "Domain Groups"
126reference = "https://attack.mitre.org/techniques/T1069/002/"
127
128
129[[rule.threat.technique]]
130id = "T1087"
131name = "Account Discovery"
132reference = "https://attack.mitre.org/techniques/T1087/"
133[[rule.threat.technique.subtechnique]]
134id = "T1087.002"
135name = "Domain Account"
136reference = "https://attack.mitre.org/techniques/T1087/002/"
137
138
139[[rule.threat.technique]]
140id = "T1482"
141name = "Domain Trust Discovery"
142reference = "https://attack.mitre.org/techniques/T1482/"
143
144
145[rule.threat.tactic]
146id = "TA0007"
147name = "Discovery"
148reference = "https://attack.mitre.org/tactics/TA0007/"

Triage and analysis

Investigating AdFind Command Activity

AdFind is a freely available command-line tool used to retrieve information from Active Directory (AD). Network discovery and enumeration tools like AdFind are useful to adversaries in the same ways they are effective for network administrators. This tool provides quick ability to scope AD person/computer objects and understand subnets and domain information. There are many examples of this tool being adopted by ransomware and criminal groups and used in compromises.

Possible investigation steps

  • Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
  • Identify the user account that performed the action and whether it should perform this kind of action.
  • Examine the command line to determine what information was retrieved by the tool.
  • Contact the account owner and confirm whether they are aware of this activity.
  • Investigate other alerts associated with the user/host during the past 48 hours.

False positive analysis

  • This rule has a high chance to produce false positives as it is a legitimate tool used by network administrators.
  • If this rule is noisy in your environment due to expected activity, consider adding exceptions — preferably with a combination of user and command line conditions.
  • Malicious behavior with AdFind should be investigated as part of a step within an attack chain. It doesn't happen in isolation, so reviewing previous logs/activity from impacted machines can be very telling.
  • Windows Network Enumeration - 7b8bfc26-81d2-435e-965c-d722ee397ef1
  • Enumeration of Administrator Accounts - 871ea072-1b71-4def-b016-6278b505138d
  • Enumeration Command Spawned via WMIPrvSE - 770e0c4d-b998-41e5-a62e-c7901fd7f470

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved host to prevent further post-compromise behavior.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

References

Related rules

to-top