Skip to content

Commit e38b20b

Browse files
w0rk3rtradebot-elastic
authored andcommitted
[Rule Tuning] Fixes FPs related to a process.args_count bug (#4971)
(cherry picked from commit 1dd1bb8)
1 parent a30e86e commit e38b20b

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

rules/windows/defense_evasion_masquerading_werfault.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2020/08/24"
33
integration = ["endpoint", "windows"]
44
maturity = "production"
5-
updated_date = "2025/05/05"
5+
updated_date = "2025/08/12"
66

77
[transform]
88
[[transform.osquery]]
@@ -120,7 +120,10 @@ type = "eql"
120120

121121
query = '''
122122
sequence by host.id, process.entity_id with maxspan = 5s
123-
[process where host.os.type == "windows" and event.type:"start" and process.name : ("wermgr.exe", "WerFault.exe") and process.args_count == 1]
123+
[process where host.os.type == "windows" and event.type:"start" and process.name : ("wermgr.exe", "WerFault.exe") and
124+
(process.args_count == 1 and
125+
/* Excludes bug where a missing closing quote sets args_count to 1 despite extra args */
126+
not process.command_line regex~ """\".*\.exe[^\"].*""")]
124127
[network where host.os.type == "windows" and process.name : ("wermgr.exe", "WerFault.exe") and network.protocol != "dns" and
125128
network.direction : ("outgoing", "egress") and destination.ip !="::1" and destination.ip !="127.0.0.1"
126129
]

rules/windows/defense_evasion_rundll32_no_arguments.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2020/09/02"
33
integration = ["endpoint", "windows"]
44
maturity = "production"
5-
updated_date = "2025/03/20"
5+
updated_date = "2025/08/12"
66

77
[transform]
88
[[transform.osquery]]
@@ -116,7 +116,9 @@ query = '''
116116
sequence with maxspan=1h
117117
[process where host.os.type == "windows" and event.type == "start" and
118118
(process.name : "rundll32.exe" or process.pe.original_file_name == "RUNDLL32.EXE") and
119-
process.args_count == 1
119+
(process.args_count == 1 and
120+
/* Excludes bug where a missing closing quote sets args_count to 1 despite extra args */
121+
not process.command_line regex~ """\".*\.exe[^\"].*""")
120122
] by process.entity_id
121123
[process where host.os.type == "windows" and event.type == "start" and process.parent.name : "rundll32.exe"
122124
] by process.parent.entity_id

rules/windows/defense_evasion_unusual_dir_ads.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2020/12/04"
33
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
44
maturity = "production"
5-
updated_date = "2025/03/20"
5+
updated_date = "2025/08/12"
66

77
[rule]
88
author = ["Elastic"]
@@ -79,7 +79,13 @@ type = "eql"
7979

8080
query = '''
8181
process where host.os.type == "windows" and event.type == "start" and
82-
process.args : "?:\\*:*" and process.args_count == 1
82+
process.args : "?:\\*:*" and
83+
(
84+
process.args_count == 1 and
85+
86+
/* Excludes bug where a missing closing quote sets args_count to 1 despite extra args */
87+
not process.command_line regex~ """\".*\.exe[^\"].*"""
88+
)
8389
'''
8490

8591

rules/windows/defense_evasion_unusual_network_connection_via_rundll32.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2020/02/18"
33
integration = ["endpoint", "windows"]
44
maturity = "production"
5-
updated_date = "2025/03/20"
5+
updated_date = "2025/08/12"
66

77
[rule]
88
author = ["Elastic"]
@@ -73,7 +73,13 @@ type = "eql"
7373

7474
query = '''
7575
sequence by host.id, process.entity_id with maxspan=1m
76-
[process where host.os.type == "windows" and event.type == "start" and process.name : "rundll32.exe" and process.args_count == 1]
76+
[process where host.os.type == "windows" and event.type == "start" and process.name : "rundll32.exe" and
77+
(
78+
process.args_count == 1 and
79+
80+
/* Excludes bug where a missing closing quote sets args_count to 1 despite extra args */
81+
not process.command_line regex~ """\".*\.exe[^\"].*"""
82+
)]
7783
[network where host.os.type == "windows" and process.name : "rundll32.exe" and
7884
not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
7985
"192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32",

0 commit comments

Comments
 (0)