-
Notifications
You must be signed in to change notification settings - Fork 224
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
Add Secondary localgroup/session BOFs Supported by BOFHound #114
Add Secondary localgroup/session BOFs Supported by BOFHound #114
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request!
I found a few items I would like addressed in get-netsession2. Everything else looks good to me 👍
src/SA/get-netsession2/entry.c
Outdated
// DNS cleanup | ||
END: | ||
if(base) | ||
{DNSAPI$DnsFree(base, freetype);} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the value of base is passed by value. This free will never get hit and the value returned in the query_domain call will get leaked. The free for this value needs to be in query_domain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I fixed this one, moving the call up to query_domain
@freefirex thank you for providing recommended fixes for the issues - huge help. I think I've made the changes as requested, but if any issues are still lingering, please let me know and I'll take another pass |
Merged, thanks again! |
External tool BOFHound (now here) has supported parsing
ldapsearch
results out of C2 logs to produce JSON for BloodHound. This PR adds several secondary versions of existing BOFs that allow parsing of session data and local group memberships from log files. This allows for BloodHound'sHasSession
,AdminTo
and other edges that rely on local group data.This PR includes secondary versions of the following BOFs (mostly modified for ease of output parsing, but there are some other modifications such as structures returned by API calls):
netsession2
netloggedon2
netLocalGroupListMember2
One "new" BOF to pull sessions from the registry:
regsession
I opted for separate secondary BOFs since the changes aren't really upgrades/bugfixes for the original BOFs, and in some cases might clutter the output with data some users don't care for. With that said, if you'd like these changes merged into the original BOFs, I can make the necessary edits. Conversely, if you don't want to accept this PR, I am happy to move these BOFs to their own dedicated repo.
Additional details here: https://posts.specterops.io/bofhound-session-integration-7b88b6f18423