Name:Internal Horizontal Port Scan NMAP Top 20 id:3141a041-4f57-4277-9faa-9305ca1f8e5b version:13 date:None author:Dean Luxton status:production type:TTP Description:This analytic identifies instances where an internal host has attempted to communicate with 250 or more destination IP addresses using on of the NMAP top 20 ports. Horizontal port scans from internal hosts can indicate reconnaissance or scanning activities, potentially signaling malicious intent or misconfiguration. By monitoring network traffic logs, this detection helps detect and respond to such behavior promptly, enhancing network security and preventing potential threats. Data_source:
search:| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime dc(All_Traffic.dest_ip) as totalDestIPCount values(All_Traffic.action) as action values(All_Traffic.dest_zone) as dest_zone values(All_Traffic.rule) as rule values(All_Traffic.src_category) as src_category values(All_Traffic.src_port) as src_port values(All_Traffic.src_zone) as src_zone
by span=1h _time All_Traffic.src_ip All_Traffic.dest_port All_Traffic.transport
| `drop_dm_object_name("All_Traffic")` | where totalDestIPCount>=250 | eval dest_port=transport + "/" + dest_port | stats min(firstTime) as firstTime max(lastTime) as lastTime dc(dest_port) as num_ports_scanned sum(totalDestIPCount) as totalDestIPCount values(action) as action values(dest_port) as dest_ports values(dest_zone) as dest_zone values(rule) as rule values(src_category) as src_category values(src_zone) as src_zone by _time src_ip | fields - _time | `security_content_ctime(lastTime)` | `security_content_ctime(firstTime)` | `internal_horizontal_port_scan_nmap_top_20_filter`
how_to_implement:To properly run this search, Splunk needs to ingest data from networking telemetry sources such as firewalls like Cisco Secure Firewall, NetFlow, or host-based networking events. Ensure that the Network_Traffic data model is populated to enable this search effectively. known_false_positives:No false positives have been identified at this time. References: drilldown_searches: name:'View the detection results for $src_ip$' search:'%original_detection_search% | search src_ip = $src_ip$' earliest_offset:'$info_min_time$' latest_offset:'$info_max_time$' name:'View risk events for the last 7 days for $src_ip$' search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ($src_ip$) | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`' earliest_offset:'7d' latest_offset:'0' analytic_story:['Network Discovery', 'Cisco Secure Firewall Threat Defense Analytics', 'China-Nexus Threat Activity', 'Scattered Lapsus$ Hunters']