{"id":"bde47d4b-9987-405c-94c7-b080410e8ea7","title":"Clearing Windows Console History","description":"Identifies when a user attempts to clear console history. An adversary may clear the command history of a compromised account to conceal the actions undertaken during an intrusion.","author":"Austin Songer @austinsonger","status":"test","level":"high","date":"2021-11-25","modified":"2022-12-25","tags":["attack.stealth","attack.t1070","attack.t1070.003"],"technique_ids":["T1070","T1070.003"],"logsource":{"product":"windows","category":"ps_script","definition":"Requirements: Script Block Logging must be enabled"},"falsepositives":["Unknown"],"references":["https://stefanos.cloud/blog/kb/how-to-clear-the-powershell-command-history/","https://www.shellhacks.com/clear-history-powershell/","https://community.sophos.com/sophos-labs/b/blog/posts/powershell-command-history-forensics"],"source_path":"rules/windows/powershell/powershell_script/posh_ps_clearing_windows_console_history.yml","source_sha256":"72e0d93f04e2fa34548e82011d6927f272786cbe9d31dae0f603665f8651e25c","source_url":"https://github.com/anpa1200/sigma/blob/b249e9683190cffdcaf188ccbfb90bf4759844e1/rules/windows/powershell/powershell_script/posh_ps_clearing_windows_console_history.yml","license":"Detection Rule License 1.1","license_url":"https://github.com/SigmaHQ/Detection-Rule-License/blob/main/LICENSE.Detection.Rules.md","yaml":"title: Clearing Windows Console History\nid: bde47d4b-9987-405c-94c7-b080410e8ea7\nstatus: test\ndescription: Identifies when a user attempts to clear console history. An adversary may clear the command history of a compromised account to conceal the actions undertaken during an intrusion.\nreferences:\n    - https://stefanos.cloud/blog/kb/how-to-clear-the-powershell-command-history/\n    - https://www.shellhacks.com/clear-history-powershell/\n    - https://community.sophos.com/sophos-labs/b/blog/posts/powershell-command-history-forensics\nauthor: Austin Songer @austinsonger\ndate: 2021-11-25\nmodified: 2022-12-25\ntags:\n    - attack.stealth\n    - attack.t1070\n    - attack.t1070.003\nlogsource:\n    product: windows\n    category: ps_script\n    definition: 'Requirements: Script Block Logging must be enabled'\ndetection:\n    selection1:\n        ScriptBlockText|contains: Clear-History\n    selection2a:\n        ScriptBlockText|contains:\n            - Remove-Item\n            - rm\n    selection2b:\n        ScriptBlockText|contains:\n            - ConsoleHost_history.txt\n            - (Get-PSReadlineOption).HistorySavePath\n    condition: selection1 or selection2a and selection2b\nfalsepositives:\n    - Unknown\nlevel: high\n","validation":"yaml_parsed_not_backend_compiled_or_live_validated","techniques":[{"key":"enterprise/T1070","id":"T1070","name":"Indicator Removal","page":"techniques/enterprise/T1070/"},{"key":"enterprise/T1070.003","id":"T1070.003","name":"Clear Command History","page":"techniques/enterprise/T1070.003/"}],"data_path":"data/detection-rules/bde47d4b-9987-405c-94c7-b080410e8ea7.json","kind":"sigma"}
