hunting-evtx-with-chainsaw
Run Chainsaw against collected Windows EVTX files to hunt with the SigmaHQ rule corpus, built-in detection rules, and high-speed keyword/regex search, plus analyze shimcache, SRUM, and event-log gaps, outputting colorized tables, CSV, or JSON. Use during first-response triage for offline, SIEM-free detection over Windows event logs, or to quickly confirm a hunt hypothesis and produce reporting output.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- hunting-evtx-with-chainsaw
- tags
- [ "chainsaw", "threat-hunting", "evtx", "sigma", "windows-event-logs", "dfir", "detection", "shimcache" ]
- author
- mahipal
- domain
- cybersecurity
- license
- Apache-2.0
- version
- 1.0
- nist_csf
- [ "DE.AE-02" ]
- subdomain
- threat-hunting
- description
- Run Chainsaw against collected Windows EVTX files to hunt with the SigmaHQ rule corpus, built-in detection rules, and high-speed keyword/regex search, plus analyze shimcache, SRUM, and event-log gaps, outputting colorized tables, CSV, or JSON. Use during first-response triage for offline, SIEM-free detection over Windows event logs, or to quickly confirm a hunt hypothesis and produce reporting output.
- mitre_attack
- [ "T1059.001" ]
02 资源文件 4
- 许可证LICENSE11.0 KB
- 参考文档references/api-reference.md2.2 KB
- 参考文档references/standards.md1.7 KB
- 脚本scripts/agent.py4.7 KB
03 SKILL.md 正文
Hunting EVTX with Chainsaw
Overview
Chainsaw is a fast, Rust-based forensic artifact search and hunting tool from WithSecure Labs. It provides first-response capability to rapidly identify threats within Windows Event Logs (.evtx) and other artifacts. Chainsaw can hunt with the full SigmaHQ rule corpus (translating Sigma to its internal Tau engine), run its own built-in detection rules, perform high-speed keyword/regex search across logs, and analyse specialized artifacts such as the AppCompatCache (shimcache), SRUM database, and event-log gaps. Output can be a colorized table, CSV, or JSON for downstream tooling.
Chainsaw's strength is speed and flexibility during initial triage: an analyst can drop a folder of collected EVTX onto the tool and get back a prioritized set of detections in seconds, then pivot with targeted search queries to confirm a hypothesis. Unlike a SIEM, it needs no ingestion pipeline, runs as a single binary, and works fully offline against acquired evidence — ideal for the field or an air-gapped analysis VM. The --mapping file tells Chainsaw how Sigma fields translate to Windows event fields, which is what enables broad Sigma coverage over EVTX.
A common hunt outcome is detecting suspicious PowerShell — MITRE ATT&CK T1059.001 (Command and Scripting Interpreter: PowerShell) — by running Sigma rules against PowerShell operational logs (Event ID 4104 script-block logging) or searching for encoded-command patterns. This skill maps to NIST CSF DE.AE-02 (potentially adverse events are analyzed to better understand associated activities).
When to Use
- During first-response triage to rapidly hunt threats across collected Windows event logs.
- When you need offline Sigma-based detection over
.evtxwithout standing up a SIEM. - To run fast keyword/regex searches confirming or refuting a hunt hypothesis.
- To analyse shimcache, SRUM, or event-log time gaps for execution evidence and tampering.
- To produce CSV/JSON detection output for reporting or pipeline ingestion.
Prerequisites
- Chainsaw binary. Download a release from GitHub or build from source:
# Build from source (Rust toolchain required) git clone https://github.com/WithSecureLabs/chainsaw.git cd chainsaw && cargo build --release ./target/release/chainsaw --version # or: nix profile install github:WithSecureLabs/chainsaw - The Chainsaw repo ships
mappings/(Sigma field mappings) andrules/(Chainsaw rules). - A copy of the SigmaHQ rules for full Sigma coverage:
git clone https://github.com/SigmaHQ/sigma.git - Collected Windows
.evtxfiles (and registry hives likeSYSTEM/Amcache.hvefor shimcache analysis).
Objectives
- Hunt collected EVTX with Sigma rules using the correct mapping file.
- Filter detections by rule level, status, and kind to reduce noise.
- Search logs by keyword, regex, and Tau expression for targeted confirmation.
- Output detections as table, CSV, and JSON.
- Analyse shimcache (with Amcache timestamp pairing), SRUM, and event-log gaps.
MITRE ATT&CK Mapping
| Technique ID | Official Name | Why Chainsaw Detects It |
|---|---|---|
| T1059.001 | Command and Scripting Interpreter: PowerShell | Sigma rules over EID 4104/4103 and search flag malicious PowerShell |
| T1059.003 | Command and Scripting Interpreter: Windows Command Shell | Process-creation Sigma rules surface suspicious cmd usage |
| T1547.001 | Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder | Sigma rules over registry events flag persistence |
| T1053.005 | Scheduled Task/Job: Scheduled Task | Rules over EID 4698/106 detect task creation |
| T1070.006 | Indicator Removal: Timestomp | analyse gaps and shimcache analysis reveal tampering/time gaps |
| T1204.002 | User Execution: Malicious File | Shimcache analysis shows executed binaries |
Workflow
1. Hunt EVTX with Sigma rules
Run the SigmaHQ corpus against collected logs using the bundled mapping file. The mapping translates Sigma fields to EVTX fields.
chainsaw hunt ./collected_evtx \
-s ./sigma/rules \
--mapping ./mappings/sigma-event-logs-all.yml
2. Hunt with Chainsaw built-in rules plus Sigma
Combine Chainsaw's own rules (-r) with Sigma (-s) for broader coverage.
chainsaw hunt ./collected_evtx \
-r ./rules \
-s ./sigma/rules \
--mapping ./mappings/sigma-event-logs-all.yml
3. Filter to reduce noise
Limit results by Sigma rule level, status, and detection kind.
chainsaw hunt ./collected_evtx -s ./sigma/rules \
--mapping ./mappings/sigma-event-logs-all.yml \
--level high --status stable --kind evtx
4. Output to CSV and JSON
Write structured output for reporting and pipelines.
# JSON to stdout/file
chainsaw hunt ./collected_evtx -s ./sigma/rules \
--mapping ./mappings/sigma-event-logs-all.yml --json > detections.json
# CSV into a directory (one file per detection group)
chainsaw hunt ./collected_evtx -s ./sigma/rules \
--mapping ./mappings/sigma-event-logs-all.yml --csv --output ./csv_out
5. Targeted keyword and regex search
Confirm a hypothesis by searching raw events independent of rules.
# Case-insensitive keyword search
chainsaw search "mimikatz" -i ./collected_evtx
# Regex for base64-encoded PowerShell commands, as JSON
chainsaw search -e "-[Ee]nc(odedCommand)?\s+[A-Za-z0-9+/=]{20,}" ./collected_evtx --json
# Time-bounded search using a Tau expression
chainsaw search ./collected_evtx -t 'Event.System.EventID: =4624' \
--from "2026-06-01T00:00:00" --to "2026-06-20T00:00:00"
6. Analyse shimcache for execution evidence
Parse the AppCompatCache from the SYSTEM hive, pair it with Amcache timestamps, and pattern-match suspicious entries.
chainsaw analyse shimcache ./SYSTEM \
--regexfile ./shimcache_patterns.txt \
--amcache ./Amcache.hve --tspair \
--output ./shimcache_analysis.csv
7. Analyse SRUM and event-log gaps
Detect program/network usage and identify suspicious logging gaps (possible log clearing or timestomp).
# SRUM database analysis
chainsaw analyse srum --software ./SOFTWARE ./SRUDB.dat -o srum.json
# Event-log gaps that may indicate cleared/tampered logs
chainsaw analyse gaps ./collected_evtx --min-time-gap-minutes 30 --json
8. Dump and lint
Inspect raw artifact content and validate custom rules before a hunt.
chainsaw dump ./SOFTWARE --json --output dump.json
chainsaw lint -r ./rules --kind sigma
Tools and Resources
| Tool | Purpose | Source |
|---|---|---|
| Chainsaw | Fast EVTX/artifact hunting and search | https://github.com/WithSecureLabs/chainsaw |
| SigmaHQ rules | Community detection rules | https://github.com/SigmaHQ/sigma |
| Chainsaw mappings | Sigma-to-EVTX field mappings | https://github.com/WithSecureLabs/chainsaw/tree/master/mappings |
| Hayabusa | Alternative Sigma EVTX timeline tool | https://github.com/Yamato-Security/hayabusa |
| Timeline Explorer | Review CSV output | https://ericzimmerman.github.io/ |
Validation Criteria
- [ ] Chainsaw binary installed and
--versionconfirmed. - [ ] SigmaHQ rules and the correct mapping file available.
- [ ] Sigma hunt run against the collected EVTX directory.
- [ ] Chainsaw built-in rules combined with Sigma where appropriate.
- [ ] Detections filtered by level/status/kind to reduce noise.
- [ ] CSV and/or JSON output produced for reporting.
- [ ] Targeted keyword/regex/Tau searches run to confirm findings.
- [ ] Shimcache analysed with Amcache timestamp pairing.
- [ ] SRUM and event-log-gap analysis performed where artifacts exist.
- [ ] Findings (e.g., PowerShell T1059.001) documented for the hunt report.
04 同仓库更多 Skills
runpodctl
Runpod CLI for managing GPU/CPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send/receive). Use for terminal/CI/scripting, Hub browse/deploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.
runpod
Start here for any Runpod task — running GPU/CPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.
runpod-usage
How Runpod works and how to work it — pods vs serverless, GPU/VRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv/apt). Use to answer "how does X work", "which GPU", "how do I build a container", or "how do I stand up a workload on a pod". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.
runpod-templates
Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says "run <X> on a pod" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.
runpod-migrate
Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.
runpod-mcp
Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU/CPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.