diff options
author | Bryan McNulty <bryanmcnulty@protonmail.com> | 2025-03-08 06:07:29 -0600 |
---|---|---|
committer | Bryan McNulty <bryanmcnulty@protonmail.com> | 2025-03-08 06:07:29 -0600 |
commit | 7574b7370be083ff563fa8ad6d01d5ac776d7e4d (patch) | |
tree | 78aeb5d671e35aee8780fd92b2511cad00efd67d /internal/exec/wmi/exec.go | |
parent | d8eca7209d000609fea08d2973a402a41a4cf921 (diff) | |
download | goexec-7574b7370be083ff563fa8ad6d01d5ac776d7e4d.tar.gz goexec-7574b7370be083ff563fa8ad6d01d5ac776d7e4d.zip |
Add a bunch of DCE related options to TSCH module
Diffstat (limited to 'internal/exec/wmi/exec.go')
-rw-r--r-- | internal/exec/wmi/exec.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/exec/wmi/exec.go b/internal/exec/wmi/exec.go index 962fc60..5f47738 100644 --- a/internal/exec/wmi/exec.go +++ b/internal/exec/wmi/exec.go @@ -34,11 +34,14 @@ var ( func (mod *Module) Cleanup(ctx context.Context, _ *exec.CleanupConfig) (err error) { log := zerolog.Ctx(ctx).With(). + Str("module", "tsch"). Str("func", "Cleanup").Logger() if err = mod.dce.Close(ctx); err != nil { log.Warn().Err(err).Msg("Failed to close DCERPC connection") } + mod.sc = nil + mod.dce = nil return } @@ -50,6 +53,7 @@ func (mod *Module) Connect(ctx context.Context, creds *adauth.Credential, target ctx = gssapi.NewSecurityContext(ctx) log := zerolog.Ctx(ctx).With(). + Str("module", "tsch"). Str("func", "Connect").Logger() // Assemble DCERPC options @@ -81,7 +85,7 @@ func (mod *Module) Connect(ctx context.Context, creds *adauth.Credential, target // Create DCERPC dialer mod.dce, err = dcerpc.Dial(ctx, target.AddressWithoutPort(), append(baseOpts, append(authOpts, dcerpc.WithEndpoint(rb))...)...) if err != nil { - return fmt.Errorf("DCERPC dial: %w", err) + return fmt.Errorf("create DCERPC dialer: %w", err) } // Create remote activation client ia, err := iactivation.NewActivationClient(ctx, mod.dce, append(baseOpts, dcerpc.WithEndpoint(rb))...) |