Legitimate Application Writing Files In Uncommon Location
A Sigma rule for file creation on Windows, by Swachchhanda Shrawan Poudel (Nextron Systems).
high 2 ATT&CK techniques
What it looks for
detection:
filter_optional_certutil_rootcas_sst:
Image|endswith: '\certutil.exe'
TargetFilename|endswith: '\RootCAs.sst'
TargetFilename|startswith: 'C:\Windows\SystemTemp\'
User|contains:
- 'AUTHORI'
- 'AUTORI'
filter_optional_dell_techhub_copy:
Image|endswith: '\esentutl.exe'
TargetFilename|startswith: 'C:\ProgramData\Dell\DTP\DB\SRUDBData\'
filter_optional_dell_techhub_repair:
Image|endswith: '\esentutl.exe'
TargetFilename|endswith:
- '.INTEG.RAW'
- '.EDB'
TargetFilename|startswith:
- 'C:\Windows\System32\SRUDB_'
- 'C:\Windows\System32\TEMPREPAIR'
filter_optional_expand_system_dpx_scratch:
Image|endswith: '\expand.exe'
TargetFilename|endswith: '$dpx$.tmp'
TargetFilename|startswith: 'C:\Windows\Temp\'
User|contains:
- 'AUTHORI'
- 'AUTORI'
selection_img:
Image|endswith:
- '\eqnedt32.exe'
- '\wordpad.exe'
- '\wordview.exe'
- '\cmdl32.exe'
- '\certutil.exe'
- '\certoc.exe'
- '\CertReq.exe'
- '\bitsadmin.exe'
- '\Desktopimgdownldr.exe'
- '\esentutl.exe'
- '\expand.exe'
- '\extrac32.exe'
- '\replace.exe'
- '\mshta.exe'
- '\ftp.exe'
- '\Ldifde.exe'
- '\RdrCEF.exe'
- '\hh.exe'
- '\finger.exe'
- '\findstr.exe'
selection_locations:
TargetFilename|contains:
- ':\Perflogs'
- ':\ProgramData\'
- ':\Temp\'
- ':\Users\Public\'
- ':\Windows\'
- '\$Recycle.Bin\'
- '\AppData\Local\'
- '\AppData\Roaming\'
- '\Contacts\'
- '\Desktop\'
- '\Favorites\'
- '\Favourites\'
- '\inetpub\wwwroot\'
- '\Music\'
- '\Pictures\'
- '\Start Menu\Programs\Startup\'
- '\Users\Default\'
- '\Videos\'
condition: all of selection_* and not 1 of filter_optional_*
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 Swachchhanda Shrawan Poudel (Nextron Systems), under the Detection Rule License 1.1. CmdID evaluates it on the file a download writes, as Sysmon records it: a test on what a command line cannot show, such as the parent process or the user, is not met.
None of the everyday examples and documented commands on CmdID’s program pages trips it. To see whether a command line does, paste it into CmdID.