Skip to content

[Rule Tuning] Clearing Windows Console History #7232

Backlog

Description

@FilipPwn

Link to Rule

https://github.com/elastic/detection-rules/blob/main/rules/windows/defense_evasion_clearing_windows_console_history.toml

Rule Tuning Type

False Negatives - Enhancing detection of true threats that were previously missed.

Description

Cleaning history in PowerShell might be done in many ways.
Rule uses:

  • Clear-History
  • Remove-Item
  • Set-PSReadlineOption

In addition to above I would suggest add: Clear-Content cmdlet.

Example Data

{
  "@timestamp": "2026-11-17T15:22:17.633Z",
  "process.name": "powershell.exe",
  "process.pid": 2436,
  "process.entity_id": "3Ylppn4eFql4wzUEvQBwxw",
  "process.command_line": "powershell.exe  -command \"Clear-Content (Get-PSReadLineOption).HistorySavePath -Force\""
}
image

Proposed change

-  (process.args : ("*Remove-Item*", "rm") and
+  (process.args : ("*Remove-Item*", "rm", "*Clear-Content*", "clc") and
    process.args : ("*ConsoleHost_history.txt*", "*(Get-PSReadlineOption).HistorySavePath*")) or

Activity

  1. added
    Rule: Tuning
    on Nov 24, 2026
  2. changed the title [-][Rule Tuning] Name of rule[/-] [+][Rule Tuning] Clearing Windows Console History[/+] on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Rule: TuningTeam: TRADEcommunity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions