Hunting Evil with Sigma (Chainsaw Edition)
Scanning Windows Event Logs With Chainsaw
Example 1: Hunting for Multiple Failed Logins From Single Source With Sigma
PS C:\Tools\chainsaw> .\chainsaw_x86_64-pc-windows-msvc.exe hunt C:\Events\YARASigma\lab_events_2.evtx -s C:\Rules\sigma\win_security_susp_failed_logons_single_source2.yml --mapping .\mappings\sigma-event-logs-all.yml[+] 1 Detections found on 1 documentsExample 2: Hunting for Abnormal PowerShell Command Line Size With Sigma (Based on Event ID 4688)
title: Unusually Long PowerShell CommandLine
id: d0d28567-4b9a-45e2-8bbc-fb1b66a1f7f6
status: test
description: Detects unusually long PowerShell command lines with a length of 1000 characters or more
references:
- https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse
author: oscd.community, Natalia Shornikova / HTB Academy, Dimitrios Bougioukas
date: 2020/10/06
modified: 2023/04/14
tags:
- attack.execution
- attack.t1059.001
- detection.threat_hunting
logsource:
category: process_creation
product: windows
detection:
selection:
EventID: 4688
NewProcessName|endswith:
- '\powershell.exe'
- '\pwsh.exe'
- '\cmd.exe'
selection_powershell:
CommandLine|contains:
- 'powershell.exe'
- 'pwsh.exe'
selection_length:
CommandLine|re: '.{1000,}'
condition: selection and selection_powershell and selection_length
falsepositives:
- Unknown
level: lowApplying the Rule
Last updated