Splunk Search

Correlation Search for brute force

toporagno
Explorer

HI,

I need to upgrade my correlation search for Excessive Failed Logins with Username,

| tstats summariesonly=true values("Authentication.tag") as "tag",dc("Authentication.user") as "user_count",values("Authentication.user") as "usernames", dc("Authentication.dest") as "dest_count",count from datamodel="Authentication"."Authentication" where nodename="Authentication.Failed_Authentication" by "Authentication.app","Authentication.src" | rename "Authentication.app" as "app","Authentication.src" as "src"  | where 'count'>=6

I would like the query to trigger only when there is a Successful Authentication after 6 failed authentication

 

 

thank youu

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Apart from all the valid remarks from @gcusello and @richgalloway , think about what you need. If you want to build on the search shown by @gcusello notice that yours groups login attempts by source (which means that it will show multiple attempts to log in using different usernames but from the same IP as one result) whereas the other one groups by username which means that it will aggregate login attempts to the same account launched from different IPs but split different account login attempts from the same IP as separate results. So it's a question of what you are looking for.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @toporagno ,

as @richgalloway said, in Security Essentials App and in ES Content Updates App, there are many samples of the brute force attack followed by a saccessful login, anyway, you could ttry something like this:

| tstats summariesonly=true 
   count(eval(Authentication.action="success")) AS success_count 
   count(eval(Authentication.action="failure")) AS failure_count 
   FROM datamodel=Authentication 
   WHERE Authentication.action IN (success, failure)
   BY Authentication.user
| rename 
   Authentication.user AS user
| where failure_count>=6 AND success_count>=6

That you can adapt to your data.

Ciao.

Giuseppe

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The current query can't do that because it only looks at failed logins.  It will never see a successful login.

The solution will entail appending a tstats command that counts successes and then modifying the where command to look for 6 or more failures and at least 1 success.

You can find an example in the Basic Brute Force Detection use case in the Splunk Security Essentials apps.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...