Linux Shell History File Deletion via rm/unlink/shred
Alert on Linux command-line history file deletions using rm/unlink/shred targeting bash/zsh history files.
- Product
- linux
- Category
- process_creation
- Author
- Florian Roth (Nextron Systems) (SigmaHQ), DRL 1.1
- Published
- 2022-06-20
- Updated
- 2026-07-31
ATT&CK techniques
ImpactRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
What it detects
This rule flags process creation events where the executed command name ends with rm, unlink, or shred and the command line targets shell history files such as .bash_history or .zsh_history. Attackers may delete these files to remove traces of prior commands and reduce forensic visibility. It relies on Linux process creation telemetry that includes the image path and full command line.
Reporting behind it
- github.comhttps://github.com/sleventyeleven/linuxprivchecker/
- github.comhttps://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1552.003/T1552.003.md
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/linux/process_creation/proc_creation_lnx_susp_history_delete.yml
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: Linux Shell History File Deletion via rm/unlink/shred
id: d30cdc34-ef14-4899-83ea-07813099b5b9
status: test
description: This rule flags process creation events where the executed command name ends with rm, unlink, or shred and the command line targets shell history files such as .bash_history or .zsh_history. Attackers may delete these files to remove traces of prior commands and reduce forensic visibility. It relies on Linux process creation telemetry that includes the image path and full command line.
references:
- https://github.com/sleventyeleven/linuxprivchecker/
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1552.003/T1552.003.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/linux/process_creation/proc_creation_lnx_susp_history_delete.yml
author: Florian Roth (Nextron Systems), Huntrule Team
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
license: DRL-1.1
related:
- id: 1182f3b3-e716-4efa-99ab-d2685d04360f
type: derived