Example #1
0
    def test_expected_failure(self):
        ResponseKeyLM = ResponseKeyNT = create_NT_hashed_password_v2(Password, User, Domain)
        (NTLMv2Response, LMv2Response) = ComputeResponse(ResponseKeyNT, ResponseKeyLM, ServerChallenge, ServerName, ClientChallenge, Time)

        # expected failure
        # According to the spec in section '3.3.2 NTLM v2 Authentication' the NTLMv2Response
        # should be longer than the value given on page 77 (this suggests a mistake in the spec)
        # [MS-NLMP] page 77
        assert HexToByte("68 cd 0a b8 51 e5 1c 96 aa bc 92 7b eb ef 6a 1c") == \
            NTLMv2Response, "\nExpected: 68 cd 0a b8 51 e5 1c 96 aa bc 92 7b eb ef 6a 1c\nActual:   %s" % ByteToHex(NTLMv2Response)
Example #2
0
 def test_response_to_NTLM_v2(self):
     # [MS-NLMP] page 76
     ResponseKeyLM = ResponseKeyNT = create_NT_hashed_password_v2(
         Password, User, Domain)
     (NTLMv2Response,
      LMv2Response) = ComputeResponse(ResponseKeyNT, ResponseKeyLM,
                                      ServerChallenge, ServerName,
                                      ClientChallenge, Time)
     assert HexToByte(
         "86 c3 50 97 ac 9c ec 10 25 54 76 4a 57 cc cc 19 aa aa aa aa aa aa aa aa"
     ) == LMv2Response
Example #3
0
    def test_expected_failure(self):
        ResponseKeyLM = ResponseKeyNT = create_NT_hashed_password_v2(
            Password, User, Domain)
        (NTLMv2Response,
         LMv2Response) = ComputeResponse(ResponseKeyNT, ResponseKeyLM,
                                         ServerChallenge, ServerName,
                                         ClientChallenge, Time)

        # expected failure
        # According to the spec in section '3.3.2 NTLM v2 Authentication' the NTLMv2Response
        # should be longer than the value given on page 77 (this suggests a mistake in the spec)
        # [MS-NLMP] page 77
        assert HexToByte("68 cd 0a b8 51 e5 1c 96 aa bc 92 7b eb ef 6a 1c") == \
            NTLMv2Response, "\nExpected: 68 cd 0a b8 51 e5 1c 96 aa bc 92 7b eb ef 6a 1c\nActual:   %s" % ByteToHex(NTLMv2Response)
Example #4
0
 def test_NT_hashed_password_v2(self):
     # [MS-NLMP] page 76
     assert HexToByte("0c 86 8a 40 3b fd 7a 93 a3 00 1e f2 2e f0 2e 3f"
                      ) == create_NT_hashed_password_v2(
                          Password, User, Domain)
Example #5
0
 def test_response_to_NTLM_v2(self):
     # [MS-NLMP] page 76
     ResponseKeyLM = ResponseKeyNT = create_NT_hashed_password_v2(Password, User, Domain)
     (NTLMv2Response, LMv2Response) = ComputeResponse(ResponseKeyNT, ResponseKeyLM, ServerChallenge, ServerName, ClientChallenge, Time)
     assert HexToByte("86 c3 50 97 ac 9c ec 10 25 54 76 4a 57 cc cc 19 aa aa aa aa aa aa aa aa") == LMv2Response
Example #6
0
 def test_NT_hashed_password_v2(self):
     # [MS-NLMP] page 76
     assert HexToByte("0c 86 8a 40 3b fd 7a 93 a3 00 1e f2 2e f0 2e 3f") == create_NT_hashed_password_v2(Password, User, Domain)