Getting Data In

Detecting Port Knocking

drico618
New Member

I'm looking for specific conditions where 2 or more ports (as seen by firewall) have allowed events (action=allowed) and then a third port, typically with a service such as port 22 is the final request. This far, I am working with:

index=firewall_index
| bin _time span=5m
| stats count, values(dest_zone) as dest_zone, values(dest_port) as dest_port,
values(user) as User by _time src_zone src_ip dest_ip
| where (src_zone != dest_zone)
| bin _time as Day span=1d
| eventstats values(dest_port) as all_dest_ports by Day src_ip dest_ip
| where (mvcount(dest_port) >= 5) OR (mvcount(all_dest_ports) >= 25)

which was borrowed for a port scan search.

0 Karma

whrg
Motivator

@drico618 "such as port 22" as in only port 22 or any port?

0 Karma
Get Updates on the Splunk Community!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...