History tampering

Severity mediumLinuxSingle eventstablelinux.defense_evasion.history_tampering · v1.0.0

What it detects

Shell history cleared or diverted to hide activity — history -c, unsetting HISTFILE, or symlinking a history file to /dev/null.

MITRE ATT&CK mapping

  • T1070.003Indicator Removal: Clear Command History· Defense Evasion

False positives and triage

Rarely legitimate. Some dotfile managers set HISTFILE; confirm the actor and context (an interactive session clearing history mid-incident is suspicious).

The rule

Declarative YAML read by the detection engine — data, never executed. Confidence 70%. Source: rules/linux/history_tampering.yaml, licensed under the Apache License 2.0.

id: linux.defense_evasion.history_tampering
version: 1.0.0
status: stable
severity: medium
confidence: 0.7
platforms: [linux]
mitre_techniques: [T1070.003]
description: |
  Shell history cleared or diverted to hide activity — `history -c`, unsetting
  HISTFILE, or symlinking a history file to /dev/null.
match:
  command_line_regex: '(?i)history\s+-c\b|unset\s+HISTFILE\b|export\s+HISTFILE=/dev/null|ln\s+-s[a-z]*\s+/dev/null\s+.*\.(bash|zsh)_history'
false_positive_guidance: |
  Rarely legitimate. Some dotfile managers set HISTFILE; confirm the actor and
  context (an interactive session clearing history mid-incident is suspicious).

Related detections

Run this rule on your own logs — offline

KIROSEC runs this rule and the rest of the library over Windows, Linux, macOS and cloud audit logs on the analyst's own machine. Every alert links to the events that raised it, and nothing leaves the device.

Browse all detections