Skip to content

Commit b8a6f59

Browse files
w0rk3rtradebot-elastic
authored andcommitted
[Rule Tuning] High-Severity Noisy Rules Conversion to new_terms (#5091)
* [Rule Tuning] High-Severity Noisy Rules Conversion to new_terms * ++ * ++ * Update credential_access_dcsync_replication_rights.toml * Update persistence_webshell_detection.toml * ++ * Update persistence_webshell_detection.toml (cherry picked from commit 4476ac5)
1 parent 68380be commit b8a6f59

5 files changed

+170
-107
lines changed

rules/windows/credential_access_dcsync_replication_rights.toml

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

77
[rule]
88
author = ["Elastic"]
@@ -11,9 +11,15 @@ This rule identifies when a User Account starts the Active Directory Replication
1111
technique to get credential information of individual accounts or the entire domain, thus compromising the entire
1212
domain.
1313
"""
14+
false_positives = [
15+
"""
16+
Service accounts that perform replication may trigger this alert on the first run per AD object, but they'll be
17+
suppressed in subsequent runs since this rule uses the new_terms rule type.
18+
"""
19+
]
1420
from = "now-9m"
1521
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
16-
language = "eql"
22+
language = "kuery"
1723
license = "Elastic License v2"
1824
name = "Potential Credential Access via DCSync"
1925
note = """## Triage and analysis
@@ -62,7 +68,7 @@ references = [
6268
"https://www.thehacker.recipes/ad/movement/credentials/dumping/dcsync",
6369
"https://www.elastic.co/security-labs/siestagraph-new-implant-uncovered-in-asean-member-foreign-ministry",
6470
]
65-
risk_score = 73
71+
risk_score = 47
6672
rule_id = "9f962927-1a4f-45f3-a57b-287f2c7029c1"
6773
setup = """## Setup
6874
@@ -80,7 +86,7 @@ DS Access >
8086
Audit Directory Service Access (Success,Failure)
8187
```
8288
"""
83-
severity = "high"
89+
severity = "medium"
8490
tags = [
8591
"Domain: Endpoint",
8692
"OS: Windows",
@@ -93,33 +99,16 @@ tags = [
9399
"Data Source: Windows Security Event Logs",
94100
]
95101
timestamp_override = "event.ingested"
96-
type = "eql"
102+
type = "new_terms"
97103

98104
query = '''
99-
any where event.code == "4662" and
100-
winlog.event_data.Properties : (
101-
102-
/* Control Access Rights/Permissions Symbol */
103-
104-
"*DS-Replication-Get-Changes*",
105-
"*DS-Replication-Get-Changes-All*",
106-
"*DS-Replication-Get-Changes-In-Filtered-Set*",
107-
108-
/* Identifying GUID used in ACE */
109-
110-
"*1131f6ad-9c07-11d1-f79f-00c04fc2dcd2*",
111-
"*1131f6aa-9c07-11d1-f79f-00c04fc2dcd2*",
112-
"*89e95b76-444d-4c62-991a-0facbeda640c*")
113-
114-
/* The right to perform an operation controlled by an extended access right. */
115-
116-
and winlog.event_data.AccessMask : "0x100" and
117-
not winlog.event_data.SubjectUserName : (
118-
"*$", "MSOL_*", "OpenDNS_Connector", "adconnect", "SyncADConnect",
119-
"SyncADConnectCM", "aadsync", "svcAzureADSync", "-"
120-
)
121-
122-
/* The Umbrella AD Connector uses the OpenDNS_Connector account to perform replication */
105+
host.os.type:"windows" and event.code:"4662" and
106+
winlog.event_data.Properties:(
107+
*DS-Replication-Get-Changes* or *DS-Replication-Get-Changes-All* or
108+
*DS-Replication-Get-Changes-In-Filtered-Set* or *1131f6ad-9c07-11d1-f79f-00c04fc2dcd2* or
109+
*1131f6aa-9c07-11d1-f79f-00c04fc2dcd2* or *89e95b76-444d-4c62-991a-0facbeda640c*
110+
) and winlog.event_data.AccessMask : "0x100" and
111+
not winlog.event_data.SubjectUserName:(*$ or MSOL_*)
123112
'''
124113

125114

@@ -158,3 +147,9 @@ id = "TA0004"
158147
name = "Privilege Escalation"
159148
reference = "https://attack.mitre.org/tactics/TA0004/"
160149

150+
[rule.new_terms]
151+
field = "new_terms_fields"
152+
value = ["winlog.event_data.SubjectUserSid", "winlog.event_data.ObjectName"]
153+
[[rule.new_terms.history_window_start]]
154+
field = "history_window_start"
155+
value = "now-12h"

rules/windows/credential_access_lsass_memdump_handle_access.toml

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2022/02/16"
33
integration = ["system", "windows"]
44
maturity = "production"
5-
updated_date = "2025/03/20"
5+
updated_date = "2025/09/11"
66

77
[transform]
88
[[transform.osquery]]
@@ -40,7 +40,7 @@ Comsvcs etc. It detects this behavior at a low level and does not depend on a sp
4040
"""
4141
from = "now-9m"
4242
index = ["logs-system.security*", "logs-windows.forwarded*", "winlogbeat-*"]
43-
language = "eql"
43+
language = "kuery"
4444
license = "Elastic License v2"
4545
name = "LSASS Memory Dump Handle Access"
4646
note = """## Triage and analysis
@@ -103,7 +103,7 @@ references = [
103103
"http://findingbad.blogspot.com/2017/",
104104
"https://www.elastic.co/security-labs/detect-credential-access",
105105
]
106-
risk_score = 73
106+
risk_score = 47
107107
rule_id = "208dbe77-01ed-4954-8d44-1e5751cb20de"
108108
setup = """## Setup
109109
@@ -122,9 +122,9 @@ Audit File System (Success,Failure)
122122
Audit Handle Manipulation (Success,Failure)
123123
```
124124
125-
Also, this event generates only if the objects [SACL](https://docs.microsoft.com/en-us/windows/win32/secauthz/access-control-lists) has the required access control entry (ACE) to handle the use of specific access rights.
125+
Also, this event generates only if the object's [SACL](https://docs.microsoft.com/en-us/windows/win32/secauthz/access-control-lists) has the required access control entry (ACE) to handle the use of specific access rights.
126126
"""
127-
severity = "high"
127+
severity = "medium"
128128
tags = [
129129
"Domain: Endpoint",
130130
"OS: Windows",
@@ -134,35 +134,45 @@ tags = [
134134
"Data Source: Windows Security Event Logs",
135135
]
136136
timestamp_override = "event.ingested"
137-
type = "eql"
137+
type = "new_terms"
138138

139139
query = '''
140-
any where event.code == "4656" and
141-
142-
winlog.event_data.ObjectName : (
143-
"?:\\Windows\\System32\\lsass.exe",
144-
"\\Device\\HarddiskVolume?\\Windows\\System32\\lsass.exe",
145-
"\\Device\\HarddiskVolume??\\Windows\\System32\\lsass.exe") and
146-
147-
/* The right to perform an operation controlled by an extended access right. */
148-
149-
(winlog.event_data.AccessMask : ("0x1fffff" , "0x1010", "0x120089", "0x1F3FFF") or
150-
winlog.event_data.AccessMaskDescription : ("READ_CONTROL", "Read from process memory"))
151-
152-
/* Common Noisy False Positives */
153-
154-
and not winlog.event_data.ProcessName : (
155-
"?:\\Program Files\\*.exe",
156-
"?:\\Program Files (x86)\\*.exe",
157-
"?:\\Windows\\system32\\wbem\\WmiPrvSE.exe",
158-
"?:\\Windows\\System32\\dllhost.exe",
159-
"?:\\Windows\\System32\\svchost.exe",
160-
"?:\\Windows\\System32\\msiexec.exe",
161-
"?:\\ProgramData\\Microsoft\\Windows Defender\\*.exe",
162-
"?:\\Windows\\explorer.exe",
163-
"?:\\Windows\\System32\\poqexec.exe")
140+
host.os.type:"windows" and event.code:"4656" and
141+
(
142+
winlog.event_data.AccessMask : ("0x1fffff" or "0x1010" or "0x120089" or "0x1F3FFF") or
143+
winlog.event_data.AccessMaskDescription : ("READ_CONTROL" or "Read from process memory")
144+
) and
145+
winlog.event_data.ObjectName : *\\Windows\\System32\\lsass.exe and
146+
not winlog.event_data.ProcessName : (
147+
"C:\Windows\System32\wbem\WmiPrvSE.exe" or
148+
"C:\Windows\SysWOW64\wbem\WmiPrvSE.exe" or
149+
"C:\Windows\System32\dllhost.exe" or
150+
"C:\Windows\System32\svchost.exe" or
151+
"C:\Windows\System32\msiexec.exe" or
152+
"C:\Windows\explorer.exe"
153+
)
164154
'''
165155

156+
[[rule.filters]]
157+
[rule.filters.meta]
158+
negate = true
159+
[rule.filters.query.wildcard."winlog.event_data.ProcessName"]
160+
case_insensitive = true
161+
value = "C:\\\\Program Files (x86)\\\\*.exe"
162+
163+
[[rule.filters]]
164+
[rule.filters.meta]
165+
negate = true
166+
[rule.filters.query.wildcard."winlog.event_data.ProcessName"]
167+
case_insensitive = true
168+
value = "C:\\\\Program Files\\\\*.exe"
169+
170+
[[rule.filters]]
171+
[rule.filters.meta]
172+
negate = true
173+
[rule.filters.query.wildcard."winlog.event_data.ProcessName"]
174+
case_insensitive = true
175+
value = "?:\\\\ProgramData\\\\Microsoft\\\\Windows Defender\\\\*.exe"
166176

167177
[[rule.threat]]
168178
framework = "MITRE ATT&CK"
@@ -182,3 +192,10 @@ id = "TA0006"
182192
name = "Credential Access"
183193
reference = "https://attack.mitre.org/tactics/TA0006/"
184194

195+
196+
[rule.new_terms]
197+
field = "new_terms_fields"
198+
value = ["winlog.event_data.ProcessName", "winlog.event_data.SubjectUserName"]
199+
[[rule.new_terms.history_window_start]]
200+
field = "history_window_start"
201+
value = "now-1d"

rules/windows/lateral_movement_unusual_dns_service_file_writes.toml

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

77
[rule]
88
author = ["Elastic"]
@@ -12,24 +12,17 @@ may indicate activity related to remote code execution or other forms of exploit
1212
"""
1313
from = "now-9m"
1414
index = ["winlogbeat-*", "logs-endpoint.events.file-*", "logs-windows.sysmon_operational-*", "endgame-*"]
15-
language = "eql"
15+
language = "kuery"
1616
license = "Elastic License v2"
17-
name = "Unusual File Modification by dns.exe"
18-
note = """## Triage and analysis
19-
20-
### Investigating Unusual File Modification by dns.exe
21-
Detection alerts from this rule indicate potential unusual/abnormal file writes from the DNS Server service process (`dns.exe`) after exploitation from CVE-2020-1350 (SigRed) has occurred. Here are some possible avenues of investigation:
22-
- Post-exploitation, adversaries may write additional files or payloads to the system as additional discovery/exploitation/persistence mechanisms.
23-
- Any suspicious or abnormal files written from `dns.exe` should be reviewed and investigated with care.
24-
"""
17+
name = "Unusual File Operation by dns.exe"
2518
references = [
2619
"https://research.checkpoint.com/2020/resolving-your-way-into-domain-admin-exploiting-a-17-year-old-bug-in-windows-dns-servers/",
2720
"https://msrc-blog.microsoft.com/2020/07/14/july-2020-security-update-cve-2020-1350-vulnerability-in-windows-domain-name-system-dns-server/",
2821
"https://www.elastic.co/security-labs/detection-rules-for-sigred-vulnerability",
2922
]
30-
risk_score = 73
23+
risk_score = 47
3124
rule_id = "c7ce36c0-32ff-4f9a-bfc2-dcb242bf99f9"
32-
severity = "high"
25+
severity = "medium"
3326
tags = [
3427
"Domain: Endpoint",
3528
"OS: Windows",
@@ -39,18 +32,14 @@ tags = [
3932
"Use Case: Vulnerability",
4033
"Data Source: Elastic Defend",
4134
"Data Source: Sysmon",
42-
"Resources: Investigation Guide",
4335
]
4436
timestamp_override = "event.ingested"
45-
type = "eql"
37+
type = "new_terms"
4638

4739
query = '''
48-
file where host.os.type == "windows" and process.name : "dns.exe" and event.type in ("creation", "deletion", "change") and
49-
not file.name : "dns.log" and not
50-
(file.extension : ("old", "temp", "bak", "dns", "arpa") and file.path : "C:\\Windows\\System32\\dns\\*") and
51-
52-
/* DNS logs with custom names, header converts to "DNS Server log" */
53-
not ?file.Ext.header_bytes : "444e5320536572766572206c6f67*"
40+
event.category : "file" and host.os.type : "windows" and
41+
event.type : ("creation" or "deletion" or "change") and process.name : "dns.exe" and
42+
not file.extension : ("old" or "temp" or "bak" or "dns" or "arpa" or "log")
5443
'''
5544

5645

@@ -67,3 +56,10 @@ id = "TA0008"
6756
name = "Lateral Movement"
6857
reference = "https://attack.mitre.org/tactics/TA0008/"
6958

59+
60+
[rule.new_terms]
61+
field = "new_terms_fields"
62+
value = ["file.path", "host.id"]
63+
[[rule.new_terms.history_window_start]]
64+
field = "history_window_start"
65+
value = "now-7d"

rules/windows/persistence_via_xp_cmdshell_mssql_stored_procedure.toml

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

77
[rule]
88
author = ["Elastic"]
@@ -22,7 +22,7 @@ index = [
2222
"logs-windows.sysmon_operational-*",
2323
"winlogbeat-*",
2424
]
25-
language = "eql"
25+
language = "kuery"
2626
license = "Elastic License v2"
2727
name = "Execution via MSSQL xp_cmdshell Stored Procedure"
2828
note = """## Triage and analysis
@@ -59,9 +59,9 @@ The xp_cmdshell procedure is disabled by default, but when used, it has the same
5959
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
6060
"""
6161
references = ["https://thedfirreport.com/2022/07/11/select-xmrig-from-sqlserver/"]
62-
risk_score = 73
62+
risk_score = 47
6363
rule_id = "4ed493fc-d637-4a36-80ff-ac84937e5461"
64-
severity = "high"
64+
severity = "medium"
6565
tags = [
6666
"Domain: Endpoint",
6767
"OS: Windows",
@@ -77,21 +77,32 @@ tags = [
7777
"Data Source: Crowdstrike",
7878
]
7979
timestamp_override = "event.ingested"
80-
type = "eql"
80+
type = "new_terms"
8181

8282
query = '''
83-
process where host.os.type == "windows" and event.type == "start" and process.parent.name : "sqlservr.exe" and
83+
host.os.type:windows and event.category:process and event.type:start and
84+
process.parent.name:"sqlservr.exe" and process.command_line : * and
85+
(
8486
(
85-
(process.name : "cmd.exe" and
86-
not process.args : ("\\\\*", "diskfree", "rmdir", "mkdir", "dir", "del", "rename", "bcp", "*XMLNAMESPACES*",
87-
"?:\\MSSQL\\Backup\\Jobs\\sql_agent_backup_job.ps1", "K:\\MSSQL\\Backup\\msdb", "K:\\MSSQL\\Backup\\Logins")) or
88-
89-
(process.name : "vpnbridge.exe" or ?process.pe.original_file_name : "vpnbridge.exe") or
90-
91-
(process.name : "certutil.exe" or ?process.pe.original_file_name == "CertUtil.exe") or
92-
93-
(process.name : "bitsadmin.exe" or ?process.pe.original_file_name == "bitsadmin.exe")
94-
)
87+
(process.name.caseless : "cmd.exe" or process.pe.original_file_name : "Cmd.Exe") and
88+
not process.args : (
89+
\\\\* or diskfree or rmdir or mkdir or dir or DIR or del or rename or bcp or md or ren or REN or send or echo or
90+
ECHO or TYPE or type or EXIST or forfiles or sqlcmd or SQLCMD or dtexec or Sort-Object or cat or copy or COPY or
91+
move or MOVE or CD\\ or show or rd or powercfg or "C:\SPAN4\DATA\RISKPARAM.SPN" or ("@ECHO" and "@FOR") or
92+
("@echo" and "@for") or (SET and PATH=*) or ("-ExecutionPolicy" and "-File") or MSSQLFDLauncher$DATEV_DBENGINE or
93+
(wmic and (cpu or computersystem or logicaldisk or os or ComputerSystem or volume)) or -s\:C\:\\WINDOWS\\SERVIC* or
94+
D\:\\* or E\:\\* or F\:\\* or Z\:\\* or "C:\Program Files\Amazon\AWSCLIV2\aws.exe" or C\:\\7-Zip\\7z.exe* or
95+
C\:\\FTP* or *\(Get-Item* or C\:\\ProgramData\\Daktronics*
96+
) and
97+
not process.command_line : (
98+
"\"C:\\Windows\\system32\\cmd.exe\" /c " or
99+
"\"C:\\Windows\\System32\\cmd.exe\""
100+
)
101+
) or
102+
process.name.caseless:("bitsadmin.exe" or "certutil.exe" or "vpnbridge.exe") or
103+
process.name:("bitsadmin.exe" or "certutil.exe" or "vpnbridge.exe") or
104+
process.pe.original_file_name:("CertUtil.exe" or "bitsadmin.exe" or "vpnbridge.exe")
105+
)
95106
'''
96107

97108

@@ -130,3 +141,9 @@ id = "TA0002"
130141
name = "Execution"
131142
reference = "https://attack.mitre.org/tactics/TA0002/"
132143

144+
[rule.new_terms]
145+
field = "new_terms_fields"
146+
value = ["host.id", "process.command_line"]
147+
[[rule.new_terms.history_window_start]]
148+
field = "history_window_start"
149+
value = "now-7d"

0 commit comments

Comments
 (0)