aboutsummaryrefslogtreecommitdiff
path: root/internal/exec/scmr
diff options
context:
space:
mode:
authorBryan McNulty <bryanmcnulty@protonmail.com>2025-03-10 16:04:08 -0500
committerBryan McNulty <bryanmcnulty@protonmail.com>2025-03-10 16:04:08 -0500
commit11741c4cde3d552211fbb04eddd719b3dc3bd472 (patch)
tree52f28ca2feacde039b7215fa3fd27b5a7ec02ed5 /internal/exec/scmr
parentab141f2076b141bf885f56cb5730252cc2880041 (diff)
downloadgoexec-11741c4cde3d552211fbb04eddd719b3dc3bd472.tar.gz
goexec-11741c4cde3d552211fbb04eddd719b3dc3bd472.zip
Added basic dcom execution module
Diffstat (limited to 'internal/exec/scmr')
-rw-r--r--internal/exec/scmr/exec.go2
-rw-r--r--internal/exec/scmr/service.go26
2 files changed, 13 insertions, 15 deletions
diff --git a/internal/exec/scmr/exec.go b/internal/exec/scmr/exec.go
index 7134df0..656b212 100644
--- a/internal/exec/scmr/exec.go
+++ b/internal/exec/scmr/exec.go
@@ -27,7 +27,6 @@ func (mod *Module) Connect(ctx context.Context, creds *adauth.Credential, target
if cfg, ok := ccfg.ConnectionMethodConfig.(dce.ConnectionMethodDCEConfig); !ok {
return fmt.Errorf("invalid configuration for DCE connection method")
} else {
-
// Fetch target hostname - for opening SCM handle
if mod.hostname, err = target.Hostname(ctx); err != nil {
log.Debug().Err(err).Msg("Failed to get target hostname")
@@ -157,7 +156,6 @@ func (mod *Module) Cleanup(ctx context.Context, ccfg *exec.CleanupConfig) (err e
func (mod *Module) Exec(ctx context.Context, ecfg *exec.ExecutionConfig) (err error) {
- //vctx := context.WithoutCancel(ctx)
log := zerolog.Ctx(ctx).With().
Str("method", ecfg.ExecutionMethod).
Str("func", "Exec").Logger()
diff --git a/internal/exec/scmr/service.go b/internal/exec/scmr/service.go
index 9a580cb..49c7506 100644
--- a/internal/exec/scmr/service.go
+++ b/internal/exec/scmr/service.go
@@ -1,25 +1,25 @@
package scmrexec
import (
- "context"
- "github.com/FalconOpsLLC/goexec/internal/windows"
- "github.com/oiweiwei/go-msrpc/msrpc/scmr/svcctl/v2"
+ "context"
+ "github.com/FalconOpsLLC/goexec/internal/windows"
+ "github.com/oiweiwei/go-msrpc/msrpc/scmr/svcctl/v2"
)
const (
- ServiceDeleteAccess uint32 = windows.SERVICE_DELETE
- ServiceModifyAccess uint32 = windows.SERVICE_QUERY_CONFIG | windows.SERVICE_CHANGE_CONFIG | windows.SERVICE_STOP | windows.SERVICE_START | windows.SERVICE_DELETE
- ServiceCreateAccess uint32 = windows.SC_MANAGER_CREATE_SERVICE | windows.SERVICE_START | windows.SERVICE_STOP | windows.SERVICE_DELETE
- ServiceAllAccess uint32 = ServiceCreateAccess | ServiceModifyAccess
+ ServiceDeleteAccess uint32 = windows.SERVICE_DELETE
+ ServiceModifyAccess uint32 = windows.SERVICE_QUERY_CONFIG | windows.SERVICE_CHANGE_CONFIG | windows.SERVICE_STOP | windows.SERVICE_START | windows.SERVICE_DELETE
+ ServiceCreateAccess uint32 = windows.SC_MANAGER_CREATE_SERVICE | windows.SERVICE_START | windows.SERVICE_STOP | windows.SERVICE_DELETE
+ ServiceAllAccess uint32 = ServiceCreateAccess | ServiceModifyAccess
)
type remoteService struct {
- name string
- handle *svcctl.Handle
- originalConfig *svcctl.QueryServiceConfigW
- originalState *svcctl.ServiceStatus
+ name string
+ handle *svcctl.Handle
+ originalConfig *svcctl.QueryServiceConfigW
+ originalState *svcctl.ServiceStatus
}
-func (mod *Module) parseServiceDependencies(ctx context.Context, ) (err error) {
- return nil
+func (mod *Module) parseServiceDependencies(ctx context.Context) (err error) {
+ return nil // TODO
}