-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: Sysmon registry rule conversion #549
Conversation
Test1 (Sysmon 12/13/14 -> Sec 4657 field conversion works)registry_addhayabusa-rules/sigma/builtin/registry/registry_add/registry_add_malware_netwire.yml Lines 1 to 2 in b8eb800
before detection:
registry_add:
EventID: 4657
Channel: Security
selection:
EventType: CreateKey
TargetObject|contains: \software\NetWire
condition: registry_add and selection after detection:
registry_add:
EventID: 4657
Channel: Security
selection:
OperationType: '%%1904'
ObjectName|contains: \software\NetWire
condition: registry_add and selection registry_sethayabusa-rules/sigma/builtin/registry/registry_set/registry_set_add_load_service_in_safe_mode.yml Lines 1 to 2 in b8eb800
before detection:
registry_set:
EventID: 4657
Channel: Security
selection:
TargetObject|startswith:
- HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\
- HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\
TargetObject|endswith: \(Default)
Details: Service
filter_sophos:
Image: C:\WINDOWS\system32\msiexec.exe
TargetObject:
- HKLM\System\CurrentControlSet\Control\SafeBoot\Minimal\SAVService\(Default)
- HKLM\System\CurrentControlSet\Control\SafeBoot\Network\SAVService\(Default)
condition: registry_set and (selection and not 1 of filter_*) after detection:
registry_set:
EventID: 4657
Channel: Security
selection:
ObjectName|startswith:
- \REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\
- \REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\
ObjectName|endswith: \(Default)
NewValue: Service
filter_sophos:
ProcessName: C:\WINDOWS\system32\msiexec.exe
ObjectName:
- \REGISTRY\MACHINE\System\CurrentControlSet\Control\SafeBoot\Minimal\SAVService\(Default)
- \REGISTRY\MACHINE\System\CurrentControlSet\Control\SafeBoot\Network\SAVService\(Default)
condition: registry_set and (selection and not 1 of filter_*) registry_eventLines 1 to 2 in b8eb800
before detection:
registry_event:
EventID: 4657
Channel: Security
selection1:
TargetObject|contains: \Services\HybridConnectionManager
selection2:
EventType: SetValue
Details|contains: Microsoft.HybridConnectionManager.Listener.exe
condition: registry_event and (selection1 or selection2) after detection:
registry_event:
EventID: 4657
Channel: Security
selection1:
ObjectName|contains: \Services\HybridConnectionManager
selection2:
OperationType: '%%1905'
NewValue|contains: Microsoft.HybridConnectionManager.Listener.exe
condition: registry_event and (selection1 or selection2) Known issueAccording to the investigation #476 (comment) , strictly speaking, |
Test2 (There are no unnecessary rule file differences)I confirmed that there are no differences in rules other than the
hayabusa-sample-evtx
(There was no event log for EID |
Test3 (benchmark)I took a benchmark with evtx-baseline v0.8 and got the following results. (and csv result has no diff)
|
Test4Since there is no log for EID registry_set (HKU)logsource:
product: windows
category: registry_set
detection:
registry_set:
EventID: 4657
Channel: Security
OperationType: '%%1905'
condition: registry_set {
"Timestamp": "2023-12-16 15:11:45.452 +09:00",
"Computer": "DESKTOP-BPR17M9",
"Channel": "Sec",
"EventID": 4657,
"Level": "info",
"RecordID": 1700,
"RuleTitle": "TEST",
"Details": {
"HandleId": "0x2c8",
"NewValue": "bbb",
"NewValueType": "%%1873",
"ObjectName": "\\REGISTRY\\USER\\S-1-5-21-2638832841-851990822-580981174-1001\\Software\\MyCo\\bar",
"ObjectValueName": "ssss",
"OldValue": "",
"OldValueType": "%%1873",
"OperationType": "%%1905",
"ProcessId": "0x1808",
"ProcessName": "C:\\Windows\\regedit.exe",
"SubjectDomainName": "DESKTOP-BPR17M9",
"SubjectLogonId": "0xb026b",
"SubjectUserName": "user1",
"SubjectUserSid": "S-1-5-21-2638832841-851990822-580981174-1001"
},
"ExtraFieldInfo": {
}
} registry_add (HKLM)detection:
registry_add:
EventID: 4657
Channel: Security
OperationType: '%%1904'
condition: registry_add
{
"Timestamp": "2023-12-16 13:04:46.861 +09:00",
"Computer": "DESKTOP-BPR17M9",
"Channel": "Sec",
"EventID": 4657,
"Level": "info",
"RecordID": 1622,
"RuleTitle": "TEST",
"Details": {
"HandleId": "0x374",
"NewValue": "",
"NewValueType": "%%1873",
"ObjectName": "\\REGISTRY\\MACHINE\\SOFTWARE\\MyCo",
"ObjectValueName": "str",
"OldValue": "-",
"OldValueType": "-",
"OperationType": "%%1904",
"ProcessId": "0x8a4",
"ProcessName": "C:\\Windows\\regedit.exe",
"SubjectDomainName": "DESKTOP-BPR17M9",
"SubjectLogonId": "0x11cc83",
"SubjectUserName": "user1",
"SubjectUserSid": "S-1-5-21-2638832841-851990822-580981174-1001"
},
"ExtraFieldInfo": {
}
} registry_delete(HKLM)detection:
registry_add:
EventID: 4657
Channel: Security
OperationType: '%%1904'
condition: registry_add {
"Timestamp": "2023-12-16 13:00:41.239 +09:00",
"Computer": "DESKTOP-BPR17M9",
"Channel": "Sec",
"EventID": 4657,
"Level": "info",
"RecordID": 1598,
"RuleTitle": "TEST",
"Details": {
"HandleId": "0x340",
"NewValue": "-",
"NewValueType": "-",
"ObjectName": "\\REGISTRY\\MACHINE\\SOFTWARE\\MyCo",
"ObjectValueName": "str",
"OldValue": "val",
"OldValueType": "%%1873",
"OperationType": "%%1906",
"ProcessId": "0x17f4",
"ProcessName": "C:\\Windows\\regedit.exe",
"SubjectDomainName": "DESKTOP-BPR17M9",
"SubjectLogonId": "0x11cc83",
"SubjectUserName": "user1",
"SubjectUserSid": "S-1-5-21-2638832841-851990822-580981174-1001"
},
"ExtraFieldInfo": {
}
} |
…1702956015 [Auto] Sigma Update report(2023-12-19 03:20:13)
Signed-off-by: Zach Mathis (田中ザック) <[email protected]>
What Changed
registry_xx
rules #476Evidence
Test Environment
I would appreciate it if you could review when you have time🙏