detection-rules icon indicating copy to clipboard operation
detection-rules copied to clipboard

[Rule Tuning] AdFind Command Activity

Open TT5H opened this issue 3 weeks ago • 2 comments

Link to Rule

https://github.com/elastic/detection-rules/blob/main/rules/windows/discovery_adfind_command_activity.toml

Rule Tuning Type

False Negatives - Enhancing detection of true threats that were previously missed.

Description

Rule id eda499b8-a073-4e35-9733-22ec71f57f3a, checked on main at 836b5669b5.

The process.args list of the query contains computers_pwnotreqd:

"domainlist", "dcmodes", "adinfo", "dclist", "computers_pwnotreqd", "trustdmp")

AdFind's own usage page (http://www.joeware.net/freetools/tools/adfind/usage.htm) lists the shortcut as -sc computers_pwdnotreqd, with a d ("Dump computers set with password not required"). The page does not list computers_pwnotreqd. So adfind.exe -sc computers_pwdnotreqd does not match this part of the query. process.args holds the token computers_pwdnotreqd, and the rule compares it with the text without the d.

Suggested change: computers_pwnotreqd to computers_pwdnotreqd.

The open pull request #6999 edits the same query and keeps computers_pwnotreqd.

Example Data

Event for a run of adfind.exe -sc computers_pwdnotreqd:

{
  "@timestamp": "2026-11-14T00:00:00Z",
  "host": { "os": { "type": "windows" } },
  "event": { "category": "process", "type": "start" },
  "process": { "name": "adfind.exe", "args": ["adfind.exe", "-sc", "computers_pwdnotreqd"] }
}

I indexed the three events of this table in Elasticsearch 9.5.6 and ran the EQL query of the rule from main:

process.args Current query With computers_pwdnotreqd
adfind.exe, -sc, computers_pwdnotreqd no match match
adfind.exe, -sc, computers_pwnotreqd match no match
AdFind.exe, -f, objectcategory=computer match match

TT5H avatar Nov 14 '26 17:11 TT5H

Hi @bryans3c, I'd like to pick this up. Plan: in rules/windows/discovery_adfind_command_activity.toml, add computers_pwdnotreqd (AdFind's documented -sc shortcut) to the process.args list next to the existing computers_pwnotreqd, so the rule catches real usage and keeps every event it matches today, and bump updated_date. Because open PR #6999 edits the same query, I'll keep this change minimal so either PR can rebase easily. I'll run the repo's unit tests and rule validation, and check the query against the reporter's sample events, where adfind.exe -sc computers_pwdnotreqd should now match. Could you assign it to me?

rahulsjha avatar Nov 16 '26 17:11 rahulsjha

I am opening a PR for this.

TT5H avatar Nov 16 '26 18:11 TT5H