Skip to content

Commit

Permalink
GetNPUsers.py: Single targets now correctly outputs hash to file
Browse files Browse the repository at this point in the history
  • Loading branch information
NuclearFizzler committed Dec 31, 2024
1 parent 9c8e408 commit 5c7df82
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/GetNPUsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,17 @@ def run(self):
logging.info('Getting machine hostname')
self.__target = self.getMachineName(self.__target)

if self.__outputFileName is not None:
fd = open(self.__outputFileName, 'w+')
else:
fd = None

# Are we asked not to supply a password?
if self.__doKerberos is False and self.__no_pass is True:
# Yes, just ask the TGT and exit
logging.info('Getting TGT for %s' % self.__username)
entry = self.getTGT(self.__username)
self.outputTGT(entry, None)
self.outputTGT(entry, fd)
return

# Connect to LDAP
Expand All @@ -275,7 +280,7 @@ def run(self):
# Cannot authenticate, we will try to get this users' TGT (hoping it has PreAuth disabled)
logging.info('Cannot authenticate %s, getting its TGT' % self.__username)
entry = self.getTGT(self.__username)
self.outputTGT(entry, None)
self.outputTGT(entry, fd)
return


Expand Down

0 comments on commit 5c7df82

Please sign in to comment.