Detection: Internal Horizontal Port Scan

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.

 1
 2| 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 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 span=1s _time All_Traffic.transport 
 3| `drop_dm_object_name("All_Traffic")` 
 4| eval gtime=_time 
 5| bin span=1h gtime 
 6| 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 
 7| where totalDestIPCount>=250 
 8| eval dest_port=transport + "/" + dest_port 
 9| 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 
10| fields - gtime 
11| `internal_horizontal_port_scan_filter`

Data Source

Name Platform Sourcetype Source
AWS CloudWatchLogs VPCflow AWS icon AWS 'aws:cloudwatchlogs:vpcflow' 'aws_cloudwatchlogs_vpcflow'

Macros Used

Name Value
security_content_summariesonly summariesonly=summariesonly_config allow_old_summaries=oldsummaries_config fillnull_value=fillnull_config``
internal_horizontal_port_scan_filter search *
internal_horizontal_port_scan_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1046 Network Service Discovery Discovery
KillChainPhase.EXPLOITAITON
NistCategory.DE_CM
Cis18Value.CIS_13
APT32
APT39
APT41
Agrius
BackdoorDiplomacy
BlackTech
Chimera
Cobalt Group
DarkVishnya
Ember Bear
FIN13
FIN6
Fox Kitten
INC Ransom
Lazarus Group
Leafminer
Magic Hound
Naikon
OilRig
RedCurl
Rocke
Suckfly
TeamTNT
Threat Group-3390
Tropic Trooper
Volt Typhoon
menuPass

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Notable Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Risk Event True
This configuration file applies to all detections of type TTP. These detections will use Risk Based Alerting and generate Notable Events.

Implementation

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

Unknown

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
$src_ip$ has scanned for ports $dest_ports$ across $totalDestIPCount$ destination IPs 64 80 80
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset aws:cloudwatchlogs:vpcflow aws:cloudwatchlogs:vpcflow
Integration ✅ Passing Dataset aws:cloudwatchlogs:vpcflow aws:cloudwatchlogs:vpcflow

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 3