Shell History Clearing via Environment Variables
This rule detects the clearing of the shell history via environment variables. Attackers may clear the shell history to hide their activities from being tracked. By leveraging environment variables such as HISTSIZE,…
Description
This rule detects the clearing of the shell history via environment variables. Attackers may clear the shell history to hide their activities from being tracked. By leveraging environment variables such as HISTSIZE, HISTFILESIZE, HISTCONTROL, and HISTFILE, attackers can clear the shell history by setting them to 0, ignoring spaces, or redirecting the history to /dev/null, effectively erasing the command history.
Detection logic
Its licence does not clear it for publishing here
Sunturai publishes a detection's own text where the licence it arrived under has been reviewed and permits it, and Elastic License 2.0 has not. The query as its source wrote it, its canonical form and the hash that pins this revision are in the workspace record.
Detection requirements
- Platform
- ContainersESXiLinuxmacOSNetwork DevicesOffice SuiteWindows
The rule states no platform. This is derived from the ATT&CK technique it maps to.
- Log source category
- event_index
MITRE ATT&CK mappings
0 exclusive techniques.This is coverage no other published rule has; it is not this rule's total technique count.
References
| Reference | Cited by |
|---|---|
| www.rapid7.com/blog/post/tr-new-whitepaper-stealthy-bpfdoor-variants/ | 2 |
From the source
- At source
- Open at source
- Upstream identifier
- a68da7d6-7eab-45bd-97c5-93b469c0706e
- Tagged by the source as
- Data Source: Elastic DefendDomain: EndpointNoise: UnknownOS: LinuxPerformance: NormalPlatform: LinuxResources: Investigation GuideRule Type: Event Correlation (EQL)Tactic: Defense EvasionUse Case: Threat Detection
Licence
- Published under
- Elastic License 2.0Read the licence
- Attribution
- Required
Authorship
- Written by
- Published
- Sep 20, 2026
- Version
- 3