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

Add sessions_bloodhound module #472

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

nodauf
Copy link
Contributor

@nodauf nodauf commented Oct 22, 2024

This module use the get_netloggedon to list the users connected on a target and add the relationship in bloodhound
image
image

@NeffIsBack
Copy link
Contributor

Thanks for the PR!
Though, we already have the flag --loggedon-users, which enumerates these users. Could you just add the bloodhound functionality to that function?
See:

NetExec/nxc/protocols/smb.py

Lines 1230 to 1251 in d6e77d1

def loggedon_users(self):
logged_on = []
try:
logged_on = get_netloggedon(
self.host,
self.domain,
self.username,
self.password,
lmhash=self.lmhash,
nthash=self.nthash,
)
logged_on = {(f"{user.wkui1_logon_domain}\\{user.wkui1_username}", user.wkui1_logon_server) for user in logged_on}
self.logger.success("Enumerated logged_on users")
if self.args.loggedon_users_filter:
for user in logged_on:
if re.match(self.args.loggedon_users_filter, user[0].split("\\")[1]):
self.logger.highlight(f"{user[0]:<25} {f'logon_server: {user[1]}'}")
else:
for user in logged_on:
self.logger.highlight(f"{user[0]:<25} {f'logon_server: {user[1]}'}")
except Exception as e:
self.logger.fail(f"Error enumerating logged on users: {e}")

The current bloodhound logic is located at /nxc/helpers/bloodhound.py. Please add the logic there and import the function. We have to also be careful with the domain the computer is in, as well as the user that has logged onto to the host. Take a look at the existing bloodhound functionality, i added a check to prevent name clashes with different domains (and trusts).

@nodauf nodauf marked this pull request as draft October 22, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants