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

Bloodhound queries: improve outdated OS and top 10 users queries and misc fixes #380

Merged
merged 2 commits into from
Sep 28, 2024

Conversation

gbe
Copy link
Contributor

@gbe gbe commented Sep 2, 2024

Hello,

this PR modifies some Bloodhound custom queries.

  • Outdated OS:
    Instead of returning every outdated computers referenced in the AD, only return the ones which machine account is enabled.
    Indeed, returning a disabled Windows XP is not interesting.

  • Top 10 user sessions:
    The queries were returning the top 10 users with local admin rights. So basically, it was also returning the domain administrators with admin rights on all object computers including the domain controllers. And if the domain has more than 10 DA, then these are the only ones returned.

The modified queries only return the top 10 users who are neither Domain Admins, Enterprise Admins, nor Administrators.

  • Misc:
    Fix a broken query and an english typo

@ShutdownRepo
Copy link
Member

ShutdownRepo commented Sep 4, 2024

Thank you!
However, I'm not sure we should keep the {enabled: TRUE} attribute you added, since disabled users can be re-enabled with proper permissions.
image
(from https://www.thehacker.recipes/ad/movement/dacl/)

What do you think?

@gbe
Copy link
Contributor Author

gbe commented Sep 9, 2024

Hi Shutdown,

I understand your point, but I have not modified all the queries, only the ones dealing with user sessions and adminTo privilege.

If a user is disabled, I think it's unlikely that it has a session somewhere. And even if the disabled user were having a session on a computer, I'm not sure it would be interesting to target the computer if it is to end up compromising a disabled account.

This is why I chose to filter on enabled users to not only speed up the query execution time, but also to only show relevant results.

I agree with you that if standard users can somehow revive other users with GenericAll or GenericWrite, this should be returned by Bloodhound, probably from a query of the group "Weak ACLs", but these are not modified by this PR.

@ShutdownRepo
Copy link
Member

Awesome, thank you @gbe, marking this PR as ready to merge, will do that soon !

@ShutdownRepo ShutdownRepo added enhancement New feature or request ready for merge in the waitlist for merge, requires preliminary steps labels Sep 19, 2024
@ShutdownRepo ShutdownRepo merged commit 62f81d9 into ThePorgs:dev Sep 28, 2024
@QU35T-code QU35T-code removed the ready for merge in the waitlist for merge, requires preliminary steps label Oct 18, 2024
@QU35T-code QU35T-code mentioned this pull request Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants