def __init__(self, msg2):
self.data = msg2<EOL>self.signature = msg2[<NUM_LIT:0>:<NUM_LIT:8>]<EOL>self.message_type = struct.unpack("<STR_LIT>", msg2[<NUM_LIT:8>:<NUM_LIT:12>])[<NUM_LIT:0>]<EOL>self.negotiate_flags = struct.unpack("<STR_LIT>", msg2[<NUM_LIT:20>:<NUM_LIT>])[<NUM_LIT:0>]<EOL>self.server_challenge = msg2[<NUM_LIT>:<NUM_LIT:32>]<EOL>self.reserved = msg2[<NUM_LIT:32>:<NUM_LIT>]<EOL>if self.negotiate_flags &NegotiateFlags.NTLMSSP_NEGOTIATE_VERSION andself.negotiate_flags &NegotiateFlags.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY andlen(msg2) > <NUM_LIT>:<EOL><INDENT>self.version = struct.unpack("<STR_LIT>", msg2[<NUM_LIT>:<NUM_LIT>])[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>self.version = None<EOL><DEDENT>if self.negotiate_flags & NegotiateFlags.NTLMSSP_REQUEST_TARGET:<EOL><INDENT>target_name_len = struct.unpack("<STR_LIT>", msg2[<NUM_LIT:12>:<NUM_LIT>])[<NUM_LIT:0>]<EOL>target_name_max_len = struct.unpack("<STR_LIT>", msg2[<NUM_LIT>:<NUM_LIT:16>])[<NUM_LIT:0>]<EOL>target_name_offset_mix = struct.unpack("<STR_LIT>", msg2[<NUM_LIT:16>:<NUM_LIT:20>])[<NUM_LIT:0>]<EOL>target_offset_max = target_name_offset_mix + target_name_len<EOL>self.target_name = msg2[target_name_offset_mix:target_offset_max]<EOL><DEDENT>else:<EOL><INDENT>self.target_name = None<EOL><DEDENT>if self.negotiate_flags & NegotiateFlags.NTLMSSP_NEGOTIATE_TARGET_INFO:<EOL><INDENT>target_info_len = struct.unpack("<STR_LIT>", msg2[<NUM_LIT>:<NUM_LIT>])[<NUM_LIT:0>]<EOL>target_info_max_len = struct.unpack("<STR_LIT>", msg2[<NUM_LIT>:<NUM_LIT>])[<NUM_LIT:0>]<EOL>target_info_offset_min = struct.unpack("<STR_LIT>", msg2[<NUM_LIT>:<NUM_LIT>])[<NUM_LIT:0>]<EOL>target_info_offset_max = target_info_offset_min + target_info_len<EOL>target_info_raw =msg2[target_info_offset_min:target_info_offset_max]<EOL>self.target_info = TargetInfo()<EOL>self.target_info.unpack(target_info_raw)<EOL><DEDENT>else:<EOL><INDENT>self.target_info = None<EOL><DEDENT>assert self.signature == NTLM_SIGNATURE<EOL>assert self.message_type == MessageTypes.NTLM_CHALLENGE<EOL>
[MS-NLMP] v28.0 2016-07-14

2.2.1.2 CHALLENGE_MESSAGE
The CHALLENGE_MESSAGE defines an NTLM challenge message that is sent
from the server to the client. The CHALLENGE_MESSAGE is used by the
server to challenge the client to prove its identity, For
connection-oriented requests, the CHALLENGE_MESSAGE generated by the
server is in response to the NEGOTIATE_MESSAGE from the client.

:param msg2: The CHALLENGE_MESSAGE received from the server after
    sending our NEGOTIATE_MESSAGE. This has been decoded from a base64
    string

Attributes
    signature: An 8-byte character array that MUST contain the ASCII
        string 'NTLMSSP\0'
    message_type: A 32-bit unsigned integer that indicates the message
        type. This field must be set to 0x00000002
    negotiate_flags: A NEGOTIATE strucutre that contains a set of bit
        flags. The server sets flags to indicate options it supports
    server_challenge: A 64-bit value that contains the NTLM challenge.
        The challenge is a 64-bit nonce. Used in the
        AuthenticateMessage message
    reserved: An 8-byte array whose elements MUST be zero when sent and
        MUST be ignored on receipt
    version: When NTLMSSP_NEGOTIATE_VERSION flag is set in
        negotiate_flags field which contains the windows version info.
        Used only for debugging purposes
    target_name: When NTLMSSP_REQUEST_TARGET is set is a byte array
        that contains the name of the server authentication realm. In a
        domain environment this is the domain name not server name
    target_info: When NTLMSSP_NEGOTIATE_TARGET_INFO is set is a byte
        array that contains a sequence of AV_PAIR structures