Skip to content

Commit e788ab7

Browse files
Samirbousw0rk3r
andauthored
[New/tuning] WarLock coverage (#5846)
* [New/tuning] WarLock coverage Improve coverage for https://www.trendmicro.com/tr_tr/research/26/c/dissecting-a-warlock-attack.html * ++ * Update command_and_control_velociraptor_shell_execution.toml * Update command_and_control_tunnel_cloudflared.toml * Update command_and_control_tunnel_yuze.toml * Update command_and_control_velociraptor_shell_execution.toml * Update exfiltration_rclone_cloud_upload.toml * Update rules/windows/exfiltration_rclone_cloud_upload.toml Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com> * Update rules/windows/command_and_control_velociraptor_shell_execution.toml Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com> * Update command_and_control_tunnel_vscode.toml * Update command_and_control_tunnel_yuze.toml * Update command_and_control_tunnel_yuze.toml --------- Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
1 parent 7bde0a9 commit e788ab7

5 files changed

Lines changed: 396 additions & 2 deletions
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
[metadata]
2+
creation_date = "2026/03/18"
3+
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "m365_defender", "system", "crowdstrike"]
4+
maturity = "production"
5+
updated_date = "2026/03/18"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
Identifies the use of Cloudflare Tunnel (cloudflared) to expose a local service or create an outbound tunnel. Adversaries
11+
may abuse quick tunnels (e.g. tunnel --url http://127.0.0.1:80) or named tunnels to proxy C2 traffic or exfiltrate data
12+
through Cloudflare's edge while evading direct connection blocking.
13+
"""
14+
from = "now-9m"
15+
index = [
16+
"endgame-*",
17+
"logs-crowdstrike.fdr*",
18+
"logs-endpoint.events.process-*",
19+
"logs-m365_defender.event-*",
20+
"logs-sentinel_one_cloud_funnel.*",
21+
"logs-system.security*",
22+
"logs-windows.sysmon_operational-*",
23+
"winlogbeat-*",
24+
]
25+
language = "eql"
26+
license = "Elastic License v2"
27+
name = "Potential Protocol Tunneling via Cloudflared"
28+
note = """## Triage and analysis
29+
30+
### Investigating Potential Protocol Tunneling via Cloudflared
31+
32+
Cloudflare Tunnel (cloudflared) is a legitimate tool for exposing local services through Cloudflare's edge. Adversaries abuse it to create quick or named tunnels for C2, data exfiltration, or ingress tool transfer while evading direct connection blocking.
33+
34+
### Possible investigation steps
35+
36+
- Confirm the process command line for `tunnel`, `--url`, or `tunnel run` to validate cloudflared tunnel usage.
37+
- Identify the parent process and process executable path; cloudflared run from temp or user writable locations is more suspicious than from Program Files.
38+
- For quick tunnel (`--url http://...`), identify the local URL and whether it could be a C2 callback or proxy.
39+
- Correlate with network data for outbound connections to Cloudflare IPs or trycloudflare.com-style hostnames around the same time.
40+
- Review the user and session that started the tunnel; look for other suspicious logon or execution from the same context.
41+
42+
### False positive analysis
43+
44+
- Legitimate use of Cloudflare Tunnel for development or internal services may trigger this rule; consider allowlisting by path or user for approved use cases.
45+
46+
### Response and remediation
47+
48+
- If unauthorized tunnel use is confirmed: isolate the host, terminate the cloudflared process, and block cloudflared or Cloudflare tunnel domains at DNS/firewall where policy permits.
49+
- Rotate credentials for any accounts that may have been exposed over the tunnel.
50+
"""
51+
references = [
52+
"https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-useful-commands/",
53+
"https://attack.mitre.org/techniques/T1572/",
54+
]
55+
risk_score = 47
56+
rule_id = "d6e1b3f0-8a2c-4e7d-b5f9-1c0e3a6d8b2f"
57+
severity = "medium"
58+
tags = [
59+
"Domain: Endpoint",
60+
"OS: Windows",
61+
"Use Case: Threat Detection",
62+
"Tactic: Command and Control",
63+
"Resources: Investigation Guide",
64+
"Data Source: Elastic Defend",
65+
"Data Source: Sysmon",
66+
"Data Source: SentinelOne",
67+
"Data Source: Microsoft Defender for Endpoint",
68+
"Data Source: Crowdstrike",
69+
"Data Source: Elastic Endgame",
70+
"Data Source: Windows Security Event Logs"
71+
]
72+
timestamp_override = "event.ingested"
73+
type = "eql"
74+
75+
query = '''
76+
process where host.os.type == "windows" and event.type == "start" and
77+
(process.name : "cloudflared.exe" or ?process.pe.original_file_name == "cloudflared.exe" or ?process.code_signature.subject_name : "Cloudflare, Inc.") and process.args : "tunnel"
78+
'''
79+
80+
81+
[[rule.threat]]
82+
framework = "MITRE ATT&CK"
83+
[[rule.threat.technique]]
84+
id = "T1572"
85+
name = "Protocol Tunneling"
86+
reference = "https://attack.mitre.org/techniques/T1572/"
87+
88+
[rule.threat.tactic]
89+
id = "TA0011"
90+
name = "Command and Control"
91+
reference = "https://attack.mitre.org/tactics/TA0011/"

rules/windows/command_and_control_tunnel_vscode.toml

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

77
[rule]
88
author = ["Elastic"]
@@ -85,7 +85,12 @@ type = "eql"
8585

8686
query = '''
8787
process where host.os.type == "windows" and event.type == "start" and
88-
process.args : "tunnel" and (process.args : "--accept-server-license-terms" or process.name : "code*.exe") and
88+
process.args : "tunnel" and
89+
(process.args : "--accept-server-license-terms" or
90+
process.name : "code*.exe" or
91+
?process.code_signature.subject_name : "Microsoft Corporation" or
92+
process.executable : ("?:\\ProgramData\\*", "?:\\Users\\Public\\*", "?:\\windows\\debug\\*",
93+
"\\Device\\HarddiskVolume*\\Users\\Public\\*", "\\Device\\HarddiskVolume*\\ProgramData\\*", "\\Device\\HarddiskVolume*\\windows\\debug\\*")) and
8994
not (process.name == "code-tunnel.exe" and process.args == "status" and process.parent.name == "Code.exe")
9095
'''
9196

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
[metadata]
2+
creation_date = "2026/03/18"
3+
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "m365_defender", "system", "crowdstrike"]
4+
maturity = "production"
5+
updated_date = "2026/03/18"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
Identifies execution of Yuze, a lightweight open-source tunneling tool used for intranet penetration. Yuze supports
11+
forward and reverse SOCKS5 proxy tunneling and is typically executed via rundll32 loading yuze.dll with the RunYuze
12+
export. Threat actors may use it to proxy C2 or pivot traffic.
13+
"""
14+
from = "now-9m"
15+
index = [
16+
"endgame-*",
17+
"logs-crowdstrike.fdr*",
18+
"logs-endpoint.events.process-*",
19+
"logs-m365_defender.event-*",
20+
"logs-sentinel_one_cloud_funnel.*",
21+
"logs-system.security*",
22+
"logs-windows.sysmon_operational-*",
23+
"winlogbeat-*",
24+
]
25+
language = "eql"
26+
license = "Elastic License v2"
27+
name = "Potential Protocol Tunneling via Yuze"
28+
note = """## Triage and analysis
29+
30+
### Investigating Potential Protocol Tunneling via Yuze
31+
32+
Yuze is a C-based tunneling tool used for intranet penetration and supports forward and reverse SOCKS5 proxy tunneling. It is commonly executed as `rundll32 yuze.dll,RunYuze reverse -c <ip>:<port>` and has been observed in threat actor campaigns.
33+
34+
### Possible investigation steps
35+
36+
- Confirm the command line contains `yuze.dll` and `RunYuze`; typical form is `rundll32 yuze.dll,RunYuze reverse -c <ip>:<port>`.
37+
- Extract the remote endpoint from the `-c` argument (C2 or relay) and look up the IP/domain in threat intelligence.
38+
- Locate where yuze.dll was loaded from; check file creation time to see if it was recently dropped.
39+
- Identify the parent process that started rundll32 (script, scheduled task, exploit, etc.) to understand the execution chain.
40+
- Correlate with network events for outbound connections from this host to the IP/port in the command line.
41+
42+
### False positive analysis
43+
44+
- Legitimate use of Yuze is rare; most hits are likely malicious or red-team. If you use Yuze for authorized testing, consider an exception by host or user.
45+
46+
### Response and remediation
47+
48+
- Isolate the host and terminate the rundll32 process.
49+
- Remove yuze.dll from disk and hunt for other copies or related artifacts.
50+
- Block the C2/relay IP or domain at DNS/firewall; rotate credentials if the tunnel was used for access.
51+
"""
52+
references = [
53+
"https://attack.mitre.org/techniques/T1572/",
54+
"https://github.com/P001water/yuze",
55+
"https://www.trendmicro.com/tr_tr/research/26/c/dissecting-a-warlock-attack.html",
56+
]
57+
risk_score = 47
58+
rule_id = "e7f2c4a1-9b3d-5e8f-c6a0-2d1b4e7f8c3a"
59+
severity = "medium"
60+
tags = [
61+
"Domain: Endpoint",
62+
"OS: Windows",
63+
"Use Case: Threat Detection",
64+
"Tactic: Command and Control",
65+
"Resources: Investigation Guide",
66+
"Data Source: Elastic Defend",
67+
"Data Source: Sysmon",
68+
"Data Source: SentinelOne",
69+
"Data Source: Microsoft Defender for Endpoint",
70+
"Data Source: Crowdstrike",
71+
"Data Source: Elastic Endgame",
72+
"Data Source: Windows Security Event Logs"
73+
]
74+
timestamp_override = "event.ingested"
75+
type = "eql"
76+
77+
query = '''
78+
process where host.os.type == "windows" and event.type == "start" and
79+
(
80+
(process.args : "reverse" and process.args : ("-c", "-s")) or
81+
(process.args : ("proxy", "fwd") and process.args : "-l")
82+
) and
83+
(?process.code_signature.exists == false or process.name : "rundll32.exe")
84+
'''
85+
86+
87+
[[rule.threat]]
88+
framework = "MITRE ATT&CK"
89+
[[rule.threat.technique]]
90+
id = "T1572"
91+
name = "Protocol Tunneling"
92+
reference = "https://attack.mitre.org/techniques/T1572/"
93+
94+
[rule.threat.tactic]
95+
id = "TA0011"
96+
name = "Command and Control"
97+
reference = "https://attack.mitre.org/tactics/TA0011/"
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
[metadata]
2+
creation_date = "2026/03/18"
3+
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "m365_defender", "system", "crowdstrike"]
4+
maturity = "production"
5+
updated_date = "2026/03/18"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
Detects shell executions (cmd, PowerShell, rundll32) spawned by Velociraptor. Threat actors have been observed
11+
installing Velociraptor to execute shell commands on compromised systems, blending in with legitimate system processes.
12+
"""
13+
from = "now-9m"
14+
index = [
15+
"endgame-*",
16+
"logs-crowdstrike.fdr*",
17+
"logs-endpoint.events.process-*",
18+
"logs-m365_defender.event-*",
19+
"logs-sentinel_one_cloud_funnel.*",
20+
"logs-system.security*",
21+
"logs-windows.sysmon_operational-*",
22+
"winlogbeat-*",
23+
]
24+
language = "eql"
25+
license = "Elastic License v2"
26+
name = "Suspicious Shell Execution via Velociraptor"
27+
note = """## Triage and analysis
28+
29+
### Investigating Suspicious Shell Execution via Velociraptor
30+
31+
Velociraptor is a legitimate endpoint visibility and response tool. Threat actors have been observed deploying it on compromised systems to run shell commands (cmd, PowerShell, rundll32), making their activity look like normal Velociraptor-collector behavior.
32+
33+
### Possible investigation steps
34+
35+
- Confirm the parent process name matches a Velociraptor binary (e.g. velociraptor.exe, Velociraptor.exe) and the child is cmd.exe, powershell.exe, or rundll32.exe.
36+
- Review the child process command line for suspicious or interactive commands (e.g. download, lateral movement, credential access) versus known Velociraptor artifact scripts (Get-LocalGroupMember, Get-Date, registry queries, Velociraptor Tools module).
37+
- Identify how Velociraptor was installed (dropped by another process, scheduled task, service); correlate with earlier process or file events on the host.
38+
- Check whether the Velociraptor executable path and code signature are expected (e.g. Program Files vs. temp or user writable); unauthorized installs are often from non-standard paths.
39+
- Correlate with other alerts for the same host or user (initial access, persistence, C2) to determine if this is abuse vs. legitimate IR/DFIR use.
40+
41+
### False positive analysis
42+
43+
- Legitimate Velociraptor artifacts that run Get-LocalGroupMember, Get-Date, registry Run key checks, or Velociraptor Tools PowerShell module are excluded by the rule; remaining FPs may be custom artifacts. Allowlist by command-line pattern or host if you use Velociraptor for authorized IR and see known-good artifacts.
44+
45+
### Response and remediation
46+
47+
- If abuse is confirmed: isolate the host, terminate the Velociraptor and child shell processes, and remove the Velociraptor installation (binary, service, config).
48+
- Determine how Velociraptor was deployed and close the initial access vector; rotate credentials for affected accounts.
49+
- If the deployment was authorized (IR/DFIR), document and tune the rule or add an exception to reduce noise.
50+
"""
51+
references = [
52+
"https://www.huntress.com/blog/active-exploitation-solarwinds-web-help-desk-cve-2025-26399",
53+
"https://attack.mitre.org/techniques/T1219/",
54+
]
55+
risk_score = 47
56+
rule_id = "9aeca498-1e3d-4496-9e12-6ef40047eb23"
57+
severity = "medium"
58+
tags = [
59+
"Domain: Endpoint",
60+
"OS: Windows",
61+
"Use Case: Threat Detection",
62+
"Tactic: Command and Control",
63+
"Tactic: Execution",
64+
"Tactic: Defense Evasion",
65+
"Resources: Investigation Guide",
66+
"Data Source: Elastic Defend",
67+
"Data Source: Sysmon",
68+
"Data Source: SentinelOne",
69+
"Data Source: Microsoft Defender for Endpoint",
70+
"Data Source: Crowdstrike",
71+
"Data Source: Elastic Endgame",
72+
"Data Source: Windows Security Event Logs"
73+
]
74+
timestamp_override = "event.ingested"
75+
type = "eql"
76+
77+
query = '''
78+
process where host.os.type == "windows" and event.type == "start" and process.command_line != null and
79+
process.parent.name : "velociraptor.exe" and
80+
process.name : ("cmd.exe", "powershell.exe", "rundll32.exe") and
81+
not (process.name : "powershell.exe" and process.command_line : "*RwBlAHQALQBMAG8AYwBhAGwARwByAG8AdQBwAE0AZQBtAGIAZQBy*") and
82+
not (process.name : "powershell.exe" and process.command_line : "*RwBlAHQALQBEAGEAdABl*" and process.command_line : "*-Format*") and
83+
not (process.name : "cmd.exe" and process.command_line : "*start*127.0.0.1:8889*") and
84+
not (process.name : "powershell.exe" and process.command_line : "*RwBlAHQALQBJAHQAZQBt*" and process.command_line : "*UgBlAGcAaQBzAHQAcgB5*" and process.command_line : "*UgB1AG4A*") and
85+
not (process.name : "powershell.exe" and
86+
process.args : ("RwBlAHQALQ*", "UgBlAG0AbwB2AGUALQBJAHQAZQBtACA*", "C:\\Program Files\\Velociraptor\\thor.db",
87+
"import-module \"C:\\Program Files\\Velociraptor\\Tools\\*"))
88+
'''
89+
90+
91+
[[rule.threat]]
92+
framework = "MITRE ATT&CK"
93+
[[rule.threat.technique]]
94+
id = "T1219"
95+
name = "Remote Access Tools"
96+
reference = "https://attack.mitre.org/techniques/T1219/"
97+
[[rule.threat.technique.subtechnique]]
98+
id = "T1219.002"
99+
name = "Remote Desktop Software"
100+
reference = "https://attack.mitre.org/techniques/T1219/002/"
101+
102+
[rule.threat.tactic]
103+
id = "TA0011"
104+
name = "Command and Control"
105+
reference = "https://attack.mitre.org/tactics/TA0011/"
106+

0 commit comments

Comments
 (0)