From fc82715262d14b8336f4d8140b742012762d37b6 Mon Sep 17 00:00:00 2001 From: Kekoa Kaaikala Date: Wed, 21 Sep 2022 17:49:04 +0000 Subject: [PATCH] Agent: Fix mypy issues in vuln_assessment.py --- .../exploit/zerologon_utils/vuln_assessment.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/monkey/infection_monkey/exploit/zerologon_utils/vuln_assessment.py b/monkey/infection_monkey/exploit/zerologon_utils/vuln_assessment.py index 5ba40f7c8..e5fd32df0 100644 --- a/monkey/infection_monkey/exploit/zerologon_utils/vuln_assessment.py +++ b/monkey/infection_monkey/exploit/zerologon_utils/vuln_assessment.py @@ -1,17 +1,18 @@ import logging -from typing import Optional +from typing import Optional, Tuple import nmb.NetBIOS from impacket.dcerpc.v5 import nrpc, rpcrt from common.common_consts.timeouts import MEDIUM_REQUEST_TIMEOUT from common.utils.exceptions import DomainControllerNameFetchError +from infection_monkey.model import VictimHost from infection_monkey.utils.threading import interruptible_iter logger = logging.getLogger(__name__) -def get_dc_details(host: object) -> (str, str, str): +def get_dc_details(host: VictimHost) -> Tuple[str, str, str]: dc_ip = host.ip_addr dc_name = _get_dc_name(dc_ip=dc_ip) dc_handle = "\\\\" + dc_name @@ -35,7 +36,7 @@ def _get_dc_name(dc_ip: str) -> str: ) -def is_exploitable(zerologon_exploiter_object) -> (bool, Optional[rpcrt.DCERPC_v5]): +def is_exploitable(zerologon_exploiter_object) -> Tuple[bool, Optional[rpcrt.DCERPC_v5]]: # Connect to the DC's Netlogon service. try: rpc_con = zerologon_exploiter_object.connect_to_dc(zerologon_exploiter_object.dc_ip)