Write Sigma rules and test them on real logs
HowDefend explains how to detect and prevent common attack techniques on Windows, teaches Sigma, the open format for detection rules, and tests rules on attack recordings and on the logs of a clean Windows machine. A rule is judged on two counts: did it catch the attack, and how many normal events did it flag.
How to defend against
One page per technique: what the attacker does, what it looks like in the logs, a detection rule with its measured result, what the rule misses and how to prevent it.
Lessons
Eight short lessons, from the parts of a rule to preparing it for a SIEM. Each ends with an exercise.
Challenges
One technique each, with every target event labelled and thousands of normal events to avoid.
- 1mshta running script codeSolved
- 2Encoded PowerShell commandsSolved
- 3Persistence through a Run keySolved
- 4Access to LSASS memorySolved
- 5Scheduled tasks that run a commandSolved
- 6Remote execution through services and WMISolved
- 7Copying the password hives and the AD databaseSolved
- 8Turning off event logging through the registrySolved
- 9Turning off logging from the command lineSolved
- 10Network connections from processes that should not have anySolved
How a rule is checked
- You write the rule in YAML, as you would for any Sigma tool.
- It runs in this browser on the events of the lesson or challenge: attack events and normal events from the same machines and from a clean Windows 10 client.
- The result lists the attack events it caught and missed, and every normal event it matched.
The evaluator supports a defined part of the Sigma specification and is compared with pySigma on every data set in the build. A rule that uses an unsupported feature is rejected with a message, not evaluated differently.