Skip to main content

PYTHONHISTORY Environment Variable Null

Anti-forensics
technique
Updated 14 July 2025

A subject modifies the PYTHONHISTORY system environment variable used to designate the .python_history file location to equal /dev/null, resulting in it not being written to disk, denying access to this artifact for investigators. This can be achieved on a per-session basis using the command PYTHONHISTORY=/dev/null python, or permanently by modifying a shell configuration file (such as ~/.bashrc or ~/.zshrc) to include the line export PYTHONHISTORY=/dev/null.

0
Prevention Strategies
0
Detection Methods
0
Tactics
2
Contributors

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
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™
PYTHONHISTORY Environment Variable Null | Insider Risk Index