Skip to content

Commit 0340335

Browse files
authored
[Rule Tuning] Sysmon rules that uses event.action (#4496)
* [Rule Tuning] Sysmon rules that uses `event.action` * Adjust queries * Fix unit test :thinking-hard:
1 parent a614da5 commit 0340335

File tree

3 files changed

+34
-28
lines changed

3 files changed

+34
-28
lines changed

rules/windows/defense_evasion_injection_msbuild.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2020/03/25"
33
integration = ["windows"]
44
maturity = "production"
5-
updated_date = "2025/01/15"
5+
updated_date = "2025/02/25"
66
min_stack_version = "8.14.0"
77
min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
88

@@ -33,8 +33,10 @@ timestamp_override = "event.ingested"
3333
type = "eql"
3434

3535
query = '''
36-
process where host.os.type == "windows" and process.name: "MSBuild.exe" and
37-
event.action:("CreateRemoteThread detected (rule: CreateRemoteThread)", "CreateRemoteThread")
36+
process where host.os.type == "windows" and
37+
event.provider == "Microsoft-Windows-Sysmon" and
38+
/* CreateRemoteThread */
39+
event.code == "8" and process.name: "MSBuild.exe"
3840
'''
3941
note = """## Triage and analysis
4042

rules/windows/defense_evasion_timestomp_sysmon.toml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2023/01/17"
33
integration = ["windows"]
44
maturity = "production"
5-
updated_date = "2025/01/15"
5+
updated_date = "2025/02/25"
66
min_stack_version = "8.14.0"
77
min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
88

@@ -33,27 +33,26 @@ timestamp_override = "event.ingested"
3333
type = "eql"
3434

3535
query = '''
36-
file where host.os.type == "windows" and event.code : "2" and
37-
38-
/* Requires Sysmon EventID 2 - File creation time change */
39-
event.action : "File creation time changed*" and
40-
41-
not process.executable :
42-
("?:\\Program Files\\*",
43-
"?:\\Program Files (x86)\\*",
44-
"?:\\Windows\\system32\\cleanmgr.exe",
45-
"?:\\Windows\\system32\\msiexec.exe",
46-
"?:\\Windows\\syswow64\\msiexec.exe",
47-
"?:\\Windows\\system32\\svchost.exe",
48-
"?:\\WINDOWS\\system32\\backgroundTaskHost.exe",
49-
"?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
50-
"?:\\Users\\*\\AppData\\Local\\Mozilla Firefox\\firefox.exe",
51-
"?:\\Users\\*\\AppData\\Local\\slack\\app-*\\slack.exe",
52-
"?:\\Users\\*\\AppData\\Local\\GitHubDesktop\\app-*\\GitHubDesktop.exe",
53-
"?:\\Users\\*\\AppData\\Local\\Microsoft\\Teams\\current\\Teams.exe",
54-
"?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDrive.exe") and
55-
not file.extension : ("temp", "tmp", "~tmp", "xml", "newcfg") and not user.name : ("SYSTEM", "Local Service", "Network Service") and
56-
not file.name : ("LOG", "temp-index", "license.rtf", "iconcache_*.db")
36+
file where host.os.type == "windows" and
37+
event.provider == "Microsoft-Windows-Sysmon" and
38+
/* File creation time change */
39+
event.code == "2" and
40+
not process.executable :
41+
("?:\\Program Files\\*",
42+
"?:\\Program Files (x86)\\*",
43+
"?:\\Windows\\system32\\cleanmgr.exe",
44+
"?:\\Windows\\system32\\msiexec.exe",
45+
"?:\\Windows\\syswow64\\msiexec.exe",
46+
"?:\\Windows\\system32\\svchost.exe",
47+
"?:\\WINDOWS\\system32\\backgroundTaskHost.exe",
48+
"?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
49+
"?:\\Users\\*\\AppData\\Local\\Mozilla Firefox\\firefox.exe",
50+
"?:\\Users\\*\\AppData\\Local\\slack\\app-*\\slack.exe",
51+
"?:\\Users\\*\\AppData\\Local\\GitHubDesktop\\app-*\\GitHubDesktop.exe",
52+
"?:\\Users\\*\\AppData\\Local\\Microsoft\\Teams\\current\\Teams.exe",
53+
"?:\\Users\\*\\AppData\\Local\\Microsoft\\OneDrive\\OneDrive.exe") and
54+
not file.extension : ("temp", "tmp", "~tmp", "xml", "newcfg") and not user.name : ("SYSTEM", "Local Service", "Network Service") and
55+
not file.name : ("LOG", "temp-index", "license.rtf", "iconcache_*.db")
5756
'''
5857
note = """## Triage and analysis
5958

rules/windows/privilege_escalation_via_rogue_named_pipe.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2021/10/13"
33
integration = ["windows"]
44
maturity = "production"
5-
updated_date = "2025/01/15"
5+
updated_date = "2025/02/25"
66
min_stack_version = "8.14.0"
77
min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
88

@@ -48,8 +48,13 @@ timestamp_override = "event.ingested"
4848
type = "eql"
4949

5050
query = '''
51-
file where host.os.type == "windows" and event.action : "Pipe Created*" and
52-
/* normal sysmon named pipe creation events truncate the pipe keyword */
51+
file where host.os.type == "windows" and
52+
event.provider == "Microsoft-Windows-Sysmon" and
53+
54+
/* Named Pipe Creation */
55+
event.code == "17" and
56+
57+
/* Sysmon truncates the "Pipe" keyword in normal named pipe creation events */
5358
file.name : "\\*\\Pipe\\*"
5459
'''
5560
note = """## Triage and analysis

0 commit comments

Comments
 (0)