Skip to content

Commit

Permalink
Exception handling
Browse files Browse the repository at this point in the history
Added exception handling for domains where LAPS is not enabled
  • Loading branch information
dievus authored Jan 26, 2023
1 parent ea5389d commit bb8bc9c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions msLDAPDump.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,14 @@ def ntlm_bind(self):
), self.computer_search(), self.ad_search(), self.mssql_search(), self.exchange_search(), self.gpo_search(), self.admin_count_search(), self.find_fields()

def laps(self):
self.conn.search(f'{self.dom_1}', '(ms-MCS-AdmPwd=*)', attributes=['ms-Mcs-AdmPwd'])
entries_val = self.conn.entries
print('\n' + '-'*33 + 'LAPS Passwords' + '-'*33 + '\n This relies on the current user having permissions to read LAPS passwords\n')
entries_val = str(entries_val)
print(entries_val)
try:
self.conn.search(f'{self.dom_1}', '(ms-MCS-AdmPwd=*)', attributes=['ms-Mcs-AdmPwd'])
entries_val = self.conn.entries
entries_val = str(entries_val)
print(entries_val)
except Exception:
pass

def search_users(self):
self.conn.search(
Expand Down

0 comments on commit bb8bc9c

Please sign in to comment.