forked from p15670423/monkey
BB: Get the secret value from credentials in ZerologonAnalyzer
This commit is contained in:
parent
89b9e3cc2b
commit
0c6997c147
|
@ -28,20 +28,21 @@ class ZerologonAnalyzer(Analyzer):
|
||||||
|
|
||||||
def _analyze_credential_gathering(self) -> bool:
|
def _analyze_credential_gathering(self) -> bool:
|
||||||
propagation_credentials = self.island_client.get_propagation_credentials()
|
propagation_credentials = self.island_client.get_propagation_credentials()
|
||||||
|
self.log.add_entry(f"Credentials from endpoint: {propagation_credentials}")
|
||||||
credentials_on_island = ZerologonAnalyzer._get_relevant_credentials(propagation_credentials)
|
credentials_on_island = ZerologonAnalyzer._get_relevant_credentials(propagation_credentials)
|
||||||
|
self.log.add_entry(f"Relevant credentials: {credentials_on_island}")
|
||||||
return self._is_all_credentials_in_list(credentials_on_island)
|
return self._is_all_credentials_in_list(credentials_on_island)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_relevant_credentials(propagation_credentials: Credentials) -> List[str]:
|
def _get_relevant_credentials(propagation_credentials: Credentials) -> List[str]:
|
||||||
credentials_on_island = set()
|
credentials_on_island = set()
|
||||||
|
|
||||||
for credentials in propagation_credentials:
|
for credentials in propagation_credentials:
|
||||||
if isinstance(credentials.identity, Username):
|
if isinstance(credentials.identity, Username):
|
||||||
credentials_on_island.update([credentials.identity.username])
|
credentials_on_island.update([credentials.identity.username])
|
||||||
if isinstance(credentials.secret, NTHash):
|
if isinstance(credentials.secret, NTHash):
|
||||||
credentials_on_island.update([credentials.secret.nt_hash])
|
credentials_on_island.update([credentials.secret.nt_hash.get_secret_value()])
|
||||||
if isinstance(credentials.secret, LMHash):
|
if isinstance(credentials.secret, LMHash):
|
||||||
credentials_on_island.update([credentials.secret.lm_hash])
|
credentials_on_island.update([credentials.secret.lm_hash.get_secret_value()])
|
||||||
|
|
||||||
return list(credentials_on_island)
|
return list(credentials_on_island)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue