当前位置: 首页>>代码示例>>Python>>正文


Python smb3.SMB3属性代码示例

本文整理汇总了Python中impacket.smb3.SMB3属性的典型用法代码示例。如果您正苦于以下问题:Python smb3.SMB3属性的具体用法?Python smb3.SMB3怎么用?Python smb3.SMB3使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在impacket.smb3的用法示例。


在下文中一共展示了smb3.SMB3属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from impacket import smb3 [as 别名]
# 或者: from impacket.smb3 import SMB3 [as 别名]
def __init__(self, config, SMBClient, username):
        Thread.__init__(self)
        self.daemon = True
        if isinstance(SMBClient, smb.SMB) or isinstance(SMBClient, smb3.SMB3):
            self.__SMBConnection = SMBConnection(existingConnection = SMBClient)
        else:
            self.__SMBConnection = SMBClient
        self.config = config
        self.__answerTMP = ''
        if self.config.interactive:
            #Launch locally listening interactive shell
            self.tcpshell = TcpShell()
        else:
            self.tcpshell = None
            if self.config.exeFile is not None:
                self.installService = serviceinstall.ServiceInstall(SMBClient, self.config.exeFile) 
开发者ID:tholum,项目名称:PiBunny,代码行数:18,代码来源:ntlmrelayx.py

示例2: __init__

# 需要导入模块: from impacket import smb3 [as 别名]
# 或者: from impacket.smb3 import SMB3 [as 别名]
def __init__(self, SMBObject, exeFile):
        self._rpctransport = 0
        self.__service_name = ''.join([random.choice(string.letters) for i in range(4)])
        self.__binary_service_name = ''.join([random.choice(string.letters) for i in range(8)]) + '.exe'
        self.__exeFile = exeFile

        # We might receive two different types of objects, always end up
        # with a SMBConnection one
        if isinstance(SMBObject, smb.SMB) or isinstance(SMBObject, smb3.SMB3):
            self.connection = SMBConnection(existingConnection = SMBObject)
        else:
            self.connection = SMBObject

        self.share = '' 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:16,代码来源:serviceinstall.py

示例3: __init__

# 需要导入模块: from impacket import smb3 [as 别名]
# 或者: from impacket.smb3 import SMB3 [as 别名]
def __init__(self, remoteName='', remoteHost='', myName=None, sess_port=nmb.SMB_SESSION_PORT, timeout=60, preferredDialect=None,
                 existingConnection=None, manualNegotiate=False):

        self._SMBConnection = 0
        self._dialect       = ''
        self._nmbSession    = 0
        self._sess_port     = sess_port
        self._myName        = myName
        self._remoteHost    = remoteHost
        self._remoteName    = remoteName
        self._timeout       = timeout
        self._preferredDialect = preferredDialect
        self._existingConnection = existingConnection
        self._manualNegotiate = manualNegotiate
        self._doKerberos = False
        self._kdcHost = None
        self._useCache = True
        self._ntlmFallback = True

        if existingConnection is not None:
            # Existing Connection must be a smb or smb3 instance
            assert ( isinstance(existingConnection,smb.SMB) or isinstance(existingConnection, smb3.SMB3))
            self._SMBConnection = existingConnection
            self._preferredDialect = self._SMBConnection.getDialect()
            self._doKerberos = self._SMBConnection.getKerberos()
            return

        ##preferredDialect = smb.SMB_DIALECT

        if manualNegotiate is False:
            self.negotiateSession(preferredDialect) 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:33,代码来源:smbconnection.py

示例4: getSMBServer

# 需要导入模块: from impacket import smb3 [as 别名]
# 或者: from impacket.smb3 import SMB3 [as 别名]
def getSMBServer(self):
        """
        returns the SMB/SMB3 instance being used. Useful for calling low level methods
        """
        return self._SMBConnection 
开发者ID:joxeankoret,项目名称:CVE-2017-7494,代码行数:7,代码来源:smbconnection.py

示例5: __init__

