Syslog Clearing or Removal Via System Utilities
A Sigma rule for process creation on Linux, by Max Altgelt (Nextron Systems), Roberto Rodriguez (Cyb3rWard0g), OTR (Open Threat Research), MSTIC.
high 1 ATT&CK technique 7 programs it names
What it looks for
detection:
selection_command_cp:
CommandLine|contains: '/dev/null'
Image|endswith: '/cp'
selection_command_ln:
CommandLine|contains:
- '-sf '
- '-sfn '
- '-sfT '
CommandLine|contains|all:
- '/dev/null '
- '/var/log/syslog'
Image|endswith: '/ln'
selection_command_mv:
Image|endswith: '/mv'
selection_command_rm:
CommandLine|contains:
- ' -r '
- ' -f '
- ' -rf '
- '/var/log/syslog'
Image|endswith: '/rm'
selection_command_shred:
CommandLine|contains: '-u '
Image|endswith: '/shred'
selection_command_truncate:
CommandLine|contains:
- '-s '
- '-c '
- '--size'
CommandLine|contains|all:
- '0 '
- '/var/log/syslog'
Image|endswith: '/truncate'
selection_command_unlink:
Image|endswith: '/unlink'
selection_file:
CommandLine|contains: '/var/log/syslog'
selection_unique_journalctl:
CommandLine|contains:
- 'journalctl --vacuum'
- 'journalctl --rotate'
selection_unique_other:
CommandLine|contains:
- ' > /var/log/syslog'
- ' >/var/log/syslog'
- ' >| /var/log/syslog'
- ': > /var/log/syslog'
- ':> /var/log/syslog'
- ':>/var/log/syslog'
- '>|/var/log/syslog'
condition: (selection_file and 1 of selection_command_*) or 1 of selection_unique_*
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 Max Altgelt (Nextron Systems), Roberto Rodriguez (Cyb3rWard0g), OTR (Open Threat Research), MSTIC, 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.
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.