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

10
nlmp.go
View File

@@ -10,8 +10,9 @@ package ntlmssp
import (
"crypto/hmac"
"crypto/md5"
"golang.org/x/crypto/md4"
"strings"
"golang.org/x/crypto/md4"
)
func getNtlmV2Hash(password, username, target string) []byte {
@@ -28,13 +29,20 @@ func computeNtlmV2Response(ntlmV2Hash, serverChallenge, clientChallenge,
timestamp, targetInfo []byte) []byte {
temp := []byte{1, 1, 0, 0, 0, 0, 0, 0}
PrintDebug("NTLMv2 response", temp)
temp = append(temp, timestamp...)
PrintDebug("NTLMv2 response", temp)
temp = append(temp, clientChallenge...)
PrintDebug("NTLMv2 response", temp)
temp = append(temp, 0, 0, 0, 0)
PrintDebug("NTLMv2 response", temp)
temp = append(temp, targetInfo...)
PrintDebug("NTLMv2 response", temp)
temp = append(temp, 0, 0, 0, 0)
PrintDebug("NTLMv2 response", temp)
NTProofStr := hmacMd5(ntlmV2Hash, serverChallenge, temp)
PrintDebug("Proof string", NTProofStr)
return append(NTProofStr, temp...)
}