# 需要导入模块: from impacket import smb3 [as 别名]
# 或者: from impacket.smb3 import SMB3 [as 别名]
def __init__(self, SMBObject, exeFile, serviceName=''):
        self._rpctransport = 0
        self.__service_name = serviceName if len(serviceName) > 0  else  ''.join([random.choice(string.letters) for i in range(4)])
        self.__binary_service_name = ''.join([random.choice(string.letters) for i in range(8)]) + '.exe'
        self.__exeFile = exeFile

        # We might receive two different types of objects, always end up
        # with a SMBConnection one
        if isinstance(SMBObject, smb.SMB) or isinstance(SMBObject, smb3.SMB3):
            self.connection = SMBConnection(existingConnection = SMBObject)
        else:
            self.connection = SMBObject

        self.share = '' 
开发者ID:eth0izzle,项目名称:cracke-dit,代码行数:16,代码来源:serviceinstall.py

示例6: __init__

# 需要导入模块: from impacket import smb3 [as 别名]
# 或者: from impacket.smb3 import SMB3 [as 别名]
def __init__(self, config, SMBClient, username):
        self.username = username
        ProtocolAttack.__init__(self, config, SMBClient, username)
        if isinstance(SMBClient, smb.SMB) or isinstance(SMBClient, smb3.SMB3):
            self.__SMBConnection = SMBConnection(existingConnection=SMBClient)
        else:
            self.__SMBConnection = SMBClient
        self.__answerTMP = ''
        if self.config.interactive:
            #Launch locally listening interactive shell
            self.tcpshell = TcpShell()
        else:
            self.tcpshell = None
            if self.config.exeFile is not None:
                self.installService = serviceinstall.ServiceInstall(SMBClient, self.config.exeFile) 
开发者ID:Ridter,项目名称:GhostPotato,代码行数:17,代码来源:smbattack.py

示例7: __init__

# 需要导入模块: from impacket import smb3 [as 别名]
# 或者: from impacket.smb3 import SMB3 [as 别名]
def __init__(self, config, SMBClient, username):
        ProtocolAttack.__init__(self, config, SMBClient, username)
        if isinstance(SMBClient, smb.SMB) or isinstance(SMBClient, smb3.SMB3):
            self.__SMBConnection = SMBConnection(existingConnection=SMBClient)
        else:
            self.__SMBConnection = SMBClient
        self.__answerTMP = ''
        if self.config.interactive:
            #Launch locally listening interactive shell
            self.tcpshell = TcpShell()
        else:
            self.tcpshell = None
            if self.config.exeFile is not None:
                self.installService = serviceinstall.ServiceInstall(SMBClient, self.config.exeFile) 
开发者ID:Ridter,项目名称:Exchange2domain,代码行数:16,代码来源:smbattack.py

示例8: __init__

# 需要导入模块: from impacket import smb3 [as 别名]
# 或者: from impacket.smb3 import SMB3 [as 别名]
def __init__(self, config, SMBClient, username):
        Thread.__init__(self)
        self.daemon = True
        if isinstance(SMBClient, smb.SMB) or isinstance(SMBClient, smb3.SMB3):
            self.__SMBConnection = SMBConnection(existingConnection=SMBClient)
        else:
            self.__SMBConnection = SMBClient
        self.config = config 
开发者ID:skorov,项目名称:ridrelay,代码行数:10,代码来源:ridrelay.py

示例9: __init__

# 需要导入模块: from impacket import smb3 [as 别名]
# 或者: from impacket.smb3 import SMB3 [as 别名]
def __init__(self, SMBClient, exeFile, command):
        Thread.__init__(self)

        if isinstance(SMBClient, SMB) or isinstance(SMBClient, SMB3):
            self.__SMBConnection = SMBConnection(existingConnection = SMBClient)
        else:
            self.__SMBConnection = SMBClient

        self.__exeFile = exeFile
        self.__command = command
        self.__answerTMP = b''
        if exeFile is not None:
            self.installService = serviceinstall.ServiceInstall(SMBClient, exeFile) 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:15,代码来源:smbrelayx.py

