Recursive search for sensitive files under a shared root
Matches a find or grep execution that names a broad filesystem root and a sensitive file type or credential filename in the same command line, which is AN1071's "recursively enumerate user home directories, config files, or SSH keys". The rule is deliberately shaped on the search step rather than on what happens afterwards: MITRE's ScriptToolName knob names find, grep, tar and scp, but tar and scp are dropped here because compression and transfer are already covered by the archiving and exfiltration techniques, and keeping them would make this a second copy of those rules instead of the collection step that precedes them. locate and plocate were considered for the tool list and left out because neither takes a directory argument, so they could never satisfy the root gate and would be a selector that can never fire; find and grep are both real ELF binaries, so the auditd exe= field names them rather than a wrapper shell. Prerequisite: this needs an auditd rule arming the execve syscall (for example -a always,exit -F arch=b64 -S execve), which is absent from a default install on every mainstream distribution — without it the rule returns nothing and the silence means the syscall is not being recorded. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0380, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full descriptionShow less
The detection
The 4 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.
detection.yml
Sentinel · KQL
Run this as a search.
DeviceProcessEvents| where (((FolderPath endswith "/find" or FolderPath endswith "/grep") and (ProcessCommandLine contains " /home" or ProcessCommandLine contains " /root" or ProcessCommandLine contains " /srv" or ProcessCommandLine contains " /var/www" or ProcessCommandLine contains " /opt" or ProcessCommandLine contains " /mnt" or ProcessCommandLine contains " /media" or ProcessCommandLine contains " /export")) and (ProcessCommandLine contains "id_rsa" or ProcessCommandLine contains "id_ed25519" or ProcessCommandLine contains "id_ecdsa" or ProcessCommandLine contains "authorized_keys" or ProcessCommandLine contains "/.ssh" or ProcessCommandLine contains "/.aws" or ProcessCommandLine contains "/.kube" or ProcessCommandLine contains ".git-credentials" or ProcessCommandLine contains ".netrc" or ProcessCommandLine contains ".pgpass" or ProcessCommandLine contains ".kdbx" or ProcessCommandLine contains ".ovpn" or ProcessCommandLine contains ".docx" or ProcessCommandLine contains ".xlsx" or ProcessCommandLine contains ".pdf" or ProcessCommandLine contains ".sql"))
Splunk · SPL
Run this as a search.
index=* (((Image="*/find" OR Image="*/grep") AND (CommandLine="* /home*" OR CommandLine="* /root*" OR CommandLine="* /srv*" OR CommandLine="* /var/www*" OR CommandLine="* /opt*" OR CommandLine="* /mnt*" OR CommandLine="* /media*" OR CommandLine="* /export*")) AND (CommandLine="*id_rsa*" OR CommandLine="*id_ed25519*" OR CommandLine="*id_ecdsa*" OR CommandLine="*authorized_keys*" OR CommandLine="*/.ssh*" OR CommandLine="*/.aws*" OR CommandLine="*/.kube*" OR CommandLine="*.git-credentials*" OR CommandLine="*.netrc*" OR CommandLine="*.pgpass*" OR CommandLine="*.kdbx*" OR CommandLine="*.ovpn*" OR CommandLine="*.docx*" OR CommandLine="*.xlsx*" OR CommandLine="*.pdf*" OR CommandLine="*.sql*"))Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE (((TO_LOWER(process.executable) LIKE "*/find" OR TO_LOWER(process.executable) LIKE "*/grep") AND (TO_LOWER(process.command_line) LIKE "* /home*" OR TO_LOWER(process.command_line) LIKE "* /root*" OR TO_LOWER(process.command_line) LIKE "* /srv*" OR TO_LOWER(process.command_line) LIKE "* /var/www*" OR TO_LOWER(process.command_line) LIKE "* /opt*" OR TO_LOWER(process.command_line) LIKE "* /mnt*" OR TO_LOWER(process.command_line) LIKE "* /media*" OR TO_LOWER(process.command_line) LIKE "* /export*")) AND (TO_LOWER(process.command_line) LIKE "*id_rsa*" OR TO_LOWER(process.command_line) LIKE "*id_ed25519*" OR TO_LOWER(process.command_line) LIKE "*id_ecdsa*" OR TO_LOWER(process.command_line) LIKE "*authorized_keys*" OR TO_LOWER(process.command_line) LIKE "*/.ssh*" OR TO_LOWER(process.command_line) LIKE "*/.aws*" OR TO_LOWER(process.command_line) LIKE "*/.kube*" OR TO_LOWER(process.command_line) LIKE "*.git-credentials*" OR TO_LOWER(process.command_line) LIKE "*.netrc*" OR TO_LOWER(process.command_line) LIKE "*.pgpass*" OR TO_LOWER(process.command_line) LIKE "*.kdbx*" OR TO_LOWER(process.command_line) LIKE "*.ovpn*" OR TO_LOWER(process.command_line) LIKE "*.docx*" OR TO_LOWER(process.command_line) LIKE "*.xlsx*" OR TO_LOWER(process.command_line) LIKE "*.pdf*" OR TO_LOWER(process.command_line) LIKE "*.sql*"))
Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,linux,process_creation,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <rule id="100000" level="7"> <!-- Set <if_sid> to the decoder/base rule for linux so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)(/find$|/grep$)</field> <field name="CommandLine" type="pcre2">(?i)( /home| /root| /srv| /var/www| /opt| /mnt| /media| /export)</field> <field name="CommandLine" type="pcre2">(?i)(id_rsa|id_ed25519|id_ecdsa|authorized_keys|/\.ssh|/\.aws|/\.kube|\.git-credentials|\.netrc|\.pgpass|\.kdbx|\.ovpn|\.docx|\.xlsx|\.pdf|\.sql)</field> <description>Recursive search for sensitive files under a shared root</description> <mitre> <id>T1005</id> </mitre> </rule></group>
Verdicts · reactions · comments
Community
Verdicts from engineers who actually deployed it, and the conversation around it.
Nobody has run this in a real environment and said what happened.
Verdicts from engineers who deployed it
0 castNo verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.
Log in to report a verdict.
Log in to join the discussion.
No comments yet. Someone who deploys this will have something to say about it.