Detection rules › Sigma

Linux Package Uninstall

Status
test
Severity
low
Log source
product linux, category process_creation
Author
Tuan Le (NCSGroup), Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects linux package removal using builtin tools such as "yum", "apt", "apt-get" or "dpkg".

MITRE ATT&CK coverage

TacticTechniques
StealthT1070 Indicator Removal

Event coverage

Rule body yaml

title: Linux Package Uninstall
id: 95d61234-7f56-465c-6f2d-b562c6fedbc4
status: test
description: Detects linux package removal using builtin tools such as "yum", "apt", "apt-get" or "dpkg".
references:
    - https://sysdig.com/blog/mitre-defense-evasion-falco
    - https://www.tutorialspoint.com/how-to-install-a-software-on-linux-using-yum-command
    - https://linuxhint.com/uninstall_yum_package/
    - https://linuxhint.com/uninstall-debian-packages/
author: Tuan Le (NCSGroup), Nasreddine Bencherchali (Nextron Systems)
date: 2023-03-09
tags:
    - attack.stealth
    - attack.t1070
logsource:
    product: linux
    category: process_creation
detection:
    selection_yum:
        Image|endswith: '/yum'
        CommandLine|contains:
            - 'erase'
            - 'remove'
    selection_apt:
        Image|endswith:
            - '/apt'
            - '/apt-get'
        CommandLine|contains:
            - 'remove'
            - 'purge'
    selection_dpkg:
        Image|endswith: '/dpkg'
        CommandLine|contains:
            - '--remove '
            - ' -r '
    selection_rpm:
        Image|endswith: '/rpm'
        CommandLine|contains: ' -e '
    condition: 1 of selection_*
falsepositives:
    - Administrator or administrator scripts might delete packages for several reasons (debugging, troubleshooting).
level: low

Stages and Predicates

Stage 0: condition

1 of selection_*

Stage 1: selection_yum

selection_yum:
    Image|endswith: '/yum'
    CommandLine|contains:
        - 'erase'
        - 'remove'

Stage 2: selection_apt

selection_apt:
    Image|endswith:
        - '/apt'
        - '/apt-get'
    CommandLine|contains:
        - 'remove'
        - 'purge'

Stage 3: selection_dpkg

selection_dpkg:
    Image|endswith: '/dpkg'
    CommandLine|contains:
        - '--remove '
        - ' -r '

Stage 4: selection_rpm

selection_rpm:
    Image|endswith: '/rpm'
    CommandLine|contains: ' -e '

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
  • -e
  • -r
  • --remove
  • erase
  • purge
  • remove
Imageends_with
  • /apt
  • /apt-get
  • /dpkg
  • /rpm
  • /yum