You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
8
+
9
+
[rule]
10
+
author = ["Elastic"]
11
+
description = """
12
+
Identifies Curl for Windows making an HTTP request. Adversaries could abuse Curl to download files or upload data to a remote URL.
13
+
"""
14
+
from = "now-9m"
15
+
index = [
16
+
"winlogbeat-*",
17
+
"logs-endpoint.events.process-*",
18
+
"logs-windows.forwarded*",
19
+
"logs-windows.sysmon_operational-*",
20
+
"endgame-*",
21
+
"logs-system.security*",
22
+
"logs-m365_defender.event-*",
23
+
"logs-sentinel_one_cloud_funnel.*",
24
+
"logs-crowdstrike.fdr*",
25
+
]
26
+
language = "eql"
27
+
license = "Elastic License v2"
28
+
name = "Potential File Transfer via Curl for Windows"
29
+
note = """## Triage and analysis
30
+
31
+
### Investigating Potential File Transfer via Curl for Windows
32
+
33
+
This rule identifies the use of Curl for Windows to download files from a remote URL or post data to a remote site.
34
+
35
+
#### Possible investigation steps
36
+
37
+
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
38
+
- Identify the user account that performed the action and whether it should perform this kind of action.
39
+
- Contact the account owner and confirm whether they are aware of this activity.
40
+
- Investigate other alerts associated with the user/host during the past 48 hours.
41
+
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
42
+
- Examine the details of the dropped file, and whether it was executed.
43
+
- Check the reputation of the domain or IP address used to host the downloaded file or if the user downloaded the file from an internal system.
44
+
- Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
45
+
46
+
### False positive analysis
47
+
48
+
- This activity is unusual but can be done by administrators. Benign true positives (B-TPs) can be added as exceptions if necessary.
49
+
50
+
### Response and remediation
51
+
52
+
- Initiate the incident response process based on the outcome of the triage.
53
+
- Isolate the involved host to prevent further post-compromise behavior.
54
+
- If the triage identified malware, search the environment for additional compromised hosts.
55
+
- Implement temporary network rules, procedures, and segmentation to contain the malware.
56
+
- Stop suspicious processes.
57
+
- Immediately block the identified indicators of compromise (IoCs).
58
+
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
59
+
- Remove and block malicious artifacts identified during triage.
60
+
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
61
+
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
62
+
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
63
+
- 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).
min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
8
+
9
+
[rule]
10
+
author = ["Elastic"]
11
+
description = """
12
+
Detects attempts to execute a command via the forfiles Windows utility. Adversaries may use this utility to proxy execution via
13
+
a trusted parent process.
14
+
"""
15
+
from = "now-9m"
16
+
index = [
17
+
"winlogbeat-*",
18
+
"logs-endpoint.events.process-*",
19
+
"logs-windows.forwarded*",
20
+
"logs-windows.sysmon_operational-*",
21
+
"endgame-*",
22
+
"logs-system.security*",
23
+
"logs-m365_defender.event-*",
24
+
"logs-sentinel_one_cloud_funnel.*",
25
+
"logs-crowdstrike.fdr*",
26
+
]
27
+
language = "eql"
28
+
license = "Elastic License v2"
29
+
name = "Command Execution via ForFiles"
30
+
note = """## Triage and analysis
31
+
32
+
### Investigating Command Execution via ForFiles
33
+
34
+
### Possible investigation steps
35
+
36
+
- Identify the user account that performed the action and whether it should perform this kind of action.
37
+
- Contact the account owner and confirm whether they are aware of this activity.
38
+
- Investigate other alerts associated with the user/host during the past 48 hours.
39
+
- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
40
+
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
41
+
42
+
### False positive analysis
43
+
44
+
- This is a dual-use tool, meaning its usage is not inherently malicious. Analysts can dismiss the alert if the administrator is aware of the activity, no other suspicious activity was identified.
45
+
46
+
### Response and Remediation
47
+
48
+
- Initiate the incident response process based on the outcome of the triage.
49
+
- Isolate the involved host to prevent further post-compromise behavior.
50
+
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
51
+
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
52
+
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
53
+
- 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).
min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
6
6
min_stack_version = "8.14.0"
7
-
updated_date = "2025/01/15"
7
+
updated_date = "2025/01/31"
8
8
9
9
[rule]
10
10
author = ["Elastic"]
11
11
description = """
12
-
Identifies suspicious PowerShellexecution spawning from Windows Script Host processes (cscript or wscript.exe).
12
+
Identifies PowerShell.exe or Cmd.exe execution spawning from Windows Script Host processes Wscript.exe.
13
13
"""
14
14
from = "now-9m"
15
15
index = [
@@ -22,7 +22,7 @@ index = [
22
22
]
23
23
language = "eql"
24
24
license = "Elastic License v2"
25
-
name = "Suspicious PowerShell Execution via Windows Scripts"
25
+
name = "Command and Scripting Interpreter via Windows Scripts"
26
26
risk_score = 73
27
27
rule_id = "2d62889e-e758-4c5e-b57e-c735914ee32a"
28
28
severity = "high"
@@ -42,69 +42,15 @@ type = "eql"
42
42
43
43
query = '''
44
44
process where host.os.type == "windows" and event.action == "start" and
45
-
process.name : ("powershell.exe", "pwsh.exe") and
46
-
process.parent.name : ("wscript.exe", "cscript.exe", "mshta.exe") and
47
-
(
48
-
process.args_count == 1 or
49
-
process.command_line :
50
-
("*^*^*^*^*^*^*^*^*^*",
51
-
"*''*''*''*",
52
-
"*`*`*`*`*",
53
-
"*{*{*{*{*{*{*{*{*{*{*{*{*{*{*{*{*{*{*{*",
54
-
"*+*+*+*+*+*",
55
-
"*$*$*$*$*",
56
-
"*[char[]](*)*-join",
57
-
"*Base64String*",
58
-
"*[*Convert]*",
59
-
"*.Text.Encoding*",
60
-
"*.Compression.*",
61
-
"*.replace(*",
62
-
"*MemoryStream*",
63
-
"*WriteAllBytes*",
64
-
"* -en* *",
65
-
"* -ec *",
66
-
"* -e *",
67
-
"* -ep *",
68
-
"* /e *",
69
-
"* /en* *",
70
-
"* /ec *",
71
-
"* /ep *",
72
-
"*WebClient*",
73
-
"*DownloadFile*",
74
-
"*DownloadString*",
75
-
"*BitsTransfer*",
76
-
"*Invoke-Exp*",
77
-
"*invoke-web*",
78
-
"*iex*",
79
-
"*iwr*",
80
-
"*Reflection.Assembly*",
81
-
"*Assembly.GetType*",
82
-
"*.Sockets.*",
83
-
"*Add-MpPreference*ExclusionPath*",
84
-
"*raw.githubusercontent*")
85
-
) and
86
-
87
-
/* many legit powershell commands uses those non shortened execution flags excluding Sync-AppvPublishingServer lolbas */
88
-
not (process.args : ("-EncodedCommand", "Import-Module*", "-NonInteractive") and
89
-
process.args : "-ExecutionPolicy" and not process.args : "Sync-AppvPublishingServer") and
90
-
91
-
/* third party installation related FPs */
92
-
not ?process.parent.args : "?:\\Windows\\system32\\gatherNetworkInfo.vbs" and
93
-
not (?process.parent.args : "Microsoft.SystemCenter.ICMPProbe.WithConsecutiveSamples.vbs" and process.args : "Get-SCOMAgent") and
94
-
not (process.command_line : "*WEBLOGIC_ARGS_CURRENT_1.DATA*" and ?process.parent.command_line : "*Impact360*") and
95
-
not process.args : "$package = Get-AppxPackage Microsoft.Office.Desktop -allUsers;*" and
96
-
not process.command_line : ("*.Access.IdentityReference*win32_SID.SID*", "*AGIAbQB4AC0AYQBwAC4AcwAzAC4AdQBzAC0AZQBhAHMAd*") and
97
-
not (?process.parent.args : "?:\\Users\\Prestige\\AppData\\Local\\Temp\\Rar$*\\KMS_VL_ALL_AIO.cmd -elevated" and process.command_line : "*KMS_VL_ALL_AIO.cmd*") and
98
-
not process.args : "iwr https://*.s3.us-east-1.amazonaws.com/scripts/Start-SpeedTest.ps1 -UserAgent * -UseBasicParsing | invoke-expression" and
process.name : ("powershell.exe", "pwsh.exe", "cmd.exe") and
46
+
process.parent.name : ("wscript.exe", "mshta.exe") and ?process.parent.args : "?:\\Users\\*"
101
47
'''
102
48
note = """## Triage and analysis
103
49
104
50
> **Disclaimer**:
105
51
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
106
52
107
-
### Investigating Suspicious PowerShell Execution via Windows Scripts
53
+
### Investigating Command and Scripting Interpreter via Windows Scripts
108
54
109
55
PowerShell, a powerful scripting language in Windows, is often targeted by adversaries for executing malicious scripts. Attackers exploit Windows Script Host processes like cscript or wscript to launch PowerShell with obfuscated commands, evading detection. The detection rule identifies such suspicious activity by monitoring PowerShell executions with specific patterns and parent processes, while filtering out known legitimate use cases to reduce false positives.
0 commit comments