Security

Search proxy logs for beaconing hosts

mikefoti
Communicator

I'm trying to search proxy logs for beaconing hosts. Let's define beaconing as:
- visiting the same url
- using the same HTTP Method
- at a regular interval (say 60 seconds +/- 5s)
- at least 9 times

| transaction client_ip URL Method minpause=55s maxpause=65s | where eventcount > 10

My first problem is the lack of a MINPUASE command.
Any suggestions?

Tags (3)
0 Karma

lguinn2
Legend

Try this

yoursearchhere
| eventstats count as total_events by client_ip URL Method
| where total_events > 8
| sort client_ip URL Method _time
| streamstats current=f window=1 global=f last(_time) as prev_time by client_ip URL Method
| eval time_diff = _time - prev_time
| transaction client_ip URL Method maxpause=65s
| where time_diff >= 55 and eventcount > 8

This may not be exactly what you want, but perhaps it will give you some new ideas...

I used eventstats to eliminate as many client_ip's as I could, before creating the transactions. This should make the transaction command run faster. I also calculated the time difference between events so that I could use it later to implement the "minpause" idea.

Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...