MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / decodeChallengeMessage

Function decodeChallengeMessage

pager_lib/smb/ntlm.py:139–158  ·  view source on GitHub ↗

References: =========== - [MS-NLMP]: 2.2.1.2 - [MS-NLMP]: 2.2.2.1 (AV_PAIR)

(ntlm_data)

Source from the content-addressed store, hash-verified

137
138
139def decodeChallengeMessage(ntlm_data):
140 """
141 References:
142 ===========
143 - [MS-NLMP]: 2.2.1.2
144 - [MS-NLMP]: 2.2.2.1 (AV_PAIR)
145 """
146 FORMAT = '<8sIHHII8s8sHHI'
147 FORMAT_SIZE = struct.calcsize(FORMAT)
148
149 signature, message_type, \
150 targetname_len, targetname_maxlen, targetname_offset, \
151 flags, challenge, _, \
152 targetinfo_len, targetinfo_maxlen, targetinfo_offset, \
153 = struct.unpack(FORMAT, bytes(ntlm_data[:FORMAT_SIZE]))
154
155 assert signature == b'NTLMSSP\0'
156 assert message_type == 0x02
157
158 return challenge, flags, bytes(ntlm_data[targetinfo_offset:targetinfo_offset+targetinfo_len])
159
160
161def generateChallengeResponseV2(password, user, server_challenge, server_info, domain = '', client_challenge = None):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected