diff options
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" +) |