示例10: __init__

# 需要导入模块: from impacket import smb3 [as 别名]
# 或者: from impacket.smb3 import SMB3 [as 别名]
def __init__(self, SMBObject, exeFile, serviceName=''):
        self._rpctransport = 0
        self.__service_name = serviceName if len(serviceName) > 0  else  ''.join([random.choice(string.ascii_letters) for i in range(4)])
        self.__binary_service_name = ''.join([random.choice(string.ascii_letters) for i in range(8)]) + '.exe'
        self.__exeFile = exeFile

        # We might receive two different types of objects, always end up
        # with a SMBConnection one
        if isinstance(SMBObject, smb.SMB) or isinstance(SMBObject, smb3.SMB3):
            self.connection = SMBConnection(existingConnection = SMBObject)
        else:
            self.connection = SMBObject

        self.share = '' 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:16,代码来源:serviceinstall.py

示例11: __init__

# 需要导入模块: from impacket import smb3 [as 别名]
# 或者: from impacket.smb3 import SMB3 [as 别名]
def __init__(self, SMBClient, exeFile, command):
        Thread.__init__(self)

        if isinstance(SMBClient, SMB) or isinstance(SMBClient, SMB3):
            self.__SMBConnection = SMBConnection(existingConnection = SMBClient)
        else:
            self.__SMBConnection = SMBClient

        self.__exeFile = exeFile
        self.__command = command
        self.__answerTMP = ''
        if exeFile is not None:
            self.installService = serviceinstall.ServiceInstall(SMBClient, exeFile) 
开发者ID:tholum,项目名称:PiBunny,代码行数:15,代码来源:smbrelayx.py

示例12: request_SMBv23

# 需要导入模块: from impacket import smb3 [as 别名]
# 或者: from impacket.smb3 import SMB3 [as 别名]
def request_SMBv23(host, port=445):

  # start client
  smb_client = smb3.SMB3(host, host, sess_port=port)
  
  # start: modified from login()
  # https://github.com/SecureAuthCorp/impacket/blob/master/impacket/smb3.py
  
  session_setup = smb3.SMB2SessionSetup()
  
  if smb_client.RequireMessageSigning is True:
    session_setup['SecurityMode'] = smb3.SMB2_NEGOTIATE_SIGNING_REQUIRED
  else:
    session_setup['SecurityMode'] = smb3.SMB2_NEGOTIATE_SIGNING_ENABLED
  
  session_setup['Flags'] = 0
  
  ## NTLMSSP
  blob = smb3.SPNEGO_NegTokenInit()
  blob['MechTypes'] = [smb3.TypesMech['NTLMSSP - Microsoft NTLM Security Support Provider']]
  
  auth = ntlm.getNTLMSSPType1(smb_client._Connection['ClientName'], '',
            smb_client._Connection['RequireSigning'])
  blob['MechToken'] = auth.getData()

  session_setup['SecurityBufferLength'] = len(blob)
  session_setup['Buffer']               = blob.getData()
  
  packet = smb_client.SMB_PACKET()
  packet['Command'] = smb3.SMB2_SESSION_SETUP
  packet['Data']    = session_setup
  
  packet_id = smb_client.sendSMB(packet)
  
  smb_response = smb_client.recvSMB(packet_id)

  if smb_client._Connection['Dialect'] == smb3.SMB2_DIALECT_311:
      smb_client.__UpdatePreAuthHash(smb_response.rawData)
  
  ## NTLM challenge
  if smb_response.isValidAnswer(smb3.STATUS_MORE_PROCESSING_REQUIRED):
    session_setup_response = smb3.SMB2SessionSetup_Response(smb_response['Data'])
    resp_token = smb3.SPNEGO_NegTokenResp(session_setup_response['Buffer'])

    return resp_token['ResponseToken']

  else:
    return None 
开发者ID:b17zr,项目名称:ntlm_challenger,代码行数:50,代码来源:ntlm_challenger.py


注:本文中的impacket.smb3.SMB3属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。