Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nterl0k - T1110.003 [Spray and Pray] or [Boring but Works] #2915

Merged

Conversation

nterl0k
Copy link
Contributor

@nterl0k nterl0k commented Nov 11, 2023

Details

This is a generic password spray detection that can be used across all CIM compliant authentication sources.

Works based on a failure to success ratios common with malicious password guessing and can be run at longer durations to catch subtle password guessing attempts. (low/slow)

image

Sample data provided in splunk/attack_data#851 as an internal test case, but also works well against external facing authentication data sources (VPNs, webportals, etc)

Checklist

  • Validate name matches <platform>_<mitre att&ck technique>_<short description> nomenclature
  • CI/CD jobs passed ✔️
  • Validated SPL logic.
  • Validated tags, description, and how to implement.
  • Verified references match analytic.

@patel-bhavin patel-bhavin requested review from mvelazc0 and removed request for patel-bhavin and P4T12ICK February 27, 2024 23:32
@patel-bhavin
Copy link
Contributor

Hello @nterl0k : It looks like we already have a similar detection for detections/endpoint/detect_password_spray_attack_behavior_from_source.yml,. Can you perhaps remove this detection from this PR and then we can work towards getting this this detection Detect Password Spray Attack On User tested and merged!

https://research.splunk.com/application/086ab581-8877-42b3-9aee-4a7ecb0923af/
https://research.splunk.com/application/b1a82fc8-8a9f-4344-9ec2-bde5c5331b57/

@patel-bhavin
Copy link
Contributor

Also, we recently updated our Github CI to run build and unit-testing on all PRs. When I look at the build failure, it looks like the yaml is incorrect. :
image

@nterl0k
Copy link
Contributor Author

nterl0k commented Jul 23, 2024 via email

@patel-bhavin patel-bhavin requested review from patel-bhavin and removed request for mvelazc0 July 24, 2024 00:38
@ljstella
Copy link
Contributor

I think the detections are different enough from the others we already have that keeping them is probably worth it.

...from_source is currently blocked on the same issue in contentctl that another one of your PRs is blocked on: splunk/contentctl#204
Essentially, some of the fields are not always present. In the sample dataset for that one, user is an empty field. There's only one result though so the fix proposed in contentctl won't actually fix that for this one. Easiest way to fix that is ensure there's a successful logon in that dataset that will be aggregated into the conditions.

...on_user has an issue with the link to the attack_data for it. I've tested it with the dataset for ...from_source in case that was the intended dataset, but that dataset doesn't actually have the right conditions to pass the math in your | where statement.

@nterl0k
Copy link
Contributor Author

nterl0k commented Jul 29, 2024 via email

@nterl0k
Copy link
Contributor Author

nterl0k commented Jul 29, 2024 via email

@nterl0k
Copy link
Contributor Author

nterl0k commented Aug 2, 2024

@ljstella I added a log to the data source that should help clear the contentctl errors on both, also fixed the data source link on _user to point to the correct location (derp)

splunk/attack_data#904

For _source
image

For _user
image

@ljstella
Copy link
Contributor

ljstella commented Aug 7, 2024

@nterl0k weird question- in the environment that you developed this in, did you have a non-stock CIM config or something?

One of the detections is passing now, but detect_password_spray_attack_behavior_on_user.yml is not. And its an odd reason that it is not. Splunk authentications are being mapped to the Authentication datamodel, and in the test environment, we use the account admin which is also the account name in your attack data that meets the conditions for the detection. However, the extra logins from the admin user in Splunk as part of the testing workflow throws the math off, so no results end up showing up. There's a few options here to account for this:

  • we can move Authentication.app to the by clause, and adjust the rest of the search as necessary, accounting for spraying against the same app instead of all apps (probably okay since we're really targetting devices, even if the logic is portable to other services?)
  • we can specifically remove it with Authentication.app!='splunk'
  • we can keep it the same and try to change the default username in our testing infrastructre. (cc: @pyth0n1c for this bit, haven't looked to see how impossible that would be) edit: I don't think is actually even configurable in the underlying splunk-ansible project from what I can see.

@nterl0k
Copy link
Contributor Author

nterl0k commented Aug 7, 2024 via email

@ljstella
Copy link
Contributor

ljstella commented Aug 7, 2024

If you want to, go right ahead and I'll merge it as soon as it comes in. I know this particular set of detections has already been a handful when it comes to data, but it has also shown us some of the... odd assumptions we've made, and where they break things.

@nterl0k
Copy link
Contributor Author

nterl0k commented Aug 7, 2024 via email

@nterl0k
Copy link
Contributor Author

nterl0k commented Aug 7, 2024

Did the thing splunk/attack_data#905

@ljstella
Copy link
Contributor

ljstella commented Aug 7, 2024

Wooo! All tests passed, putting this in the queue for release! Thanks again @nterl0k

@ljstella ljstella added this to the v4.38.0 milestone Aug 7, 2024
@nterl0k
Copy link
Contributor Author

nterl0k commented Aug 8, 2024 via email

@ljstella ljstella modified the milestones: v4.38.0, v4.39.0 Aug 13, 2024
@ljstella ljstella self-requested a review August 22, 2024 13:04
Copy link
Contributor

@ljstella ljstella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@patel-bhavin patel-bhavin merged commit 729f5f5 into splunk:develop Aug 22, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants