Suspicious Clear PowerShell History - PowerShell (via ps_script)

This rule detects keywords that could indicate clearing PowerShell history

SigmamediumWindowsv1
sigma
title: Suspicious Clear PowerShell History - PowerShell (via ps_script)
id: 63efd7fa-3c00-5189-8068-94d2d9c1df5c
status: stable
description: This rule detects keywords that could indicate clearing PowerShell history
references:
    - https://attack.mitre.org/techniques/T1070/003/
    - https://gist.github.com/hook-s3c/7363a856c3cdbadeb71085147f042c1a
author: Huntrule Team
date: 2026-04-09
tags:
    - attack.stealth
    - attack.t1070.003
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection1a:
        ScriptBlockText|contains:
            - 'del'
            - 'Remove-Item'
            - 'rm'
    selection1b:
        ScriptBlockText|contains: '(Get-PSReadlineOption).HistorySavePath'
    selection_2:
        ScriptBlockText|contains|all:
            - 'Set-PSReadlineOption'
            - '–HistorySaveStyle'
            - 'SaveNothing'
    selection_3:
        ScriptBlockText|contains|all:
            - 'Set-PSReadlineOption'
            - '-HistorySaveStyle'
            - 'SaveNothing'
    condition: 1 of selection_* or all of selection1*
falsepositives:
    - Unknown
level: medium

Known false positives

  • Unknown

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.