Port Forwarding Rule Addition
Identifies the creation of a new port forwarding rule. An adversary may abuse this technique to bypass network segmentation restrictions.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/11/25"
3integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "m365_defender", "crowdstrike"]
4maturity = "production"
5updated_date = "2026/05/04"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies the creation of a new port forwarding rule. An adversary may abuse this technique to bypass network
11segmentation restrictions.
12"""
13from = "now-9m"
14index = [
15 "winlogbeat-*",
16 "logs-endpoint.events.registry-*",
17 "logs-windows.sysmon_operational-*",
18 "endgame-*",
19 "logs-sentinel_one_cloud_funnel.*",
20 "logs-m365_defender.event-*",
21 "logs-crowdstrike.fdr*",
22]
23language = "eql"
24license = "Elastic License v2"
25name = "Port Forwarding Rule Addition"
26note = """## Triage and analysis
27
28### Investigating Port Forwarding Rule Addition
29
30Network port forwarding is a mechanism to redirect incoming TCP connections (IPv4 or IPv6) from the local TCP port to any other port number, or even to a port on a remote computer.
31
32Attackers may configure port forwarding rules to bypass network segmentation restrictions, using the host as a jump box to access previously unreachable systems.
33
34This rule monitors the modifications to the `HKLM\\SYSTEM\\*ControlSet*\\Services\\PortProxy\\v4tov4\\` subkeys.
35
36#### Possible investigation steps
37
38- 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.
39- Identify the user account that performed the action and whether it should perform this kind of action.
40- Contact the account and system owners and confirm whether they are aware of this activity.
41- Investigate other alerts associated with the user/host during the past 48 hours.
42- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
43- Identify the target host IP address, check the connections originating from the host where the modification occurred, and inspect the credentials used.
44 - Investigate suspicious login activity, such as unauthorized access and logins from outside working hours and unusual locations.
45
46### False positive analysis
47
48- This mechanism can be used legitimately. Analysts can dismiss the alert if the Administrator is aware of the activity and there are justifications for this configuration.
49- If this rule is noisy in your environment due to expected activity, consider adding exceptions — preferably with a combination of user and command line conditions.
50
51### Response and remediation
52
53- Initiate the incident response process based on the outcome of the triage.
54- Delete the port forwarding rule.
55- Isolate the involved host to prevent further post-compromise behavior.
56- If the triage identified malware, search the environment for additional compromised hosts.
57 - Implement temporary network rules, procedures, and segmentation to contain the malware.
58 - Stop suspicious processes.
59 - Immediately block the identified indicators of compromise (IoCs).
60 - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
61- Remove and block malicious artifacts identified during triage.
62- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
63- 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.
64- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
65- 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).
66"""
67
68setup = """## Setup
69
70This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
71
72Setup instructions: https://ela.st/install-elastic-defend
73
74### Additional data sources
75
76This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
77
78- [CrowdStrike](https://ela.st/crowdstrike-integration)
79- [Microsoft Defender XDR](https://ela.st/m365-defender)
80- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
81- [Sysmon Registry Events](https://ela.st/sysmon-event-reg-setup)
82"""
83
84references = [
85 "https://www.fireeye.com/blog/threat-research/2019/01/bypassing-network-restrictions-through-rdp-tunneling.html",
86]
87risk_score = 47
88rule_id = "3535c8bb-3bd5-40f4-ae32-b7cd589d5372"
89severity = "medium"
90tags = [
91 "Domain: Endpoint",
92 "OS: Windows",
93 "Use Case: Threat Detection",
94 "Tactic: Command and Control",
95 "Tactic: Defense Evasion",
96 "Resources: Investigation Guide",
97 "Data Source: Elastic Endgame",
98 "Data Source: Elastic Defend",
99 "Data Source: Sysmon",
100 "Data Source: SentinelOne",
101 "Data Source: Microsoft Defender XDR",
102 "Data Source: Crowdstrike",
103]
104timestamp_override = "event.ingested"
105type = "eql"
106
107query = '''
108registry where host.os.type == "windows" and event.type == "change" and
109 registry.path : "*\\SYSTEM\\*ControlSet*\\Services\\PortProxy\\v4tov4\\*" and registry.data.strings != null
110'''
111
112
113[[rule.threat]]
114framework = "MITRE ATT&CK"
115
116[[rule.threat.technique]]
117id = "T1090"
118name = "Proxy"
119reference = "https://attack.mitre.org/techniques/T1090/"
120
121[[rule.threat.technique.subtechnique]]
122id = "T1090.001"
123name = "Internal Proxy"
124reference = "https://attack.mitre.org/techniques/T1090/001/"
125
126[[rule.threat.technique]]
127id = "T1572"
128name = "Protocol Tunneling"
129reference = "https://attack.mitre.org/techniques/T1572/"
130
131[rule.threat.tactic]
132id = "TA0011"
133name = "Command and Control"
134reference = "https://attack.mitre.org/tactics/TA0011/"
135
136[[rule.threat]]
137framework = "MITRE ATT&CK"
138
139[[rule.threat.technique]]
140id = "T1112"
141name = "Modify Registry"
142reference = "https://attack.mitre.org/techniques/T1112/"
143
144[rule.threat.tactic]
145id = "TA0005"
146name = "Defense Evasion"
147reference = "https://attack.mitre.org/tactics/TA0005/"
Triage and analysis
Investigating Port Forwarding Rule Addition
Network port forwarding is a mechanism to redirect incoming TCP connections (IPv4 or IPv6) from the local TCP port to any other port number, or even to a port on a remote computer.
Attackers may configure port forwarding rules to bypass network segmentation restrictions, using the host as a jump box to access previously unreachable systems.
This rule monitors the modifications to the HKLM\SYSTEM\*ControlSet*\Services\PortProxy\v4tov4\ subkeys.
Possible investigation steps
- 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.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Contact the account and system owners and confirm whether they are aware of this activity.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
- Identify the target host IP address, check the connections originating from the host where the modification occurred, and inspect the credentials used.
- Investigate suspicious login activity, such as unauthorized access and logins from outside working hours and unusual locations.
False positive analysis
- This mechanism can be used legitimately. Analysts can dismiss the alert if the Administrator is aware of the activity and there are justifications for this configuration.
- If this rule is noisy in your environment due to expected activity, consider adding exceptions — preferably with a combination of user and command line conditions.
Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Delete the port forwarding rule.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
- Implement temporary network rules, procedures, and segmentation to contain the malware.
- Stop suspicious processes.
- Immediately block the identified indicators of compromise (IoCs).
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- 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.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- 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).
References
Related rules
- Potential File Transfer via Certreq
- Suspicious Shell Execution via Velociraptor
- Adding Hidden File Attribute via Attrib
- Attempt to Establish VScode Remote Tunnel
- Clearing Windows Console History