本文整理汇总了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)))
示例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)))