Merge pull request #222 from Pennyw0rth/neff-loggedon_users

Make loggedon-users unique to reduce spam and fix alignment
main
Marshall Hallenbeck 2024-03-26 20:35:13 -04:00 committed by GitHub
commit b80aa433d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -1050,17 +1050,17 @@ class smb(connection):
lmhash=self.lmhash, lmhash=self.lmhash,
nthash=self.nthash, 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") self.logger.success("Enumerated logged_on users")
if self.args.loggedon_users_filter: if self.args.loggedon_users_filter:
for user in logged_on: for user in logged_on:
if re.match(self.args.loggedon_users_filter, user.wkui1_username): if re.match(self.args.loggedon_users_filter, user[0].split("\\")[1]):
self.logger.highlight(f"{user.wkui1_logon_domain}\\{user.wkui1_username:<25} {f'logon_server: {user.wkui1_logon_server}' if user.wkui1_logon_server else ''}") self.logger.highlight(f"{user[0]:<25} {f'logon_server: {user[1]}'}")
else: else:
for user in logged_on: for user in logged_on:
self.logger.highlight(f"{user.wkui1_logon_domain}\\{user.wkui1_username:<25} {f'logon_server: {user.wkui1_logon_server}' if user.wkui1_logon_server else ''}") self.logger.highlight(f"{user[0]:<25} {f'logon_server: {user[1]}'}")
except Exception as e: except Exception as e:
self.logger.fail(f"Error enumerating logged on users: {e}") self.logger.fail(f"Error enumerating logged on users: {e}")
return logged_on
def pass_pol(self): def pass_pol(self):
return PassPolDump(self).dump() return PassPolDump(self).dump()