Skip to content

Commit 83211ad

Browse files
w0rk3rtradebot-elastic
authored andcommitted
[Rule Tuning] Suspicious Windows Powershell Arguments (#4961)
(cherry picked from commit 58f62fd)
1 parent 9f72310 commit 83211ad

File tree

1 file changed

+41
-19
lines changed

1 file changed

+41
-19
lines changed

rules/windows/execution_windows_powershell_susp_args.toml

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

77
[rule]
88
author = ["Elastic"]
@@ -58,9 +58,9 @@ PowerShell is a powerful scripting language and command-line shell used for task
5858
- Restore any affected files or system components from known good backups to ensure system integrity and functionality.
5959
- Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional systems are compromised.
6060
- Implement additional monitoring and logging for PowerShell activities across the network to enhance detection of similar threats in the future."""
61-
risk_score = 73
61+
risk_score = 47
6262
rule_id = "83bf249e-4348-47ba-9741-1202a09556ad"
63-
severity = "high"
63+
severity = "medium"
6464
tags = [
6565
"Domain: Endpoint",
6666
"OS: Windows",
@@ -79,9 +79,15 @@ type = "eql"
7979
query = '''
8080
process where host.os.type == "windows" and event.type == "start" and
8181
process.name : "powershell.exe" and
82+
83+
not (
84+
user.id == "S-1-5-18" and
85+
/* Don't apply the user.id exclusion to Sysmon for compatibility */
86+
not event.dataset : ("windows.sysmon_operational", "windows.sysmon")
87+
) and
88+
8289
(
83-
process.command_line :
84-
(
90+
process.command_line : (
8591
"*^*^*^*^*^*^*^*^*^*",
8692
"*`*`*`*`*",
8793
"*+*+*+*+*+*+*",
@@ -103,6 +109,7 @@ process where host.os.type == "windows" and event.type == "start" and
103109
"*DownloadString*",
104110
"* iex*",
105111
"* iwr*",
112+
"* aQB3AHIAIABpA*",
106113
"*Reflection.Assembly*",
107114
"*Assembly.GetType*",
108115
"*$env:temp\\*start*",
@@ -124,21 +131,36 @@ process where host.os.type == "windows" and event.type == "start" and
124131
"*.content|i''Ex*",
125132
"*//:sptth*",
126133
"*//:ptth*",
134+
"*h''t''t''p*",
135+
"*'tp'':''/'*",
136+
"*$env:T\"E\"MP*",
137+
"*;cmd /c $?",
138+
"*s''t''a''r*",
127139
"*$*=Get-Content*AppData*.SubString(*$*",
128-
"*=cat *AppData*.substring(*);*$*"
129-
) or
130-
131-
(process.args : "-c" and process.args : "&{'*") or
132-
133-
(process.args : "-Outfile" and process.args : "Start*") or
134-
135-
(process.args : "-bxor" and process.args : "0x*") or
136-
137-
process.args : "$*$*;set-alias" or
138-
139-
(process.parent.name : ("explorer.exe", "cmd.exe") and
140-
process.command_line : ("*-encodedCommand*", "*Invoke-webrequest*", "*WebClient*", "*Reflection.Assembly*"))
141-
)
140+
"*=cat *AppData*.substring(*);*$*",
141+
"*-join'';*|powershell*",
142+
"*.Content;sleep *|powershell*",
143+
"*h\''t\''tp:\''*",
144+
"*-e aQB3AHIAIABp*",
145+
"*iwr *https*).Content*",
146+
"*$env:computername*http*",
147+
"*;InVoKe-ExpRESsIoN $COntent.CONTENt;*",
148+
"*WebClient*example.com*",
149+
"*=iwr $*;iex $*"
150+
) or
151+
152+
(process.args : "-c" and process.args : "&{'*") or
153+
154+
(process.args : "-Outfile" and process.args : "Start*") or
155+
156+
(process.args : "-bxor" and process.args : "0x*") or
157+
158+
process.args : "$*$*;set-alias" or
159+
160+
(
161+
process.parent.name : ("explorer.exe", "cmd.exe") and
162+
process.command_line : ("*-encodedCommand*", "*Invoke-webrequest*", "*WebClient*", "*Reflection.Assembly*"))
163+
)
142164
'''
143165

144166

0 commit comments

Comments
 (0)