Skip to content

Commit e22b41d

Browse files
committed
Catch errors from the bloodhound run
1 parent 1ae8c5a commit e22b41d

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

nxc/protocols/ldap.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,16 +1665,21 @@ def bloodhound(self):
16651665
bloodhound = BloodHound(ad, self.hostname, self.host, self.port)
16661666
bloodhound.connect()
16671667

1668-
bloodhound.run(
1669-
collect=collect,
1670-
num_workers=10,
1671-
disable_pooling=False,
1672-
timestamp=timestamp,
1673-
fileNamePrefix=self.output_filename.split("/")[-1],
1674-
computerfile=None,
1675-
cachefile=None,
1676-
exclude_dcs=False,
1677-
)
1668+
try:
1669+
bloodhound.run(
1670+
collect=collect,
1671+
num_workers=10,
1672+
disable_pooling=False,
1673+
timestamp=timestamp,
1674+
fileNamePrefix=self.output_filename.split("/")[-1],
1675+
computerfile=None,
1676+
cachefile=None,
1677+
exclude_dcs=False,
1678+
)
1679+
except Exception as e:
1680+
self.logger.fail(f"BloodHound collection failed: {e.__class__.__name__} - {e}")
1681+
self.logger.debug(f"BloodHound collection failed: {e.__class__.__name__} - {e}", exc_info=True)
1682+
return None
16781683

16791684
self.output_filename += f"_{timestamp}"
16801685

0 commit comments

Comments
 (0)