Challenge 41: Block Rule Poisoning
Challenge 41: Block Rule Poisoning
| Difficulty: Medium | Category: IOCTL Abuse | Target: Block Rule Table |
Objective
Use the driver’s own IOCTL_ADD_BLOCK_RULE to inject a rule that blocks the EDR agent itself from restarting — weaponizing the kernel’s process-deny mechanism against the EDR.
Background
The MostShittyEDR driver maintains a kernel-level block rule table (up to 64 entries). When ProcessCallback fires for a new process, it checks every rule — if a rule matches the image name suffix and command-line substring, CreationStatus is set to STATUS_ACCESS_DENIED and the process never starts.
The IOCTL_ADD_BLOCK_RULE (0x222008) allows pushing new rules. Since the device has no access control, an attacker can push rules that block anything — including the EDR agent itself or critical system processes.
Weakness Exploited
- No authentication on
ADD_BLOCK_RULE: Any process can push block rules to the kernel - No rule validation: The driver doesn’t check if a rule would block its own agent or system-critical processes
- Rules survive agent death: After killing the agent (Challenge 40), poisoned rules remain in the kernel — the agent can never restart
- No duplicate detection: The same rule can be pushed 64 times, filling all slots
- Combined with
CLEAR_BLOCK_RULES: The attacker can first clear legitimate rules, then push malicious ones
Hints
- Open
\\.\MostShittyEDRand sendIOCTL_ADD_BLOCK_RULE(0x222008) - The input buffer is a
BLOCK_RULE_ENTRYstruct:{ ImageSuffix: WCHAR[260], CmdLineSubstr: WCHAR[512] } - Set
ImageSuffix = "edr_agent.exe"andCmdLineSubstr = ""(empty = wildcard) to block the agent - The kernel denies process creation at callback time — the agent binary never executes
- For maximum damage: first
IOCTL_CLEAR_BLOCK_RULESto remove legitimate rules, then push poisoned rules, thenIOCTL_KILL_PROCESSto kill the running agent - Bonus: push a rule with
ImageSuffix = ""andCmdLineSubstr = ""— both wildcards match everything, blocking ALL processes on the system (careful: this is a DoS)
Success Criteria
- A block rule targeting
edr_agent.exeis pushed to the kernel - After killing the agent, attempting to restart it fails with “Access Denied”
- The block persists until the driver is unloaded or
CLEAR_BLOCK_RULESis called
MostShittyEDR