Versions in this module Expand all Collapse all v0 v0.3.0 Apr 10, 2026 Changes in this version + func MustSingleCall[T any](t testing.TB, h *Harness, method string) (T, metadata.MD) + func MustSingleSessionEvent(t testing.TB, h *Harness) (*clientpb.Event, metadata.MD) + func RequireCallee(t testing.TB, md metadata.MD, want string) + func RequireNoPrimaryCalls(t testing.TB, h *Harness) + func RequireNoSessionEvents(t testing.TB, h *Harness) + func RequireSessionID(t testing.TB, md metadata.MD, want string) + func RunCases(t *testing.T, cases []CommandCase) + func RunClientCases(t *testing.T, cases []CommandCase) + func SessionClone(session *iomclient.Session) *clientpb.Session + func SessionRaw(rawID uint32) []byte + type CommandCase struct + Argv []string + Assert func(testing.TB, *Harness, error) + Name string + Setup func(testing.TB, *Harness) + WantErr string + type Harness struct + Console *core.Console + Recorder *RecorderRPC + Session *iomclient.Session + func NewClientHarness(t testing.TB) *Harness + func NewHarness(t testing.TB) *Harness + func (h *Harness) AddSession(t testing.TB, sessionID string) *iomclient.Session + func (h *Harness) AddTCPPipeline(name, host string, port uint32) + func (h *Harness) Execute(argv ...string) error + func (h *Harness) ExecuteClient(argv ...string) error + func (h *Harness) SetSessionResponse(session *clientpb.Session) + type RecordedCall struct + Metadata metadata.MD + Method string + Request any + type RecorderRPC struct + func NewRecorderRPC() *RecorderRPC + func (r *RecorderRPC) AddContext(ctx context.Context, in *clientpb.Context, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) AddCredential(ctx context.Context, in *clientpb.Context, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) AddDownload(ctx context.Context, in *clientpb.Context, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) AddKeylogger(ctx context.Context, in *clientpb.Context, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) AddPort(ctx context.Context, in *clientpb.Context, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) AddScreenShot(ctx context.Context, in *clientpb.Context, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) AddUpload(ctx context.Context, in *clientpb.Context, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) Broadcast(ctx context.Context, in *clientpb.Event, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) Build(ctx context.Context, in *clientpb.BuildConfig, opts ...grpc.CallOption) (*clientpb.Artifact, error) + func (r *RecorderRPC) Bypass(ctx context.Context, in *implantpb.BypassRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Calls() []RecordedCall + func (r *RecorderRPC) CancelTask(ctx context.Context, in *implantpb.TaskCtrl, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Cat(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Cd(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) CheckSource(ctx context.Context, in *clientpb.BuildConfig, opts ...grpc.CallOption) (*clientpb.BuildConfig, error) + func (r *RecorderRPC) Clear(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Cp(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) DeleteCertificate(ctx context.Context, in *clientpb.Cert, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) DeleteContext(ctx context.Context, in *clientpb.Context, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) DeletePipeline(ctx context.Context, in *clientpb.CtrlPipeline, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) Download(ctx context.Context, in *implantpb.DownloadRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) DownloadArtifact(ctx context.Context, in *clientpb.Artifact, opts ...grpc.CallOption) (*clientpb.Artifact, error) + func (r *RecorderRPC) DownloadCertificate(ctx context.Context, in *clientpb.Cert, opts ...grpc.CallOption) (*clientpb.TLS, error) + func (r *RecorderRPC) DownloadDir(ctx context.Context, in *implantpb.DownloadRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) EnumDrivers(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Env(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Execute(ctx context.Context, in *implantpb.ExecRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) ExecuteAddon(ctx context.Context, in *implantpb.ExecuteAddon, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) ExecuteModule(ctx context.Context, in *implantpb.ExecuteModuleRequest, ...) (*clientpb.Task, error) + func (r *RecorderRPC) GenerateSelfCert(ctx context.Context, in *clientpb.Pipeline, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) GetAcmeConfig(ctx context.Context, in *clientpb.Empty, opts ...grpc.CallOption) (*clientpb.AcmeConfig, error) + func (r *RecorderRPC) GetAllCertificates(ctx context.Context, in *clientpb.Empty, opts ...grpc.CallOption) (*clientpb.Certs, error) + func (r *RecorderRPC) GetAllTaskContent(ctx context.Context, in *clientpb.Task, opts ...grpc.CallOption) (*clientpb.TaskContexts, error) + func (r *RecorderRPC) GetBasic(ctx context.Context, in *clientpb.Empty, opts ...grpc.CallOption) (*clientpb.Basic, error) + func (r *RecorderRPC) GetContexts(ctx context.Context, in *clientpb.Context, opts ...grpc.CallOption) (*clientpb.Contexts, error) + func (r *RecorderRPC) GetLicenseInfo(ctx context.Context, in *clientpb.Empty, opts ...grpc.CallOption) (*clientpb.LicenseInfo, error) + func (r *RecorderRPC) GetListeners(ctx context.Context, in *clientpb.Empty, opts ...grpc.CallOption) (*clientpb.Listeners, error) + func (r *RecorderRPC) GetSession(ctx context.Context, in *clientpb.SessionRequest, opts ...grpc.CallOption) (*clientpb.Session, error) + func (r *RecorderRPC) GetSystem(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) GetTasks(ctx context.Context, in *clientpb.TaskRequest, opts ...grpc.CallOption) (*clientpb.Tasks, error) + func (r *RecorderRPC) Info(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) InitBindSession(ctx context.Context, in *implantpb.Init, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) Keepalive(ctx context.Context, in *implantpb.CommonBody, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Kill(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) ListAddon(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) ListJobs(ctx context.Context, in *clientpb.Empty, opts ...grpc.CallOption) (*clientpb.Pipelines, error) + func (r *RecorderRPC) ListModule(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) ListTasks(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) LoadAddon(ctx context.Context, in *implantpb.LoadAddon, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) LoadModule(ctx context.Context, in *implantpb.LoadModule, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Ls(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Mkdir(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Mv(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Netstat(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Notify(ctx context.Context, in *clientpb.Event, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) ObtainAcmeCert(ctx context.Context, in *clientpb.AcmeRequest, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) OnAcmeConfig(method string, fn func(context.Context, any) (*clientpb.AcmeConfig, error)) + func (r *RecorderRPC) OnArtifact(method string, fn func(context.Context, any) (*clientpb.Artifact, error)) + func (r *RecorderRPC) OnBasic(method string, fn func(context.Context, any) (*clientpb.Basic, error)) + func (r *RecorderRPC) OnBuildConfig(method string, fn func(context.Context, any) (*clientpb.BuildConfig, error)) + func (r *RecorderRPC) OnCerts(method string, fn func(context.Context, any) (*clientpb.Certs, error)) + func (r *RecorderRPC) OnContext(method string, fn func(context.Context, any) (*clientpb.Context, error)) + func (r *RecorderRPC) OnContexts(method string, fn func(context.Context, any) (*clientpb.Contexts, error)) + func (r *RecorderRPC) OnEmpty(method string, fn func(context.Context, any) (*clientpb.Empty, error)) + func (r *RecorderRPC) OnLicenseInfo(method string, fn func(context.Context, any) (*clientpb.LicenseInfo, error)) + func (r *RecorderRPC) OnListeners(method string, fn func(context.Context, any) (*clientpb.Listeners, error)) + func (r *RecorderRPC) OnPipelines(method string, fn func(context.Context, any) (*clientpb.Pipelines, error)) + func (r *RecorderRPC) OnSession(method string, fn func(context.Context, any) (*clientpb.Session, error)) + func (r *RecorderRPC) OnTLS(method string, fn func(context.Context, any) (*clientpb.TLS, error)) + func (r *RecorderRPC) OnTask(method string, fn func(context.Context, any) (*clientpb.Task, error)) + func (r *RecorderRPC) OnTaskContext(method string, fn func(context.Context, any) (*clientpb.TaskContext, error)) + func (r *RecorderRPC) OnTaskContexts(method string, fn func(context.Context, any) (*clientpb.TaskContexts, error)) + func (r *RecorderRPC) OnTasks(method string, fn func(context.Context, any) (*clientpb.Tasks, error)) + func (r *RecorderRPC) Ping(ctx context.Context, in *implantpb.Ping, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Polling(ctx context.Context, in *clientpb.Polling, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) Privs(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Ps(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Pwd(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) QueryTask(ctx context.Context, in *implantpb.TaskCtrl, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) RefreshModule(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) RegAdd(ctx context.Context, in *implantpb.RegistryWriteRequest, ...) (*clientpb.Task, error) + func (r *RecorderRPC) RegDelete(ctx context.Context, in *implantpb.RegistryRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) RegListKey(ctx context.Context, in *implantpb.RegistryRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) RegListValue(ctx context.Context, in *implantpb.RegistryRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) RegQuery(ctx context.Context, in *implantpb.RegistryRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Rev2Self(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Rm(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Runas(ctx context.Context, in *implantpb.RunAsRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) ServiceCreate(ctx context.Context, in *implantpb.ServiceRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) ServiceDelete(ctx context.Context, in *implantpb.ServiceRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) ServiceList(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) ServiceQuery(ctx context.Context, in *implantpb.ServiceRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) ServiceStart(ctx context.Context, in *implantpb.ServiceRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) ServiceStop(ctx context.Context, in *implantpb.ServiceRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) SessionEvent(ctx context.Context, in *clientpb.Event, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) SessionEvents() []RecordedCall + func (r *RecorderRPC) SetEnv(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) SetSession(session *clientpb.Session) + func (r *RecorderRPC) Sleep(ctx context.Context, in *implantpb.Timer, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) StartPipeline(ctx context.Context, in *clientpb.CtrlPipeline, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) StopPipeline(ctx context.Context, in *clientpb.CtrlPipeline, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) Suicide(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Switch(ctx context.Context, in *implantpb.Switch, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) Sync(ctx context.Context, in *clientpb.Sync, opts ...grpc.CallOption) (*clientpb.Context, error) + func (r *RecorderRPC) SyncBuild(ctx context.Context, in *clientpb.BuildConfig, opts ...grpc.CallOption) (*clientpb.Artifact, error) + func (r *RecorderRPC) TaskSchdCreate(ctx context.Context, in *implantpb.TaskScheduleRequest, ...) (*clientpb.Task, error) + func (r *RecorderRPC) TaskSchdDelete(ctx context.Context, in *implantpb.TaskScheduleRequest, ...) (*clientpb.Task, error) + func (r *RecorderRPC) TaskSchdList(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) TaskSchdQuery(ctx context.Context, in *implantpb.TaskScheduleRequest, ...) (*clientpb.Task, error) + func (r *RecorderRPC) TaskSchdRun(ctx context.Context, in *implantpb.TaskScheduleRequest, ...) (*clientpb.Task, error) + func (r *RecorderRPC) TaskSchdStart(ctx context.Context, in *implantpb.TaskScheduleRequest, ...) (*clientpb.Task, error) + func (r *RecorderRPC) TaskSchdStop(ctx context.Context, in *implantpb.TaskScheduleRequest, ...) (*clientpb.Task, error) + func (r *RecorderRPC) Touch(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) UnloadModule(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) UnsetEnv(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) UpdateAcmeConfig(ctx context.Context, in *clientpb.AcmeConfig, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) UpdateCertificate(ctx context.Context, in *clientpb.TLS, opts ...grpc.CallOption) (*clientpb.Empty, error) + func (r *RecorderRPC) Upload(ctx context.Context, in *implantpb.UploadRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) WaitTaskFinish(ctx context.Context, in *clientpb.Task, opts ...grpc.CallOption) (*clientpb.TaskContext, error) + func (r *RecorderRPC) Whoami(ctx context.Context, in *implantpb.Request, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) WmiExecute(ctx context.Context, in *implantpb.WmiMethodRequest, opts ...grpc.CallOption) (*clientpb.Task, error) + func (r *RecorderRPC) WmiQuery(ctx context.Context, in *implantpb.WmiQueryRequest, opts ...grpc.CallOption) (*clientpb.Task, error)