code: public static byte[] getNTLM2SessionResponse(String password,
              byte[] challenge, byte[] clientNonce) throws Exception {
          byte[] ntlmHash = ntlmHash(password);
          MessageDigest md5 = MessageDigest.getInstance("MD5");
          md5.update(challenge);
          md5.update(clientNonce);
          byte[] sessionHash = new byte[8];
          System.arraycopy(md5.digest(), 0, sessionHash, 0, 8);
          return lmResponse(ntlmHash, sessionHash);
      }
docs: Calculates the NTLM2 Session Response for the given challenge, using the
  specified password and client nonce.
  
  @param password The user's password.
  @param challenge The Type 2 challenge from the server.
  @param clientNonce The random 8-byte client nonce.
  
  @return The NTLM2 Session Response.  This is placed in the NTLM
  response field of the Type 3 message; the LM response field contains
  the client nonce, null-padded to 24 bytes.