Skip to content

Add a DFIR config and engagement kit, tested against real intrusions - #6

Merged
0xAnalyst merged 8 commits into
masterfrom
dfir-phase1
Nov 1, 2026
Merged

0xAnalyst merged 8 commits into
masterfrom
dfir-phase1

Conversation

@0xAnalyst

Copy link
Copy Markdown
Owner

Phase 1 of the incident-response version: the Windows config, its real-intrusion tests, and the scripts to deploy, collect and remove it during an engagement. See dfir/README.md for the playbook.

Config (dfir/windows-ir.xml)

The design comes from the 82 intrusions published by The DFIR Report (2020–2026):

  • Logs everything for process, network, DNS, driver, remote-thread, raw-disk, WMI, pipe, stream and tampering events. Beacons ran inside injected Windows processes in about 37% of intrusions.
  • Include lists for files, registry, DLL loads and deletes cover the drop folders, file types and keys the intrusions used. Every new executable is logged, whatever its extension.
  • Deleted tools from drop folders are kept in SysmonIRArchive (about 37% of attackers deleted theirs).
  • Few, narrow exclusions, all by full path. Binaries were renamed or disguised in about 60% of intrusions.
  • Clipboard capture and the blocking events are off.

Real-intrusion tests

dfir/tests/cases.json holds 71 events reconstructed from the reports: 65 behaviors that must be logged and 6 noise checks. webapp/scripts/check-cases.mjs runs them through the builder's rule engine.

Config Intrusion behaviors logged
dfir/windows-ir.xml 65/65
sysmonv9.xml (production) 32/65

The cases also cover look-alikes of the exclusions, such as a fake dllhost.exe under ProgramData\Microsoft and a Cobalt Strike pipe named like Chrome's mojo.*.

Validation and client overlays

  • lint-config.mjs --ir applies an incident-response profile: core events must log everything, name-only and user-writable exclusions are errors, and LSASS access must be logged.
  • apply-overlay.mjs merges a client's exclusion file and re-validates it. A bad overlay (for example excluding svchost.exe by name, or C:\Users\) is rejected.

Engagement scripts (Windows PowerShell 5.1)

  • Deploy-SysmonIR.ps1
    • Detects an existing Sysmon, standalone or built-in, and backs up its log and config.
    • Installs Sysmon or reconfigures the existing one.
    • Raises log sizes (never lowers them).
    • Enables the audit subcategories by GUID, so it works on any display language: 4624/4688 with command line, 4697, 4698, 4768/4769, 5140, 4662 and others. Also enables PowerShell script block logging.
    • Self-tests that events arrive. Safe to re-run.
  • Collect-SysmonIR.ps1: exported logs, deleted-file copies, deployment backups and host details, with a SHA256 manifest and a hashed zip.
  • Remove-SysmonIR.ps1: restores the original Sysmon config or uninstalls Sysmon, and restores log sizes, audit policy and registry values. It refuses to run before a collection exists.

CI

  • Unit job: runs the IR lint and the cases, and reports the production config's result in the job summary.
  • Windows job: applies the DFIR config and a merged example overlay to the real Sysmon.
  • New dfir-kit job: on Windows, deploys twice, checks the audit and log settings, generates harmless intrusion-like activity and checks each event, collects and checks the zip and archive, then removes everything and checks the restore.

Also:

  • The builder has a Windows DFIR preset.
  • Releases attach sysmon-dfir-kit.zip.
  • NOTICE.md credits The DFIR Report as a research reference. No report text is reproduced.

🤖 Generated with Claude Code

Ali Abdelgader and others added 8 commits November 1, 2026 09:14
- dfir/windows-ir.xml: incident-response Sysmon config designed from the 82
  intrusions published by The DFIR Report. Logs every process, network
  connection, DNS query, driver, pipe and remote thread; covers the drop
  folders, file types and registry keys the intrusions used; keeps copies of
  tools deleted from drop folders. Exclusions are narrow and full-path only.
- dfir/tests/cases.json: 71 events reconstructed from the reports (65 must be
  logged, 6 noise checks). check-cases.mjs runs them with the builder's rule
  engine; the DFIR config logs 65/65, the production config 32/65.
- Validator IR profile (lint-config --ir): core events must log everything,
  name-only and user-writable exclusions are errors, LSASS access required.
- apply-overlay.mjs merges per-client exclusions and re-validates.
- Deploy/Collect/Remove PowerShell scripts: back up and restore any existing
  Sysmon, log sizes and audit policy; self-test; hashed evidence zip.
- CI: IR lint and cases in the unit job, real Sysmon accepts the DFIR config
  and a merged overlay, and a new job runs the whole kit end to end on Windows
  PowerShell 5.1. Releases attach sysmon-dfir-kit.zip. Builder gets a DFIR preset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PS 5.1 turns redirected stderr from native programs into terminating errors
when ErrorActionPreference is Stop; Sysmon writes its banner to stderr.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e folder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ad of aborting

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rator is refused

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0xAnalyst
0xAnalyst merged commit 8985c82 into master Nov 1, 2026
8 checks passed
0xAnalyst added a commit that referenced this pull request Nov 1, 2026
Add a DFIR config and engagement kit, tested against real intrusions
@0xAnalyst
0xAnalyst deleted the dfir-phase1 branch November 1, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant