aboutsummaryrefslogtreecommitdiff
path: root/internal/exec/scmr/module.go
blob: 2a2d37878650b13b72dfd7778e0805341a875d9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package scmrexec

import (
  "context"
  "github.com/oiweiwei/go-msrpc/dcerpc"
  "github.com/oiweiwei/go-msrpc/msrpc/scmr/svcctl/v2"
)

const (
  MethodCreate = "create"
  MethodChange = "change"

  CleanupMethodDelete = "delete"
  CleanupMethodRevert = "revert"
)

type Module struct {
  hostname  string // The target hostname
  dce       dcerpc.Conn
  reconnect func(context.Context) error

  ctl      svcctl.SvcctlClient
  scm      *svcctl.Handle
  services []remoteService
}

type MethodCreateConfig struct {
  NoDelete    bool
  ServiceName string
  DisplayName string
  ServiceType uint32
  StartType   uint32
}

type MethodChangeConfig struct {
  NoStart     bool
  ServiceName string
}