dcerpcauth: Add option to disable SPNEGO

This commit is contained in:
Erik Geiser
2025-07-18 08:52:52 +02:00
parent ccb9193b06
commit 28097c2658
+6 -1
View File
@@ -37,6 +37,9 @@ type Options struct {
// Debug can be set to enable debug output, for example with
// adauth.NewDebugFunc(...).
Debug func(string, ...any)
// Use raw NTLM and Kerberos instead of wrapping it in SPNEGO.
DisableSPNEGO bool
}
func (opts *Options) debug(format string, a ...any) {
@@ -63,7 +66,9 @@ func AuthenticationOptions(
return nil, err
}
dcerpcOptions = append(dcerpcOptions, dcerpc.WithMechanism(ssp.SPNEGO))
if !upstreamOptions.DisableSPNEGO {
dcerpcOptions = append(dcerpcOptions, dcerpc.WithMechanism(ssp.SPNEGO))
}
switch {
case target.UseKerberos || creds.ClientCert != nil: