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


Python ntlm.generateNegotiateMessage方法代码示例

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


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

示例1: _handleNegotiateResponse_SMB1

# 需要导入模块: import ntlm [as 别名]
# 或者: from ntlm import generateNegotiateMessage [as 别名]
def _handleNegotiateResponse_SMB1(self, message):
        if message.uid and not self.uid:
            self.uid = message.uid

        if message.hasExtendedSecurity or message.payload.supportsExtendedSecurity:
            ntlm_data = ntlm.generateNegotiateMessage()
            blob = securityblob.generateNegotiateSecurityBlob(ntlm_data)
            self._sendSMBMessage(SMBMessage(ComSessionSetupAndxRequest__WithSecurityExtension(message.payload.session_key, blob)))
        else:
            nt_password, _, _ = ntlm.generateChallengeResponseV1(self.password, message.payload.challenge, False)
            self.log.info('Performing NTLMv1 authentication (without extended security) with challenge "%s" and hashed password of "%s"',
                          binascii.hexlify(message.payload.challenge),
                          binascii.hexlify(nt_password))
            self._sendSMBMessage(SMBMessage(ComSessionSetupAndxRequest__NoSecurityExtension(message.payload.session_key,
                                                                                           self.username,
                                                                                           nt_password,
                                                                                           True,
                                                                                           self.domain))) 
开发者ID:ysrc,项目名称:xunfeng,代码行数:20,代码来源:base.py

示例2: _handleNegotiateResponse_SMB2

# 需要导入模块: import ntlm [as 别名]
# 或者: from ntlm import generateNegotiateMessage [as 别名]
def _handleNegotiateResponse_SMB2(self, message):
        ntlm_data = ntlm.generateNegotiateMessage()
        blob = securityblob.generateNegotiateSecurityBlob(ntlm_data)
        self._sendSMBMessage(SMB2Message(SMB2SessionSetupRequest(blob))) 
开发者ID:ysrc,项目名称:xunfeng,代码行数:6,代码来源:base.py


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