Skip to main content

Hiding or Destroying Command History

Anti-forensics
technique
Updated 19 November 2026

A subject deliberately clears, modifies, hides, or suppresses command history records to conceal commands executed during activities associated with an infringement. This may involve deleting existing command history files, clearing session histories, modifying shell configurations, or preventing command history from being recorded. Command history may contain evidence of file access, software execution, system configuration changes, data collection, or other activities relevant to an investigation. The subject may interfere with history mechanisms associated with command-line environments such as Bash, PowerShell, Zsh, or Python to prevent investigators from reconstructing the commands executed. These actions may hinder forensic examination by removing or reducing locally available command execution records. However, command activity may remain recoverable through independent system logs, endpoint telemetry, or other forensic artifacts.

1
Prevention Strategies
4
Detection Methods
0
Tactics
2
Contributors

Prevention Strategies (1)

No Ready System-Level Mitigation

This section cannot be readily mitigated at a system level with preventive controls since it is based on the abuse of fundamental features of the system.

From the Matrix:

This section cannot be readily mitigated at a system level with preventive controls since it is based on the abuse of fundamental features of the system....

Detection Methods (4)

.bash_history Timestamp Discrepency

The .bash_history file, located within a user's directory on MacOS and Linux, is written with command history from shell sessions.If the file has a Created timestamp, but a user has used a shell utility previously, this may indicate the file was deleted and manually or automatically re-created.

ConsoleHost_history.txt Created Timestamp Discrepancy

Recent modifications to the ConsoleHost_history.txt file located in C:\Users\%username%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine may indicate the file has been deleted and subsequently automatically recreated by the Operating System. This may represent an anti-forensics technique if the subject in question is known to have used PowerShell any time prior to the “Created” timestamp of the ConsoleHost_history.txt file.

ConsoleHost_history.txt File Missing

If the ConsoleHost_history.txt file located in C:\Users\%username%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine, is missing, this indicates that the file has been deleted. This may represent an anti-forensics technique if the subject in question is known to have used PowerShell any time.

Missing .bash_history File

The .bash_history file, located within a user's directory on MacOS and Linux, is written with command history from shell sessions.If the file is missing, this could indicate that it has been deleted, if a user account has used a shell utility previously.

Contributors

Forscie® Limited
The ITM Team

Our pillar mapping

Our own keyword match of each prevention and detection to the Insider Risk Index's five pillars. It is not part of the Forscie Matrix and not a measured value.

Visibility
Prevention & Coaching
Investigation & Evidence
2
Identity & SaaS
Phishing Resilience

Attribution

This technique is part of the Forscie® Insider Threat Matrix™. Copyright 2026 Forscie® Limited. Licensed under Apache License 2.0.

View on Forscie® Insider Threat Matrix™
Hiding or Destroying Command History | Insider Risk Index