Skip to content

Commit 5983b86

Browse files
authored
Small Bug Fix on Listing SMB Shares with Kerberos Auth
This is a bug I came across while working with Kerberos on another project. If the information of the user in the ticket is not in the database, it gives an index error cause of user_id is empty. I thought about adding the ticket information as user_id, but since it wouldn't have any meaning when it expired, I proceeded with pass. Signed-off-by: termanix <50464194+termanix@users.noreply.github.com>
1 parent 669a55f commit 5983b86

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

nxc/protocols/smb.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,11 @@ def shares(self):
763763
try:
764764
self.logger.debug(f"domain: {self.domain}")
765765
user_id = self.db.get_user(self.domain.upper(), self.username)[0][0]
766+
except IndexError as e:
767+
if self.use_kcache:
768+
pass
769+
else
770+
self.logger.fail(f"IndexError: {str(e)}")
766771
except Exception as e:
767772
error = get_error_string(e)
768773
self.logger.fail(f"Error getting user: {error}")

0 commit comments

Comments
 (0)