-
Notifications
You must be signed in to change notification settings - Fork 451
detection Lateral Movement via BitLocker COM Hijacking #3801
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
Draft
AAtashGar
wants to merge
20
commits into
splunk:develop
Choose a base branch
from
AAtashGar:rule/bitlocker
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+169
−0
Draft
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
4de4fdf
detection(experimental): Lateral Movement via BitLocker COM Hijacking…
AAtashGar 1439e50
Rule status changed from experimental to Production.
AAtashGar 2605c64
Merge branch 'develop' into rule/bitlocker
patel-bhavin 95bbfa4
Update lateral_movement_via_bitlocker_com_hijacking.yml and fix status
AAtashGar 3fdda4e
2 drilldown_searches added
AAtashGar 8553887
Merge branch 'develop' into rule/bitlocker
patel-bhavin a2b6ad4
Merge branch 'develop' into rule/bitlocker
patel-bhavin c75c510
Delete macro filter file
AAtashGar f6ffe69
Modify author and type in lateral movement detection
AAtashGar 522c9f1
Enhance BitLocker COM Hijacking detection story
AAtashGar d53026d
Refactor lateral movement detection for BitLocker COM hijacking
AAtashGar 6e8d570
Delete stories/bitlocker_com_hijacking_lateral_movement.yml
AAtashGar 229a6cb
Merge branch 'develop' into rule/bitlocker
patel-bhavin 9bd7ce6
YAML parsing error fixed
AAtashGar 63c4d7a
fix: Validation Issues
AAtashGar 0a133b7
fix tests section
AAtashGar fd52328
Merge branch 'develop' into rule/bitlocker
patel-bhavin a77da35
Merge branch 'develop' into rule/bitlocker
nasbench 5a55867
Merge branch 'develop' into rule/bitlocker
patel-bhavin 16b2f3b
Merge branch 'develop' into rule/bitlocker
patel-bhavin 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
There are no files selected for viewing
169 changes: 169 additions & 0 deletions
169
detections/endpoint/lateral_movement_via_bitlocker_com_hijacking.yml
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,169 @@ | ||
| name: Lateral Movement via BitLocker COM Hijacking | ||
| id: 990d5907-c022-4358-9ada-f6e5e69514e8 | ||
| version: 1 | ||
| date: '2025-09-28' | ||
| author: Ali Atashgar (AAtashGar), Github Community | ||
| status: production | ||
| description: |- | ||
| This detection identifies potential lateral movement activities | ||
| using BitLocker COM hijacking techniques. It monitors for changes | ||
| to the Remote Registry service, new registry values in CLSID paths, | ||
| handle operations on CLSIDs, and executions of specific processes like | ||
| baaupdate.exe and BdeUISrv.exe. These events are correlated by host to | ||
| detect sequences indicative of this attack vector. | ||
| type: TTP | ||
| references: | ||
| - https://medium.com/@seripallychetan/bitlocker-com-hijack-a-new-frontier-in-lateral-movement-tactics-ac5039b18dc6 | ||
| - https://ipurple.team/2025/08/04/lateral-movement-bitlocker/ | ||
| search: | | ||
| (`wineventlog_security`) OR (`wineventlog_system`) \ | ||
| ((EventCode=7040 AND Service_Name="Remote Registry" AND \ | ||
| Message="The start type of the Remote Registry service was changed*") \ | ||
| OR (EventCode=4657 AND OperationType="New registry value created" AND \ | ||
| ObjectName="*A7A63E5C-3877-4840-8727-C1EA9D7A4D50*") \ | ||
| OR (EventCode=4663 AND ObjectName="*A7A63E5C-3877-4840-8727-C1EA9D7A4D50*") \ | ||
| OR (EventCode=4688 AND ((NewProcessName="baaupdate.exe" AND \ | ||
| ParentProcessName="explorer.exe") OR (NewProcessName="BdeUISrv.exe" AND \ | ||
| ParentProcessName="svchost.exe")))) | ||
|
|
||
| | eval Service_Change_Time=if(EventCode=7040, _time, null) | ||
| | eval Registry_Change_Time=if(EventCode=4657, _time, null) | ||
| | eval Handle_Creation_Time=if(EventCode=4663, _time, null) | ||
| | eval Process_Execution_Time=if(EventCode=4688, _time, null) | ||
| | eval Service_Message=if(EventCode=7040, Message, null) | ||
| | eval Process_Accessing_Registry=if(EventCode=4663, ProcessName, null) | ||
| | bin _time span=10m | ||
| | stats | ||
| values(Service_Change_Time) AS Service_Change_Time | ||
| values(Service_Message) AS Service_Message | ||
| values(Registry_Change_Time) AS Registry_Change_Time | ||
| values(ObjectName) AS CLSID_PATH | ||
| values(NewValue) AS Registry_value | ||
| values(NewValueType) AS Registry_Value_Type | ||
| values(Handle_Creation_Time) AS Handle_Creation_Time | ||
| values(Process_Accessing_Registry) AS Process_Accessing_Registry | ||
| values(Process_Execution_Time) AS Process_Execution_Time | ||
| values(ProcessId) AS ParentProcessId | ||
| values(ParentProcessName) AS ParentProcessName | ||
| values(NewProcessId) AS NewProcessId | ||
| values(NewProcessName) AS NewProcessName | ||
| count(eval(EventCode=7040)) AS SrvEvts | ||
| count(eval(EventCode=4657)) AS RegEvts | ||
| count(eval(EventCode=4663)) AS HdlEvts | ||
| count(eval(EventCode=4688)) AS ProcEvts | ||
| by Computer | ||
| | where SrvEvts>0 AND RegEvts>0 AND HdlEvts>0 AND ProcEvts>0 | ||
| | eval Service_Change_Time=strftime(Service_Change_Time, "%Y-%m-%d %H:%M:%S") | ||
| | eval Registry_Change_Time \ | ||
| =strftime(Registry_Change_Time, "%Y-%m-%d %H:%M:%S") | ||
| | eval Handle_Creation_Time \ | ||
| =strftime(Handle_Creation_Time, "%Y-%m-%d %H:%M:%S") | ||
| | eval Process_Execution_Time \ | ||
| =strftime(Process_Execution_Time, "%Y-%m-%d %H:%M:%S") | ||
| | sort - Service_Change_Time | ||
| | `lateral_movement_via_bitlocker_com_hijacking_filter` | ||
| how_to_implement: |- | ||
| Ensure Windows Event Logs are being ingested into Splunk, particularly from | ||
| the Security channel (wineventlog),and System channel (for EventCode 7040). | ||
| This detection requires fields like EventCode, ComputerName, Service_Name, | ||
| OperationType, ObjectName, NewProcessName, ParentProcessName, Message, | ||
| ProcessName, NewValue, NewValueType, ProcessId,ParentProcessId, | ||
| and count values from stats. | ||
| Use Sysmon or Endpoint data models for enhanced coverage. | ||
| For Event IDs 4657 and 4663 (registry modifications and access attempts), | ||
| auditing must be enabled as these events are not logged by default. | ||
| Follow these steps to configure auditing | ||
| 1. **Enable Object Access Auditing in Group Policy or Local Security Policy:** | ||
| - Open Local Security Policy (secpol.msc) or Group Policy Editor (gpedit.msc) | ||
| - Navigate to Computer Configuration > Windows Settings > Security Settings > | ||
| Advanced Audit Policy Configuration > Audit Policies > Object Access. | ||
| - Enable "Audit Registry" for Success and Failure | ||
| (or specifically "Audit Handle Manipulation" and "Audit Kernel Object" | ||
| if needed for finer control). | ||
| 2. **Set System Access Control List (SACL) on the specific registry key:** | ||
| - Open Registry Editor (regedit.exe) as Administrator. | ||
| - Navigate to the target key: | ||
| HKCU\Software\Classes\CLSID\{A7A63E5C-3877-4840-8727-C1EA9D7A4D50} | ||
| (or the relevant subkeys where changes are expected). | ||
| - Right-click the key > Permissions > Advanced > Auditing tab. | ||
| - Click "Add" > Select Principal | ||
| (e.g., "Everyone" or a specific user/group for broader monitoring). | ||
| - Set Type to "Success" and "Failure". | ||
| - Check permissions to audit, such as "Set Value", "Create Subkey", "Delete", | ||
| "Query Value", "Enumerate Subkeys",and "Write DAC" | ||
| (adjust based on the attack vector; at minimum, include "Set Value" for 4657 | ||
| and access operations for 4663). | ||
| - Apply the changes. This SACL must be set on the exact keys/values | ||
| to generate events 4657 (for value modifications) | ||
| and 4663 (for handle access). | ||
| **Important Note on HKCU:** | ||
| Since this registry path is located under **HKEY_CURRENT_USER (HKCU)**, | ||
| the SACL is user-specific and applies only to the currently | ||
| logged-on user profile. | ||
| To ensure comprehensive coverage on multi-user systems | ||
| (e.g., Terminal Servers, Remote Desktop Session Hosts,or shared workstations) | ||
| this SACL configuration must be applied **for each user profile** | ||
| that needs to be monitored. | ||
| - One common approach is to log in as each relevant user | ||
| (or use a script/tool like PowerShell | ||
| with scheduled tasks or logon scripts) | ||
| to set the SACL in their HKCU hive. | ||
| - For domain environments, consider using Group Policy Preferences | ||
| (Registry) or logon scripts to automate applying these | ||
| auditing settings per user. | ||
| - If monitoring all users is impractical, prioritize high-risk or | ||
| privileged accounts. | ||
| Note SACLs are object-specific and do not propagate | ||
| unless inheritance is enabled.For domain-wide deployment, | ||
| use Group Policy to apply these settings where possible. | ||
| Test the configuration by simulating registry changes | ||
| (as the target user) to verify events are generated in the Security log. | ||
| For EventCode 7040 (service changes), ensure "Audit System Events" | ||
| is enabled under Audit Policies > System Audit Policies > System. | ||
| Without these auditing configurations, | ||
| the detection will not trigger for registry-related events. | ||
| known_false_positives: |- | ||
| Legitimate administrative activities may trigger this detection, | ||
| such as software installations or system configurations involving | ||
| Remote Registry and BitLocker components. Tune based on environment. | ||
| drilldown_searches: | ||
| - name: View the detection results for - "$Host$" | ||
| search: '%original_detection_search% | search Host = "$Host$"' | ||
| earliest_offset: $info_min_time$ | ||
| latest_offset: $info_max_time$ | ||
| - name: View risk events for the last 7 days for - "$Host$" | ||
| search: | | ||
| | from datamodel Risk.All_Risk | search normalized_risk_object="$Host$" | ||
| starthoursago=168 \ | ||
| | stats count min(_time) as firstTime max(_time) \ | ||
| as lastTime values(search_name) as "Search Name" values(risk_message) \ | ||
| as "Risk Message" values(analyticstories) as "Analytic Stories" \ | ||
| values(annotations._all) as "Annotations" \ | ||
| values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" \ | ||
| by normalized_risk_object | ||
| | `security_content_ctime(firstTime)` | ||
| | `security_content_ctime(lastTime)` | ||
| earliest_offset: $info_min_time$ | ||
| latest_offset: $info_max_time$ | ||
| tags: | ||
| asset_type: Endpoint | ||
| mitre_attack_id: | ||
| - T1546.015 | ||
| product: | ||
| - Splunk Enterprise | ||
| - Splunk Enterprise Security | ||
| - Splunk Cloud | ||
| security_domain: endpoint | ||
nasbench marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| tests: | ||
| - name: True Positive Test security log | ||
| attack_data: | ||
| - data: | ||
| https://media.githubusercontent.com/media/splunk/attack_data/refs/heads/master/datasets/attack_techniques/T1546.015/bitlocker_com_hijacking/windows-security.log | ||
| source: XmlWinEventLog:security | ||
| sourcetype: XmlWinEventLog | ||
| - name: True Positive Test system log | ||
| attack_data: | ||
| - data: | ||
| https://media.githubusercontent.com/media/splunk/attack_data/refs/heads/master/datasets/attack_techniques/T1546.015/bitlocker_com_hijacking/windows-system.log | ||
| source: XmlWinEventLog:system | ||
| sourcetype: XmlWinEventLog | ||
|
Comment on lines
+157
to
+169
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. Also since you are looking at the logs at once. They have to be in the same file. Do not split them. |
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are using both Message / OperationType as strings which they do not exist in this form while ingesting XML.
The message is not a field in the XML and the OperationType is usually encoded in the form
%%XXX.You cheated the logs in attack data, while you were asked to change it to XML.
You have to upload new logs that reflect the actual XML export splunk/attack_data#1098
You also have to adapt the search to use those values.