VeriKQL by Kaushik Saha

T1690 Prevent Command History Logging

Defense Impairmenton attack.mitre.org

ATT&CK Enterprise 20.0 · 20.1 released, update in review

How MITRE detects it

DET0563 Detection Strategy for Defense Impairment via Prevent Command History Logging across OS platforms.

AN1555 Linux

Detection of environment variable tampering (HISTFILE, HISTCONTROL, HISTFILESIZE) and absence of expected bash history writes. Correlation of unset or zeroed history variables with active shell sessions is indicative of adversarial evasion.

MITRE log sourceIn Microsoft Sentinel
auditd:SYSCALLexecve calls modifying HISTFILE or HISTCONTROL via unset/exportNot mapped to Sentinel yet.
linux:osqueryprocesses modifying environment variables related to history loggingNot mapped to Sentinel yet.

AN1556 macOS

Detection of bash/zsh history suppression via HISTFILE/HISTCONTROL manipulation and absence of ~/.bash_history updates. Observing environment variable changes tied to terminal processes is a strong indicator.

MITRE log sourceIn Microsoft Sentinel
macos:unifiedlogSet or unset HIST* variables in shell environmentNot mapped to Sentinel yet.

AN1557 Windows

Detection of PowerShell history suppression using Set-PSReadLineOption with SaveNothing or altered HistorySavePath. Correlating these options with PowerShell usage highlights adversarial evasion attempts.

MITRE log sourceIn Microsoft Sentinel
WinEventLog:PowerShellEventCode=4103, 4104, 4105, 4106
  • Windows event logs (Azure Monitor Agent) → Event
    Event | where EventLog in ("Microsoft-Windows-PowerShell/Operational", "Windows PowerShell") | where EventID in (4103, 4104, 4105, 4106)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Channel in ("Microsoft-Windows-PowerShell/Operational", "Windows PowerShell") | where EventID in (4103, 4104, 4105, 4106)
WinEventLog:SysmonEventCode=1
  • Windows event logs (Azure Monitor Agent) → Event
    Event | where Source == "Microsoft-Windows-Sysmon" | where EventID in (1)
  • Windows Forwarded Events → WindowsEvent
    WindowsEvent | where Provider == "Microsoft-Windows-Sysmon" | where EventID in (1)

Sysmon has no dedicated Sentinel connector: it is collected as a Windows event log into Event or WindowsEvent.

AN1558 ESXi

Detection of unset HISTFILE or modified history variables in ESXi shell sessions. Correlation of suspicious shell sessions with no recorded commands despite active usage.

MITRE log sourceIn Microsoft Sentinel
esxi:shellunset HISTFILE or HISTFILESIZE modificationsNot mapped to Sentinel yet.

AN1559 Network Devices

Detection of CLI commands that disable history logging such as 'no logging'. Anomalous lack of new commands in session logs while activity persists is a strong signal.

MITRE log sourceIn Microsoft Sentinel
networkdevice:cliCommands like 'no logging' or equivalents that disable session historyNot mapped to Sentinel yet.

Content Hub rules tagged with it (0)

No Content Hub rule is tagged with this technique.

Rules tagged with this technique (or a sub-technique) in their metadata. Whether one fits your connectors is the coverage view (M2).

In Sigma rules

1 SigmaHQ community rule name it or one of its sub-techniques in their tags.

Community rules, not Microsoft's, and not checked by VeriKQL (Sigma is not KQL). From SigmaHQ/sigma at f083329, under the Detection Rule License (DRL) 1.1; each rule is credited to its author.

Mitigations

MITRE ATT&CK® is a registered trademark of The MITRE Corporation. VeriKQL is not affiliated with or endorsed by MITRE. ATT&CK data © The MITRE Corporation, used under its terms of use.