forked from p15670423/monkey
Agent: Fix mypy issues in vuln_assessment.py
This commit is contained in:
parent
2fab84636e
commit
fc82715262
|
@ -1,17 +1,18 @@
|
||||||
import logging
|
import logging
|
||||||
from typing import Optional
|
from typing import Optional, Tuple
|
||||||
|
|
||||||
import nmb.NetBIOS
|
import nmb.NetBIOS
|
||||||
from impacket.dcerpc.v5 import nrpc, rpcrt
|
from impacket.dcerpc.v5 import nrpc, rpcrt
|
||||||
|
|
||||||
from common.common_consts.timeouts import MEDIUM_REQUEST_TIMEOUT
|
from common.common_consts.timeouts import MEDIUM_REQUEST_TIMEOUT
|
||||||
from common.utils.exceptions import DomainControllerNameFetchError
|
from common.utils.exceptions import DomainControllerNameFetchError
|
||||||
|
from infection_monkey.model import VictimHost
|
||||||
from infection_monkey.utils.threading import interruptible_iter
|
from infection_monkey.utils.threading import interruptible_iter
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
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_ip = host.ip_addr
|
||||||
dc_name = _get_dc_name(dc_ip=dc_ip)
|
dc_name = _get_dc_name(dc_ip=dc_ip)
|
||||||
dc_handle = "\\\\" + dc_name
|
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.
|
# Connect to the DC's Netlogon service.
|
||||||
try:
|
try:
|
||||||
rpc_con = zerologon_exploiter_object.connect_to_dc(zerologon_exploiter_object.dc_ip)
|
rpc_con = zerologon_exploiter_object.connect_to_dc(zerologon_exploiter_object.dc_ip)
|
||||||
|
|
Loading…
Reference in New Issue