@staticmethod<EOL><INDENT>def _get_NTLMv2_response(user_name, password, domain_name,<EOL>server_challenge, client_challenge, timestamp,<EOL>target_info):<DEDENT>
nt_hash = comphash._ntowfv2(user_name, password, domain_name)<EOL>temp = ComputeResponse._get_NTLMv2_temp(timestamp, client_challenge,<EOL>target_info)<EOL>nt_proof_str = hmac.new(nt_hash,<EOL>(server_challenge + temp),<EOL>digestmod=hashlib.md5).digest()<EOL>response = nt_proof_str + temp<EOL>session_base_key = hmac.new(nt_hash, nt_proof_str,<EOL>digestmod=hashlib.md5).digest()<EOL>return response, session_base_key<EOL>
[MS-NLMP] v28.0 2016-07-14

2.2.2.8 NTLM V2 Response: NTLMv2_RESPONSE
The NTLMv2_RESPONSE strucutre defines the NTLMv2 authentication
NtChallengeResponse in the AUTHENTICATE_MESSAGE. This response is used
only when NTLMv2 authentication is configured.

The guide on how this is computed is in 3.3.2 NTLM v2 Authentication.

:param user_name: The user name of the user we are trying to
    authenticate with
:param password: The password of the user we are trying to authenticate
    with
:param domain_name: The domain name of the user account we are
    authenticated with
:param server_challenge: A random 8-byte response generated by the
    server in the CHALLENGE_MESSAGE
:param client_challenge: A random 8-byte response generated by the
    client for the AUTHENTICATE_MESSAGE
:param timestamp: An 8-byte timestamp in windows format, 100
    nanoseconds since 1601-01-01
:param target_info: The target_info structure from the
    CHALLENGE_MESSAGE with the CBT attached if required
:return response: NtChallengeResponse to the server_challenge
:return session_base_key: A session key calculated from the user
    password challenge