debugging

This commit is contained in:
2025-03-17 09:48:17 +11:00
parent befb826740
commit f8cadb2287
3 changed files with 17 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package ntlmssp
import (
"bytes"
"crypto/rand"
"encoding/base64"
"encoding/binary"
"errors"
"time"
@@ -86,6 +87,10 @@ func ProcessChallenge(challengeMessageData []byte, user, password string) ([]byt
return nil, errors.New("Anonymous authentication not supported")
}
// debugging
PrintDebug("Received NTLM Type 2 Challenge: %s", base64.StdEncoding.EncodeToString(challengeMessageData))
DecodeNTLMMessage(challengeMessageData)
var cm challengeMessage
if err := cm.UnmarshalBinary(challengeMessageData); err != nil {
PrintDebug("Failed to unmarshal challenge data")
@@ -119,7 +124,7 @@ func ProcessChallenge(challengeMessageData []byte, user, password string) ([]byt
rand.Reader.Read(clientChallenge)
ntlmV2Hash := getNtlmV2Hash(password, user, cm.TargetName)
PrintDebug("NTLM V2 hash '%s'", ntlmV2Hash)
PrintDebug("NTLM V2 hash '%s'", base64.StdEncoding.EncodeToString(ntlmV2Hash))
am.NtChallengeResponse = computeNtlmV2Response(ntlmV2Hash,
cm.ServerChallenge[:], clientChallenge, timestamp, cm.TargetInfoRaw)