Agent: explicitly specify some timeouts in zerologon exploiter

This commit is contained in:
vakarisz 2022-03-07 15:21:24 +02:00 committed by Mike Salvatore
parent 5ec05d5617
commit 325e58cea2
3 changed files with 7 additions and 2 deletions

View File

@ -56,6 +56,7 @@ from impacket.examples.secretsdump import (
) )
from impacket.smbconnection import SMBConnection from impacket.smbconnection import SMBConnection
from common.common_consts.timeouts import LONG_REQUEST_TIMEOUT
from infection_monkey.utils.capture_output import StdoutCapture from infection_monkey.utils.capture_output import StdoutCapture
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -96,7 +97,9 @@ class DumpSecrets:
self.__lmhash, self.__nthash = options.hashes.split(":") self.__lmhash, self.__nthash = options.hashes.split(":")
def connect(self): def connect(self):
self.__smb_connection = SMBConnection(self.__remote_name, self.__remote_host) self.__smb_connection = SMBConnection(
self.__remote_name, self.__remote_host, timeout=LONG_REQUEST_TIMEOUT
)
self.__smb_connection.login( self.__smb_connection.login(
self.__username, self.__username,
self.__password, self.__password,

View File

@ -71,6 +71,7 @@ class RemoteShell(cmd.Cmd):
self.__secrets_dir = secrets_dir self.__secrets_dir = secrets_dir
# We don't wanna deal with timeouts from now on. # We don't wanna deal with timeouts from now on.
# TODO are we sure we don't need timeout anymore?
if self.__transferClient is not None: if self.__transferClient is not None:
self.__transferClient.setTimeout(100000) self.__transferClient.setTimeout(100000)
self.do_cd("\\") self.do_cd("\\")

View File

@ -51,6 +51,7 @@ from impacket.dcerpc.v5.dcomrt import DCOMConnection
from impacket.dcerpc.v5.dtypes import NULL from impacket.dcerpc.v5.dtypes import NULL
from impacket.smbconnection import SMBConnection from impacket.smbconnection import SMBConnection
from common.common_consts.timeouts import LONG_REQUEST_TIMEOUT
from infection_monkey.exploit.zerologon_utils.remote_shell import RemoteShell from infection_monkey.exploit.zerologon_utils.remote_shell import RemoteShell
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -74,7 +75,7 @@ class Wmiexec:
self.shell = None self.shell = None
def connect(self): def connect(self):
self.smbConnection = SMBConnection(self.__ip, self.__ip) self.smbConnection = SMBConnection(self.__ip, self.__ip, timeout=LONG_REQUEST_TIMEOUT)
self.smbConnection.login( self.smbConnection.login(
user=self.__username, user=self.__username,
password=self.__password, password=self.__password,