Skip to content

Commit 18e1103

Browse files
authored
[New Rule] Potential Linux Tunneling and/or Port Forwarding via SSH Option (#4658)
1 parent b3adc6d commit 18e1103

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
[metadata]
2+
creation_date = "2025/04/25"
3+
integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"]
4+
maturity = "production"
5+
updated_date = "2025/04/25"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
This rule detects the use of SSH options that may indicate tunneling or port forwarding on Linux systems. This behavior
11+
is commonly associated with malicious activity, such as establishing a port forward, proxy or an encrypted tunnel to
12+
exfiltrate data.
13+
"""
14+
from = "now-9m"
15+
index = [
16+
"endgame-*",
17+
"logs-crowdstrike.fdr*",
18+
"logs-endpoint.events.process*",
19+
"logs-sentinel_one_cloud_funnel.*",
20+
]
21+
language = "eql"
22+
license = "Elastic License v2"
23+
name = "Potential Linux Tunneling and/or Port Forwarding via SSH Option"
24+
references = [
25+
"https://blog.bitsadmin.com/living-off-the-foreign-land-windows-as-offensive-platform",
26+
"https://book.hacktricks.xyz/generic-methodologies-and-resources/tunneling-and-port-forwarding",
27+
]
28+
risk_score = 21
29+
rule_id = "ef395dff-be12-4a6e-8919-d87d627c2174"
30+
setup = """## Setup
31+
32+
This rule requires data coming in from Elastic Defend.
33+
34+
### Elastic Defend Integration Setup
35+
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
36+
37+
#### Prerequisite Requirements:
38+
- Fleet is required for Elastic Defend.
39+
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
40+
41+
#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
42+
- Go to the Kibana home page and click "Add integrations".
43+
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
44+
- Click "Add Elastic Defend".
45+
- Configure the integration name and optionally add a description.
46+
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
47+
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
48+
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
49+
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
50+
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
51+
- Click "Save and Continue".
52+
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
53+
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
54+
"""
55+
severity = "low"
56+
tags = [
57+
"Domain: Endpoint",
58+
"OS: Linux",
59+
"Use Case: Threat Detection",
60+
"Tactic: Command and Control",
61+
"Data Source: Elastic Defend",
62+
"Data Source: Elastic Endgame",
63+
"Data Source: Crowdstrike",
64+
"Data Source: SentinelOne",
65+
]
66+
timestamp_override = "event.ingested"
67+
type = "eql"
68+
query = '''
69+
process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "start", "ProcessRollup2") and
70+
process.name in ("ssh", "sshd") and process.args == "-o" and
71+
process.command_line like~ (
72+
"*ProxyCommand*", "*LocalForward*", "*RemoteForward*", "*DynamicForward*", "*Tunnel*", "*GatewayPorts*",
73+
"*ExitOnForwardFailure*", "*ProxyCommand*", "*ProxyJump*"
74+
)
75+
'''
76+
77+
[[rule.threat]]
78+
framework = "MITRE ATT&CK"
79+
80+
[[rule.threat.technique]]
81+
id = "T1572"
82+
name = "Protocol Tunneling"
83+
reference = "https://attack.mitre.org/techniques/T1572/"
84+
85+
[rule.threat.tactic]
86+
id = "TA0011"
87+
name = "Command and Control"
88+
reference = "https://attack.mitre.org/tactics/TA0011/"

0 commit comments

Comments
 (0)