Skip to content

Commit 5e0f108

Browse files
Aegrahtradebot-elastic
authored andcommitted
[Rule Tuning] Potential Port Scanning Activity from Compromised Host (#5161)
* [Rule Tuning] Potential Port Scanning Activity from Compromised Host * Update rules/linux/discovery_port_scanning_activity_from_compromised_host.toml * Update port scanning detection query Refine query to include source IP and limit destination port range. * Update discovery_port_scanning_activity_from_compromised_host.toml * Update query in discovery port scanning rule * Update discovery_port_scanning_activity_from_compromised_host.toml (cherry picked from commit 8319b7f)
1 parent 292eca8 commit 5e0f108

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

rules/linux/discovery_port_scanning_activity_from_compromised_host.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/03/04"
33
integration = ["endpoint"]
44
maturity = "production"
5-
updated_date = "2025/09/02"
5+
updated_date = "2025/09/29"
66

77
[rule]
88
author = ["Elastic"]
@@ -100,6 +100,8 @@ from logs-endpoint.events.network-*
100100
host.os.type == "linux" and
101101
event.type == "start" and
102102
event.action == "connection_attempted" and
103+
network.direction == "egress" and
104+
destination.port < 32768 and
103105
not (
104106
cidr_match(destination.ip, "127.0.0.0/8", "::1", "FE80::/10", "FF00::/8") or
105107
process.executable in (
@@ -122,14 +124,16 @@ from logs-endpoint.events.network-*
122124
destination.port,
123125
process.executable,
124126
destination.ip,
127+
source.ip,
125128
agent.id,
126129
host.name
127130
| stats
128131
Esql.event_count = count(),
129132
Esql.destination_port_count_distinct = count_distinct(destination.port),
130133
Esql.agent_id_count_distinct = count_distinct(agent.id),
131134
Esql.host_name_values = values(host.name),
132-
Esql.agent_id_values = values(agent.id)
135+
Esql.agent_id_values = values(agent.id),
136+
Esql.source_ip_values = values(source.ip)
133137
by process.executable, destination.ip
134138
| where
135139
Esql.agent_id_count_distinct == 1 and

0 commit comments

Comments
 (0)