Detection rules › Sigma

Print History File Contents

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

Detects events in which someone prints the contents of history files to the commandline or redirects it to a file for reconnaissance

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Print History File Contents
id: d7821ff1-4527-4e33-9f84-d0d57fa2fb66
status: test
description: Detects events in which someone prints the contents of history files to the commandline or redirects it to a file for reconnaissance
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.reconnaissance
    - attack.t1592.004
logsource:
    category: process_creation
    product: linux
detection:
    selection:
        Image|endswith:
            - '/cat'
            - '/head'
            - '/tail'
            - '/more'
    selection_history:
        - CommandLine|contains:
              - '/.bash_history'
              - '/.zsh_history'
        - CommandLine|endswith:
              - '_history'
              - '.history'
              - 'zhistory'
    condition: all of selection*
falsepositives:
    - Legitimate administration activities
level: medium

Stages and Predicates

Stage 0: condition

all of selection*

Stage 1: selection

selection:
    Image|endswith:
        - '/cat'
        - '/head'
        - '/tail'
        - '/more'

Stage 2: selection_history

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

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
CommandLineends_with
  • .history
  • _history
  • zhistory
CommandLinematch
  • /.bash_history
  • /.zsh_history
Imageends_with
  • /cat
  • /head
  • /more
  • /tail