Detection rules › Sigma

Potential Suspicious Change To Sensitive/Critical Files

Status
test
Severity
medium
Log source
product linux, category process_creation
Author
@d4ns4n_ (Wuerth-Phoenix)
Source
github.com/SigmaHQ/sigma

Detects changes of sensitive and critical files. Monitors files that you don't expect to change without planning on Linux system. These files include, but are not limited to, system configuration files, authentication files, and critical application files. Attackers often target these files to maintain persistence, escalate privileges, or disrupt system operations.

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Potential Suspicious Change To Sensitive/Critical Files
id: 86157017-c2b1-4d4a-8c33-93b8e67e4af4
status: test
description: |
    Detects changes of sensitive and critical files. Monitors files that you don't expect to change without planning on Linux system.
    These files include, but are not limited to, system configuration files, authentication files, and critical application files.
    Attackers often target these files to maintain persistence, escalate privileges, or disrupt system operations.
references:
    - https://learn.microsoft.com/en-us/azure/defender-for-cloud/file-integrity-monitoring-overview#which-files-should-i-monitor
author: '@d4ns4n_ (Wuerth-Phoenix)'
date: 2023-05-30
modified: 2026-03-18
tags:
    - attack.impact
    - attack.t1565.001
logsource:
    category: process_creation
    product: linux
detection:
    selection_img_1:
        Image|endswith:
            - '/cat'
            - '/echo'
            - '/grep'
            - '/head'
            - '/more'
            - '/tail'
        CommandLine|contains: '>'
    selection_img_2:
        Image|endswith:
            - '/emacs'
            - '/nano'
            - '/sed'
            - '/vi'
            - '/vim'
    selection_paths:
        CommandLine|contains:
            - '/bin/login'
            - '/bin/passwd'
            - '/boot/'
            - '/etc/*.conf'
            - '/etc/cron.' # Covers different cron config files "daily", "hourly", etc.
            - '/etc/crontab'
            - '/etc/hosts'
            - '/etc/init.d'
            - '/etc/sudoers'
            - '/opt/bin/'
            - '/sbin' # Covers: '/opt/sbin', '/usr/local/sbin/', '/usr/sbin/'
            - '/usr/bin/'
            - '/usr/local/bin/'
    filter_main_mdadm.conf:
        Image|endswith: '/bin/sed'
        CommandLine|startswith:
            - 'sed -i /^*'
            - 'sed -ne s/^'
        CommandLine|endswith: '/etc/mdadm/mdadm.conf'
    condition: 1 of selection_img_* and selection_paths and not 1 of filter_main_*
falsepositives:
    - Some false positives are to be expected on user or administrator machines. Apply additional filters as needed.
level: medium

Stages and Predicates

Stage 0: condition

1 of selection_img_* and selection_paths and not 1 of filter_main_*

Stage 1: selection_img_1

selection_img_1:
    Image|endswith:
        - '/cat'
        - '/echo'
        - '/grep'
        - '/head'
        - '/more'
        - '/tail'
    CommandLine|contains: '>'

Stage 2: selection_img_2

selection_img_2:
    Image|endswith:
        - '/emacs'
        - '/nano'
        - '/sed'
        - '/vi'
        - '/vim'

Stage 3: selection_paths

selection_paths:
    CommandLine|contains:
        - '/bin/login'
        - '/bin/passwd'
        - '/boot/'
        - '/etc/*.conf'
        - '/etc/cron.'
        - '/etc/crontab'
        - '/etc/hosts'
        - '/etc/init.d'
        - '/etc/sudoers'
        - '/opt/bin/'
        - '/sbin'
        - '/usr/bin/'
        - '/usr/local/bin/'

Stage 4: not filter_main_mdadm.conf

or:
CommandLine|startswith: 'sed -i /^*'
CommandLine|startswith: 'sed -ne s/^'
CommandLine|endswith: '/etc/mdadm/mdadm.conf'
Image|endswith: '/bin/sed'

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
CommandLinestarts_withsed -i /^*
CommandLinestarts_withsed -ne s/^
CommandLineends_with/etc/mdadm/mdadm.conf
Imageends_with/bin/sed

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • /bin/login
  • /bin/passwd
  • /boot/
  • /etc/*.conf
  • /etc/cron.
  • /etc/crontab
  • /etc/hosts
  • /etc/init.d
  • /etc/sudoers
  • /opt/bin/
  • /sbin
  • /usr/bin/
  • /usr/local/bin/
  • >
Imageends_with
  • /cat
  • /echo
  • /emacs
  • /grep
  • /head
  • /more
  • /nano
  • /sed
  • /tail
  • /vi
  • /vim