Detection rules › Splunk

Internal Horizontal Port Scan

Status
production
Severity
medium
Group by
All_Traffic.rule, All_Traffic.transport, _time, dest_ip, destination_port, gtime, src_ip, transport
Author
Dean Luxton
Source
github.com/splunk/security_content

This analytic identifies instances where an internal host has attempted to communicate with 250 or more destination IP addresses using the same port and protocol. 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.

Known false positives

  • No false positives have been identified at this time.

MITRE ATT&CK coverage

TacticTechniques
Discovery

Rule body

name: Internal Horizontal Port Scan
id: 1ff9eb9a-7d72-4993-a55e-59a839e607f1
version: 14
creation_date: '2024-07-01'
modification_date: '2026-05-13'
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 the same port and protocol. 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:
    - AWS CloudWatchLogs VPCflow
    - Cisco Secure Firewall Threat Defense Connection Event
search: |-
    | tstats `security_content_summariesonly` values(All_Traffic.action) as action values(All_Traffic.src_category) as src_category values(All_Traffic.dest_zone) as dest_zone values(All_Traffic.src_zone) as src_zone values(All_Traffic.src_port) as src_port count FROM datamodel=Network_Traffic
      WHERE All_Traffic.src_ip IN ("10.0.0.0/8","172.16.0.0/12","192.168.0.0/16")
      BY All_Traffic.src_ip All_Traffic.dest_port All_Traffic.dest_ip
         All_Traffic.transport All_Traffic.rule span=1s
         _time
    | `drop_dm_object_name("All_Traffic")`
    | eval gtime=_time
    | bin span=1h gtime
    | stats min(_time) as _time values(action) as action dc(dest_ip) as totalDestIPCount values(src_category) as src_category values(dest_zone) as dest_zone values(src_zone) as src_zone
      BY src_ip dest_port gtime
         transport
    | where totalDestIPCount>=250
    | eval dest_port=transport + "/" + dest_port
    | stats min(_time) as _time values(action) as action sum(totalDestIPCount) as totalDestIPCount values(src_category) as src_category values(dest_port) as dest_ports values(dest_zone) as dest_zone values(src_zone) as src_zone
      BY src_ip gtime
    | fields - gtime
    | `internal_horizontal_port_scan_filter`
how_to_implement: To properly run this search, Splunk needs to ingest data from networking telemetry sources such as firewalls, 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: []
finding:
    title: $src_ip$ has scanned for ports $dest_ports$ across $totalDestIPCount$ destination IPs
    entity:
        field: dest_ports
        type: system
        score: 50
threat_objects:
    - field: src_ip
      type: ip_address
analytic_story:
    - Network Discovery
    - Cisco Secure Firewall Threat Defense Analytics
    - China-Nexus Threat Activity
    - Scattered Lapsus$ Hunters
asset_type: Endpoint
mitre_attack_id:
    - T1046
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: network
security_domain: network

Stages and Predicates

Stage 1: tstats

| tstats `security_content_summariesonly` values(All_Traffic.action) as action values(All_Traffic.src_category) as src_category values(All_Traffic.dest_zone) as dest_zone values(All_Traffic.src_zone) as src_zone values(All_Traffic.src_port) as src_port count FROM datamodel=Network_Traffic
  WHERE All_Traffic.src_ip IN ("10.0.0.0/8","172.16.0.0/12","192.168.0.0/16")
  BY All_Traffic.src_ip All_Traffic.dest_port All_Traffic.dest_ip
     All_Traffic.transport All_Traffic.rule span=1s
     _time

Stage 2: search

| `drop_dm_object_name("All_Traffic")`

Stage 3: eval

| eval gtime=_time

Stage 4: bucket

| bin span=1h gtime

Stage 5: stats

| stats min(_time) as _time values(action) as action dc(dest_ip) as totalDestIPCount values(src_category) as src_category values(dest_zone) as dest_zone values(src_zone) as src_zone
  BY src_ip dest_port gtime
     transport

Stage 6: where

| where totalDestIPCount>=250

Stage 7: eval

| eval dest_port=transport + "/" + dest_port

Stage 8: stats

| stats min(_time) as _time values(action) as action sum(totalDestIPCount) as totalDestIPCount values(src_category) as src_category values(dest_port) as dest_ports values(dest_zone) as dest_zone values(src_zone) as src_zone
  BY src_ip gtime

Stage 9: fields

| fields - gtime

Stage 10: search

| `internal_horizontal_port_scan_filter`

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
All_Traffic.src_ipin
  • "10.0.0.0/8"
  • "172.16.0.0/12"
  • "192.168.0.0/16"
field:"src_ip" kind:in
totalDestIPCountge
  • 250
field:"totalDestIPCount" kind:ge value:"250"