References: =========== - [MS-NLMP]: 2.2.1.2 - [MS-NLMP]: 2.2.2.1 (AV_PAIR)
(ntlm_data)
| 137 | |
| 138 | |
| 139 | def 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 | |
| 161 | def generateChallengeResponseV2(password, user, server_challenge, server_info, domain = '', client_challenge = None): |
nothing calls this directly
no outgoing calls
no test coverage detected