Detection rules › Sigma

History File Deletion

Status
test
Severity
high
Log source
category process_creation, product linux
Author
Florian Roth (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects events in which a history file gets deleted, e.g. the ~/bash_history to remove traces of malicious activity

Known false positives

  • Legitimate administration activities

MITRE ATT&CK coverage

Telemetry coverage

PlatformRecord / event type
LinuxEvent ID 1: Process Create

Rule body

title: History File Deletion
id: 1182f3b3-e716-4efa-99ab-d2685d04360f
status: test
description: Detects events in which a history file gets deleted, e.g. the ~/bash_history to remove traces of malicious activity
references:
    - https://github.com/sleventyeleven/linuxprivchecker/
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1552.003/T1552.003.md
author: Florian Roth (Nextron Systems)
date: 2022-06-20
modified: 2022-09-15
tags:
    - attack.impact
    - attack.t1565.001
logsource:
    category: process_creation
    product: linux
detection:
    selection:
        Image|endswith:
            - '/rm'
            - '/unlink'
            - '/shred'
    selection_history:
        - CommandLine|contains:
              - '/.bash_history'
              - '/.zsh_history'
        - CommandLine|endswith:
              - '_history'
              - '.history'
              - 'zhistory'
    condition: all of selection*
falsepositives:
    - Legitimate administration activities
level: high

Stages and Predicates

Stage 0: condition

all of selection*

Stage 1: selection

selection:
    Image|endswith:
        - '/rm'
        - '/unlink'
        - '/shred'

Stage 2: selection_history

selection_history:
    - CommandLine|contains:
          - '/.bash_history'
          - '/.zsh_history'
    - CommandLine|endswith:
          - '_history'
          - '.history'
          - 'zhistory'

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLineends_with
  • .history
  • _history
  • zhistory
field:"CommandLine" kind:ends_with
CommandLinematch
  • /.bash_history
  • /.zsh_history
field:"CommandLine" kind:match
Imageends_with
  • /rm
  • /shred
  • /unlink
field:"Image" kind:ends_with