File and Directory Discovery - Linux
A Sigma rule for process creation on Linux, by Daniil Yugoslavskiy, oscd.community, CheraghiMilad.
informational 1 ATT&CK technique 5 programs it names 37 everyday examples trip it
What it looks for
detection:
selection_file_with_asterisk:
CommandLine|re: '(.){200,}'
Image|endswith: '/file'
selection_find_execution:
Image|endswith: '/find'
selection_findmnt_execution:
Image|endswith: '/findmnt'
selection_locate_execution:
Image|endswith: '/mlocate'
selection_recursive_ls:
CommandLine|contains: '-R'
Image|endswith: '/ls'
selection_tree_execution:
Image|endswith: '/tree'
condition: 1 of selection_*
The rule’s detection, its selections and fields in order of name. The whole rule, with its references and false positives, is on SigmaHQ, by Daniil Yugoslavskiy, oscd.community, CheraghiMilad, under the Detection Rule License 1.1. CmdID evaluates it on a command line alone: a test on what a command line cannot show, such as the parent process or the user, is not met.
Command lines that trip it
Copy all files and directories in a directory and add them onto an archive (copy-out), in verbose mode on the page for cpio
find path/to/directory | cpio [-ov|--create --verbose] >archive.cpioIdentifyFind files matching multiple path/name patterns on the page for find
find path/to/directory -path '*/path/*/*.ext' -or -name '*pattern*'IdentifyFind directories matching a given name, in case-insensitive mode on the page for find
find path/to/directory -type d -iname '*lib*'IdentifyStart fzf on all files in the specified directory on the page for fzf
find path/to/directory -type f | fzfIdentifySelect multiple files with <Shift Tab> and write to a file on the page for fzf
find path/to/directory -type f | fzf --multi >path/to/fileIdentifyTest all PPD files under the current directory, printing the names of each file that does not conform on the page for cupstestppd
find . -name \*.ppd \! -execdir cupstestppd -q '{}' \; -printIdentifyRebuild the project if source files change, limiting output to the first few lines on the page for entr
find src/ | entr -s 'make | sed 10q'IdentifyFind filesystems in specific type on the page for findmnt
findmnt --types ext4,virtiofs,btrfs,...IdentifyAnd 25 more examples on CmdID’s program pages.
The commands LOLBAS or GTFOBins documents for find trip it too: each is on its program’s page, read by CmdID.