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


Python ntlm.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY属性代码示例

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


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

示例1: __init__

# 需要导入模块: from impacket import ntlm [as 别名]
# 或者: from impacket.ntlm import NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY [as 别名]
def __init__(self, flags, randomSessionKey):
            self.__flags = flags
            if self.__flags & ntlm.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY:
                self.__clientSigningKey = ntlm.SIGNKEY(self.__flags, randomSessionKey)
                self.__serverSigningKey = ntlm.SIGNKEY(self.__flags, randomSessionKey,"Server")
                self.__clientSealingKey = ntlm.SEALKEY(self.__flags, randomSessionKey)
                self.__serverSealingKey = ntlm.SEALKEY(self.__flags, randomSessionKey,"Server")
                # Preparing the keys handle states
                cipher3 = ARC4.new(self.__clientSealingKey)
                self.__clientSealingHandle = cipher3.encrypt
                cipher4 = ARC4.new(self.__serverSealingKey)
                self.__serverSealingHandle = cipher4.encrypt
            else:
                # Same key for everything
                self.__clientSigningKey = randomSessionKey
                self.__serverSigningKey = randomSessionKey
                self.__clientSealingKey = randomSessionKey
                self.__clientSealingKey = randomSessionKey
                cipher = ARC4.new(self.__clientSigningKey)
                self.__clientSealingHandle = cipher.encrypt
                self.__serverSealingHandle = cipher.encrypt
            self.__sequence = 0 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:24,代码来源:rdp_check.py

示例2: encrypt

# 需要导入模块: from impacket import ntlm [as 别名]
# 或者: from impacket.ntlm import NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY [as 别名]
def encrypt(self, plain_data):
            if self.__flags & ntlm.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY:
                # When NTLM2 is on, we sign the whole pdu, but encrypt just
                # the data, not the dcerpc header. Weird..
                sealedMessage, signature =  ntlm.SEAL(self.__flags, 
                       self.__clientSigningKey, 
                       self.__clientSealingKey,  
                       plain_data, 
                       plain_data, 
                       self.__sequence, 
                       self.__clientSealingHandle)
            else:
                sealedMessage, signature =  ntlm.SEAL(self.__flags, 
                       self.__clientSigningKey, 
                       self.__clientSealingKey,  
                       plain_data, 
                       plain_data, 
                       self.__sequence, 
                       self.__clientSealingHandle)

            self.__sequence += 1

            return signature, sealedMessage 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:25,代码来源:rdp_check.py

示例3: decrypt

# 需要导入模块: from impacket import ntlm [as 别名]
# 或者: from impacket.ntlm import NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY [as 别名]
def decrypt(self, answer):
            if self.__flags & ntlm.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY:
                # TODO: FIX THIS, it's not calculating the signature well
                # Since I'm not testing it we don't care... yet
                answer, signature =  ntlm.SEAL(self.__flags, 
                        self.__serverSigningKey, 
                        self.__serverSealingKey,  
                        answer, 
                        answer, 
                        self.__sequence, 
                        self.__serverSealingHandle)
            else:
                answer, signature = ntlm.SEAL(self.__flags, 
                        self.__serverSigningKey, 
                        self.__serverSealingKey, 
                        answer, 
                        answer, 
                        self.__sequence, 
                        self.__serverSealingHandle)
                self.__sequence += 1

            return signature, answer 
开发者ID:Coalfire-Research,项目名称:Slackor,代码行数:24,代码来源:rdp_check.py

示例4: getExtended

# 需要导入模块: from impacket import ntlm [as 别名]
# 或者: from impacket.ntlm import NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY [as 别名]
def getExtended(self):
		#
		return (self.RESPONSE_INFO['flags'] & ntlm.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY == ntlm.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY) 
开发者ID:quickbreach,项目名称:SMBetray,代码行数:5,代码来源:SMB_Core.py


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