22creation_date = " 2023/05/17"
33integration = [" network_traffic" , " panw" ]
44maturity = " production"
5- updated_date = " 2025/02/28 "
5+ updated_date = " 2025/12/17 "
66
77[rule ]
88author = [" Elastic" ]
99description = """
10- This rule identifies a potential port scan. A port scan is a method utilized by attackers to systematically scan a
11- target system or network for open ports, allowing them to identify available services and potential vulnerabilities. By
12- mapping out the open ports, attackers can gather critical information to plan and execute targeted attacks, gaining
13- unauthorized access, compromising security, and potentially leading to data breaches, unauthorized control, or further
14- exploitation of the targeted system or network . This rule defines a threshold-based approach to detect connection
15- attempts from a single source to a wide range of destination ports.
10+ This rule identifies a potential port scan from an internal IP address . A port scan is a method utilized by attackers to
11+ systematically scan a target system for open ports, allowing them to identify available services and potential
12+ vulnerabilities. By mapping out the open ports, attackers can gather critical information to plan and execute targeted
13+ attacks, gaining unauthorized access, compromising security, and potentially leading to data breaches, unauthorized
14+ control, or further exploitation of the targeted system. This rule defines a threshold-based approach to detect
15+ connection attempts from a single internal source to a wide range of destination ports on a single destination .
1616"""
1717from = " now-9m"
18- index = [" logs-network_traffic.*" , " packetbeat-*" , " filebeat-*" , " logs-panw.panos*" ]
19- language = " kuery"
18+ language = " esql"
2019license = " Elastic License v2"
21- max_signals = 5
2220name = " Potential Network Scan Detected"
2321risk_score = 21
2422rule_id = " 0171f283-ade7-4f87-9521-ac346c68cc9b"
@@ -32,10 +30,19 @@ tags = [
3230 " Resources: Investigation Guide"
3331]
3432timestamp_override = " event.ingested"
35- type = " threshold "
33+ type = " esql "
3634
3735query = '''
38- event.action:network_flow and destination.port:* and source.ip:(10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16)
36+ from logs-network_traffic.*, packetbeat-*, filebeat-*, logs-panw.panos*
37+ | mv_expand event.action
38+ | where event.action == "network_flow" and destination.port is not null and source.ip is not null and destination.ip is not null
39+ | where CIDR_MATCH(source.ip, "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16")
40+ | stats
41+ Esql.count_distinct_destination_ports = COUNT_DISTINCT(destination.port),
42+ Esql.values_destination_ports = VALUES(destination.port)
43+ by destination.ip, source.ip
44+ | where Esql.count_distinct_destination_ports >= 250
45+ | keep source.ip, destination.ip, Esql.*
3946'''
4047note = """ ## Triage and analysis
4148
@@ -103,11 +110,3 @@ reference = "https://attack.mitre.org/techniques/T1595/001/"
103110id = " TA0043"
104111name = " Reconnaissance"
105112reference = " https://attack.mitre.org/tactics/TA0043/"
106-
107- [rule .threshold ]
108- field = [" destination.ip" , " source.ip" ]
109- value = 1
110-
111- [[rule .threshold .cardinality ]]
112- field = " destination.port"
113- value = 250
0 commit comments