Agent: Fix mypy issues in vuln_assessment.py

This commit is contained in:
Kekoa Kaaikala 2022-09-21 17:49:04 +00:00
parent 2fab84636e
commit fc82715262
1 changed files with 4 additions and 3 deletions

View File

@ -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)