tenta usar valores corretos

This commit is contained in:
Luiz Costa 2023-10-22 23:20:38 +01:00
parent 7ac042d69a
commit 2cf334bd14

View File

@ -6,6 +6,7 @@ import (
"bytes" "bytes"
rc4P "crypto/rc4" rc4P "crypto/rc4"
"encoding/binary" "encoding/binary"
"encoding/hex"
"fmt" "fmt"
"log" "log"
"os/exec" "os/exec"
@ -245,11 +246,14 @@ func (n *V2ServerSession) ProcessAuthenticateMessage(am *AuthenticateMessage) (e
return err return err
} }
log.Printf("DEBUG: challenge Server: %s\n", string(n.serverChallenge)) hexServerChallenge := hex.EncodeToString(n.serverChallenge)
log.Printf("DEBUG: ntChallengeResponse: %s\n", string(n.ntChallengeResponse)) hexClientChallenge := hex.EncodeToString(n.clientChallenge)
log.Printf("DEBUG: challenge Server: %v\n", hexServerChallenge)
log.Printf("DEBUG: ntChallengeResponse: %v\n", hexClientChallenge))
// Execute ntlm_auth to check user auth // Execute ntlm_auth to check user auth
cmd := exec.Command("/usr/local/bin/ntlm_auth", "--domain="+n.userDomain, "--username="+n.user, "--challenge="+string(n.serverChallenge), "--nt-response="+string(n.ntChallengeResponse)) cmd := exec.Command("/usr/local/bin/ntlm_auth", "--domain="+n.userDomain, "--username="+n.user, "--challenge="+hexServerChallenge, "--nt-response="+hexClientChallenge)
output, err := cmd.CombinedOutput() output, err := cmd.CombinedOutput()
if err != nil { if err != nil {
fmt.Printf("Failed to execute command: %s\n", err) fmt.Printf("Failed to execute command: %s\n", err)