diff options
-rw-r--r-- | pkg/goexec/smb/options.go | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/pkg/goexec/smb/options.go b/pkg/goexec/smb/options.go index 4112abf..ce99bc7 100644 --- a/pkg/goexec/smb/options.go +++ b/pkg/goexec/smb/options.go @@ -8,7 +8,6 @@ import ( "github.com/RedTeamPentesting/adauth/smbauth" msrpcSMB2 "github.com/oiweiwei/go-msrpc/smb2" "github.com/oiweiwei/go-smb2.fork" - "net" ) var supportedDialects = map[msrpcSMB2.Dialect]msrpcSMB2.Dialect{ @@ -47,29 +46,14 @@ func (c *Client) Parse(ctx context.Context) (err error) { var do []msrpcSMB2.DialerOption - if c.Port == 0 { - c.Port = DefaultPort - } - if c.Dialect == 0 { - c.Dialect = DefaultDialect - } - - // Validate SMB dialect/version - if d, ok := supportedDialects[c.Dialect]; ok { - do = append(do, msrpcSMB2.WithDialect(d)) - - } else { - return errors.New("unsupported SMB version") - } + if c.Dialect != 0 { // Use specific dialect - if c.Proxy == "" { - c.netDialer = &net.Dialer{} // FUTURE: additional dial c + // Validate SMB dialect/version + if d, ok := supportedDialects[c.Dialect]; ok { + do = append(do, msrpcSMB2.WithDialect(d)) - } else { - // Parse proxy URL - c.netDialer, err = goexec.ParseProxyURI(c.Proxy) - if err != nil { - return err + } else { + return errors.New("unsupported SMB version") } } |