Name:Cisco Secure Firewall - Communication Over Suspicious Ports id:d85c05c8-42c0-4e4a-87e7-4e1bb3e844e3 version:9 date:None author:Nasreddine Bencherchali, Onur Mustafa Erdogan, Splunk status:production type:Anomaly Description:The following analytic detects potential reverse shell activity by identifying connections involving ports commonly associated with remote access tools, shell listeners, or tunneling utilities.
It leverages Cisco Secure Firewall Threat Defense logs and monitors destination ports against a list of non-standard, high-risk port values often used in post-exploitation scenarios.
Adversaries frequently configure tools like netcat, Meterpreter, or other backdoors to listen or connect over uncommon ports such as 4444 or 2222 to bypass standard monitoring and firewall rules.
Data_source:
| where ( ```Same digit ports, i.e 4444, 55555``` ( isint(dest_port/1111) AND dest_port<10000 ) OR isint(dest_port/11111)
```Ports with sequentially increasing digits, i.e 1234, 12345``` OR ( isint((dest_port-123)/1111) AND dest_port<7000 ) OR isint((dest_port-1234)/11111)
```Ports with sequentially decreasing digits, i.e 4321``` OR ( isint((dest_port+123)/1111) AND dest_port>4000 AND dest_port<10000 ) )
| fillnull value="unknown" url
| stats min(_time) as firstTime max(_time) as lastTime values(src_port) as src_port values(url) as url values(rule) as rule
how_to_implement:This search requires Cisco Secure Firewall Threat Defense Logs, which includes the ConnectionEvent EventType.
This search uses an input macro named `cisco_secure_firewall`. We strongly recommend that you specify your environment-specific configurations (index, source, sourcetype, etc.) for Cisco Secure Firewall Threat Defense logs.
Replace the macro definition with configurations for your Splunk environment.
The search also uses a post-filter macro designed to filter out known false positives.
The logs are to be ingested using the Splunk Add-on for Cisco Security Cloud (https://splunkbase.splunk.com/app/7404).
The access policy must also enable logging.
The search uses a hardcoded list of suspicious ports, you might want to tune those according to your environment
known_false_positives:Some legitimate services or custom applications may use non-standard ports for development, remote management, or internal communication.
Ephemeral ports in test environments may occasionally overlap with ports used in this detection.
Additional context such as process name, user behavior, or endpoint telemetry should be used to validate suspicious sessions before escalation.
References: -https://www.cisco.com/c/en/us/td/docs/security/firepower/741/api/FQE/secure_firewall_estreamer_fqe_guide_740.pdf drilldown_searches: name:'View the detection results for - "$src$"' search:'%original_detection_search% | search src = "$src$"' earliest_offset:'$info_min_time$' latest_offset:'$info_max_time$' name:'View risk events for the last 7 days for - "$src$"' search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$src$") | 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:['Cisco Secure Firewall Threat Defense Analytics']