diff options
author | Bryan McNulty <bryanmcnulty@protonmail.com> | 2025-03-01 20:50:04 -0600 |
---|---|---|
committer | Bryan McNulty <bryanmcnulty@protonmail.com> | 2025-03-01 20:50:04 -0600 |
commit | 6dcae18a99ba7f7ca44c246d0e72b4d9410eb60c (patch) | |
tree | 2c9d4e482cb42d820f853a1bc2e92205b9eeba50 /pkg/exec/tsch/module.go | |
parent | 50393c546010da3745b1d80f156aeb713f3411dc (diff) | |
download | goexec-6dcae18a99ba7f7ca44c246d0e72b4d9410eb60c.tar.gz goexec-6dcae18a99ba7f7ca44c246d0e72b4d9410eb60c.zip |
Added tsch module
Diffstat (limited to 'pkg/exec/tsch/module.go')
-rw-r--r-- | pkg/exec/tsch/module.go | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/pkg/exec/tsch/module.go b/pkg/exec/tsch/module.go new file mode 100644 index 0000000..3112902 --- /dev/null +++ b/pkg/exec/tsch/module.go @@ -0,0 +1,56 @@ +package tschexec + +import ( + "context" + "github.com/FalconOpsLLC/goexec/pkg/client/dcerpc" + "github.com/bryanmcnulty/adauth" + "github.com/oiweiwei/go-msrpc/msrpc/tsch/itaskschedulerservice/v1" + "github.com/rs/zerolog" + "time" +) + +type Step struct { + Name string // Name of the step + Status string // Status indicates whether the task succeeded, failed, etc. + Call func(context.Context, *Module, ...any) (interface{}, error) // Call will invoke the procedure + Match func(context.Context, *Module, ...any) (bool, error) // Match will make an assertion to determine whether the step was successful +} + +type Module struct { + creds *adauth.Credential + target *adauth.Target + + log zerolog.Logger + dce *dcerpc.DCEClient + tsch itaskschedulerservice.TaskSchedulerServiceClient +} + +type MethodRegisterConfig struct { + NoDelete bool + CallDelete bool + TaskName string + TaskPath string + StartDelay time.Duration + StopDelay time.Duration + DeleteDelay time.Duration +} + +type MethodDemandConfig struct { + NoDelete bool + CallDelete bool + TaskName string + TaskPath string + StopDelay time.Duration + DeleteDelay time.Duration +} + +type MethodDeleteConfig struct { + TaskPath string +} + +const ( + MethodRegister string = "register" + MethodDemand string = "demand" + MethodDelete string = "delete" + MethodChange string = "update" +) |