-
Notifications
You must be signed in to change notification settings - Fork 692
[New] Potential Evasion via Boot Time Removal Tool #6690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2c6abc6
Update and rename rules_building_block/defense_evasion_masquerading_w…
Samirbous b2e2ec5
Update defense_evasion_masquerading_windows_dll.toml
Samirbous 3cba5c2
Apply suggestion from @w0rk3r
w0rk3r 799ef74
Update defense_evasion_masquerading_windows_dll.toml
Samirbous 0b8c2e4
Update defense_evasion_masquerading_windows_dll.toml
Samirbous 52f7c43
Merge branch 'main' into Samirbous-patch-4
Samirbous 04c9c1c
Fix TOML parse error in masquerading Windows DLL rule note
Samirbous b9f16c8
Update command_and_control_dns_tunneling_nslookup.toml
Samirbous bffddbf
Update command_and_control_dns_tunneling_nslookup.toml
Samirbous 34e3605
Create exfiltration_dns_excessive_chunked_queries.toml
Samirbous c1f1731
Merge branch 'Samirbous-patch-4' of https://github.com/elastic/detect…
Samirbous 18f2c93
[New] Potential Evasion via Boot Time Removal Tool
Samirbous 55f990e
Delete rules/windows/exfiltration_dns_excessive_chunked_queries.toml
Samirbous 8698d48
Update command_and_control_dns_tunneling_nslookup.toml
Samirbous 77e454a
Update command_and_control_dns_tunneling_nslookup.toml
Samirbous c50e228
Update defense_evasion_boot_time_removal_tool.toml
Samirbous 464821f
Update rules/windows/defense_evasion_boot_time_removal_tool.toml
Samirbous d7a75ca
Merge branch 'main' into BRT
Samirbous File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
210 changes: 210 additions & 0 deletions
210
rules/windows/defense_evasion_boot_time_removal_tool.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,210 @@ | ||||||||
| [metadata] | ||||||||
| creation_date = "2026/08/21" | ||||||||
| integration = ["endpoint"] | ||||||||
| maturity = "production" | ||||||||
| updated_date = "2026/08/21" | ||||||||
|
|
||||||||
| [rule] | ||||||||
| author = ["Elastic"] | ||||||||
| description = """ | ||||||||
| Identifies creation of a `:changelist` NTFS alternate data stream or a Windows service Args registry value pointing to | ||||||||
| a `:changelist` path. Microsoft Defender's Boot-Time Removal (BTR.sys) driver reads an RC4-encrypted transaction blob | ||||||||
| from a driver ADS named `:changelist`, referenced by HKLM\\SYSTEM\\*ControlSet*\\Services\\*\\Args. Adversaries can | ||||||||
| reproduce this staging outside Defender to abuse BTR.sys as a signed kernel primitive for arbitrary file and registry | ||||||||
| operations. This rule focuses on non-System writers and excludes Microsoft-signed MRT.exe running as SYSTEM, which may | ||||||||
| perform related remediation staging. | ||||||||
| """ | ||||||||
| from = "now-9m" | ||||||||
| language = "esql" | ||||||||
| license = "Elastic License v2" | ||||||||
| name = "Potential Evasion via Boot Time Removal Tool" | ||||||||
| note = """## Triage and analysis | ||||||||
|
|
||||||||
| ### Investigating Potential Evasion via Boot Time Removal Tool | ||||||||
|
|
||||||||
| Windows Defender's Boot-Time Removal driver (`BTR.sys`) is instructed via an encrypted configuration stored in an | ||||||||
| Alternate Data Stream named `:changelist` on a `.sys` image. The service `Args` value under | ||||||||
| `HKLM\\SYSTEM\\*ControlSet*\\Services\\<name>\\Args` points at that ADS path. Check Point Research (BTR Reforged) | ||||||||
| showed that the same staging can be performed by non-Defender tooling (for example BTR_CLI) to drive Ring-0 file and | ||||||||
| registry actions, including neutralization of security products during early boot. | ||||||||
|
|
||||||||
| #### Possible investigation steps | ||||||||
|
|
||||||||
| - Identify whether the alert is a file ADS creation or a service `Args` registry write using `event.category`, | ||||||||
| `file.name` / `file.path`, and `registry.path` / `registry.data.strings`. | ||||||||
| - Review `process.executable`, `process.name`, `process.pid`, `process.parent.executable`, and `user.id` to determine | ||||||||
| whether a Defender component, MRT, or an unexpected user-mode binary staged the `:changelist` artifact. | ||||||||
| - For file events, inspect the base `.sys` path (strip `:changelist`), size, hash, and code signature. Confirm whether | ||||||||
| the driver was recently dropped under a user-writable path (Downloads, Temp, Desktop) versus a Defender-managed path. | ||||||||
| - For registry events, note the service key name under `Services\\*` and check sibling values (`ImagePath`, `Type`, | ||||||||
| `Group`). Abuse tooling often sets `Group` to `Boot Bus Extender` and may create the service via direct registry | ||||||||
| writes / `NtLoadDriver` without a corresponding SCM service-install event (7045). | ||||||||
| - Hunt on the same `host.id` for related activity: creation of `*.sys:*.dat` feedback ADS, load of a Microsoft-signed | ||||||||
| driver matching BTR, creation/deletion of `\\\\SystemRoot\\\\Temp\\\\BootClean.log` by PID 4, and deletions of security | ||||||||
| binaries attributed to System. | ||||||||
| - Correlate with other alerts for the same `user.id` and `host.id` in the prior 48 hours for privilege escalation, | ||||||||
| driver load, or Defender tampering. | ||||||||
|
|
||||||||
| ### False positive analysis | ||||||||
|
|
||||||||
| - Legitimate Defender or MRT reboot remediation may create `:changelist` ADS and related service Args values. This rule | ||||||||
| excludes PID 4 and Microsoft-signed `MRT.exe` as SYSTEM; unsigned or differently signed `MRT.exe` still alerts. Rare | ||||||||
| Defender paths (for example `MsMpEng.exe`) may still match and should be validated before exceptioning. | ||||||||
| - Security research labs intentionally exercising BTR_CLI or similar PoCs will generate true-positive-looking events; | ||||||||
| confirm host cohort and change windows. | ||||||||
|
|
||||||||
| ### Response and remediation | ||||||||
|
|
||||||||
| - If activity is unexplained: isolate the host, preserve the `.sys` file and `:changelist` stream, export the service | ||||||||
| registry key, and capture the staging process tree before cleanup. | ||||||||
| - Search the estate for the same `file.name` / ADS pattern, service `Args` values containing `:changelist`, and related | ||||||||
| driver hashes. | ||||||||
| - Remove unauthorized service keys and staged drivers, restore any deleted security components from known-good media, | ||||||||
| and rotate credentials for accounts that held `SeLoadDriverPrivilege` on the host. | ||||||||
| - Restrict and monitor assignment/use of `SeLoadDriverPrivilege`; treat signed remediation drivers as LOLDrivers that | ||||||||
| require lineage and ADS context monitoring, not signature blocking alone. | ||||||||
| """ | ||||||||
|
|
||||||||
| setup = """## Setup | ||||||||
|
|
||||||||
| This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules. | ||||||||
|
|
||||||||
| Setup instructions: https://ela.st/install-elastic-defend | ||||||||
| """ | ||||||||
|
|
||||||||
| references = [ | ||||||||
| "https://research.checkpoint.com/2026/btr-reforged-weaponizing-defenders-remediation-driver-as-a-kernel-operation-primitive/", | ||||||||
| "https://github.com/Dump-GUY/BTR_CLI", | ||||||||
| ] | ||||||||
| risk_score = 73 | ||||||||
| rule_id = "942c8f59-f01c-4dc0-a05f-2f5bba836ad8" | ||||||||
| severity = "high" | ||||||||
| tags = [ | ||||||||
| "Domain: Endpoint", | ||||||||
| "OS: Windows", | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @terrancedejesus why do we need to tags that say same thing? |
||||||||
| "Use Case: Threat Detection", | ||||||||
| "Tactic: Defense Evasion", | ||||||||
| "Tactic: Persistence", | ||||||||
| "Resources: Investigation Guide", | ||||||||
| "Data Source: Elastic Defend", | ||||||||
| ] | ||||||||
| timestamp_override = "event.ingested" | ||||||||
| type = "esql" | ||||||||
|
|
||||||||
| query = ''' | ||||||||
| from logs-endpoint.events.file-*, logs-endpoint.events.registry-* metadata _id, _version, _index | ||||||||
| | where host.os.type == "windows" | ||||||||
| and process.pid != 4 | ||||||||
| and not ( | ||||||||
| user.id == "S-1-5-18" | ||||||||
| and to_lower(process.executable) like """?:\\windows\\system32\\mrt.exe""" | ||||||||
| and process.code_signature.subject_name in ("Microsoft Windows", "Microsoft Corporation") | ||||||||
| ) | ||||||||
|
Samirbous marked this conversation as resolved.
Outdated
|
||||||||
| and ( | ||||||||
| ( | ||||||||
| event.category == "file" | ||||||||
| and event.type == "creation" | ||||||||
| and ends_with(to_lower(file.name), ":changelist") | ||||||||
|
Samirbous marked this conversation as resolved.
|
||||||||
| ) | ||||||||
| or ( | ||||||||
| event.category == "registry" | ||||||||
| and event.type == "change" | ||||||||
| and to_lower(registry.path) like """*\\system\\*controlset*\\services\\*\\args""" | ||||||||
| and to_lower(registry.data.strings) like "*:changelist" | ||||||||
| ) | ||||||||
| ) | ||||||||
| | keep | ||||||||
| @timestamp, | ||||||||
| host.id, | ||||||||
| host.name, | ||||||||
| user.id, | ||||||||
| user.name, | ||||||||
| process.pid, | ||||||||
| process.name, | ||||||||
| process.executable, | ||||||||
| process.code_signature.subject_name, | ||||||||
| event.category, | ||||||||
| event.type, | ||||||||
| file.path, | ||||||||
| file.name, | ||||||||
| file.size, | ||||||||
| registry.path, | ||||||||
| registry.value, | ||||||||
| registry.data.strings, | ||||||||
| data_stream.namespace, | ||||||||
| _id, | ||||||||
| _version, | ||||||||
| _index | ||||||||
| | limit 100 | ||||||||
| ''' | ||||||||
|
|
||||||||
| [rule.investigation_fields] | ||||||||
| field_names = [ | ||||||||
| "@timestamp", | ||||||||
| "host.id", | ||||||||
| "host.name", | ||||||||
| "user.id", | ||||||||
| "user.name", | ||||||||
| "process.pid", | ||||||||
| "process.name", | ||||||||
| "process.executable", | ||||||||
| "process.code_signature.subject_name", | ||||||||
| "event.category", | ||||||||
| "file.path", | ||||||||
| "file.name", | ||||||||
| "file.size", | ||||||||
| "registry.path", | ||||||||
| "registry.value", | ||||||||
| "registry.data.strings", | ||||||||
| ] | ||||||||
|
|
||||||||
| [[rule.threat]] | ||||||||
| framework = "MITRE ATT&CK" | ||||||||
|
|
||||||||
| [[rule.threat.technique]] | ||||||||
| id = "T1564" | ||||||||
| name = "Hide Artifacts" | ||||||||
| reference = "https://attack.mitre.org/techniques/T1564/" | ||||||||
|
|
||||||||
| [[rule.threat.technique.subtechnique]] | ||||||||
| id = "T1564.004" | ||||||||
| name = "NTFS File Attributes" | ||||||||
| reference = "https://attack.mitre.org/techniques/T1564/004/" | ||||||||
|
|
||||||||
| [[rule.threat.technique]] | ||||||||
| id = "T1112" | ||||||||
| name = "Modify Registry" | ||||||||
| reference = "https://attack.mitre.org/techniques/T1112/" | ||||||||
|
|
||||||||
| [[rule.threat.technique]] | ||||||||
| id = "T1562" | ||||||||
| name = "Impair Defenses" | ||||||||
| reference = "https://attack.mitre.org/techniques/T1562/" | ||||||||
|
|
||||||||
| [[rule.threat.technique.subtechnique]] | ||||||||
| id = "T1562.001" | ||||||||
| name = "Disable or Modify Tools" | ||||||||
| reference = "https://attack.mitre.org/techniques/T1562/001/" | ||||||||
|
|
||||||||
| [rule.threat.tactic] | ||||||||
| id = "TA0005" | ||||||||
| name = "Defense Evasion" | ||||||||
| reference = "https://attack.mitre.org/tactics/TA0005/" | ||||||||
|
|
||||||||
| [[rule.threat]] | ||||||||
| framework = "MITRE ATT&CK" | ||||||||
|
|
||||||||
| [[rule.threat.technique]] | ||||||||
| id = "T1543" | ||||||||
| name = "Create or Modify System Process" | ||||||||
| reference = "https://attack.mitre.org/techniques/T1543/" | ||||||||
|
|
||||||||
| [[rule.threat.technique.subtechnique]] | ||||||||
| id = "T1543.003" | ||||||||
| name = "Windows Service" | ||||||||
| reference = "https://attack.mitre.org/techniques/T1543/003/" | ||||||||
|
|
||||||||
| [rule.threat.tactic] | ||||||||
| id = "TA0003" | ||||||||
| name = "Persistence" | ||||||||
| reference = "https://attack.mitre.org/tactics/TA0003/" | ||||||||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.