c2pb

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Host_Platform_name = map[int32]string{
		0: "PLATFORM_UNSPECIFIED",
		1: "PLATFORM_WINDOWS",
		2: "PLATFORM_LINUX",
		3: "PLATFORM_MACOS",
		4: "PLATFORM_BSD",
	}
	Host_Platform_value = map[string]int32{
		"PLATFORM_UNSPECIFIED": 0,
		"PLATFORM_WINDOWS":     1,
		"PLATFORM_LINUX":       2,
		"PLATFORM_MACOS":       3,
		"PLATFORM_BSD":         4,
	}
)

Enum value maps for Host_Platform.

View Source
var C2_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "c2.C2",
	HandlerType: (*C2Server)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ClaimTasks",
			Handler:    _C2_ClaimTasks_Handler,
		},
		{
			MethodName: "ReportTaskOutput",
			Handler:    _C2_ReportTaskOutput_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "c2.proto",
}

C2_ServiceDesc is the grpc.ServiceDesc for C2 service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterC2Server

func RegisterC2Server(s grpc.ServiceRegistrar, srv C2Server)

Types

type Agent

type Agent struct {
	Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	// contains filtered or unexported fields
}

Agent information to identify the type of beacon.

func (*Agent) Descriptor deprecated

func (*Agent) Descriptor() ([]byte, []int)

Deprecated: Use Agent.ProtoReflect.Descriptor instead.

func (*Agent) GetIdentifier

func (x *Agent) GetIdentifier() string

func (*Agent) ProtoMessage

func (*Agent) ProtoMessage()

func (*Agent) ProtoReflect

func (x *Agent) ProtoReflect() protoreflect.Message

func (*Agent) Reset

func (x *Agent) Reset()

func (*Agent) String

func (x *Agent) String() string

type Beacon

type Beacon struct {
	Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	Principal  string `protobuf:"bytes,2,opt,name=principal,proto3" json:"principal,omitempty"`
	Host       *Host  `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"`
	Agent      *Agent `protobuf:"bytes,4,opt,name=agent,proto3" json:"agent,omitempty"`
	Interval   uint64 `protobuf:"varint,5,opt,name=interval,proto3" json:"interval,omitempty"` // Duration until next callback, in seconds.
	// contains filtered or unexported fields
}

Beacon information that is unique to the current running beacon.

func (*Beacon) Descriptor deprecated

func (*Beacon) Descriptor() ([]byte, []int)

Deprecated: Use Beacon.ProtoReflect.Descriptor instead.

func (*Beacon) GetAgent

func (x *Beacon) GetAgent() *Agent

func (*Beacon) GetHost

func (x *Beacon) GetHost() *Host

func (*Beacon) GetIdentifier

func (x *Beacon) GetIdentifier() string

func (*Beacon) GetInterval

func (x *Beacon) GetInterval() uint64

func (*Beacon) GetPrincipal

func (x *Beacon) GetPrincipal() string

func (*Beacon) ProtoMessage

func (*Beacon) ProtoMessage()

func (*Beacon) ProtoReflect

func (x *Beacon) ProtoReflect() protoreflect.Message

func (*Beacon) Reset

func (x *Beacon) Reset()

func (*Beacon) String

func (x *Beacon) String() string

type C2Client

type C2Client interface {
	ClaimTasks(ctx context.Context, in *ClaimTasksRequest, opts ...grpc.CallOption) (*ClaimTasksResponse, error)
	ReportTaskOutput(ctx context.Context, in *ReportTaskOutputRequest, opts ...grpc.CallOption) (*ReportTaskOutputResponse, error)
}

C2Client is the client API for C2 service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewC2Client

func NewC2Client(cc grpc.ClientConnInterface) C2Client

type C2Server

type C2Server interface {
	ClaimTasks(context.Context, *ClaimTasksRequest) (*ClaimTasksResponse, error)
	ReportTaskOutput(context.Context, *ReportTaskOutputRequest) (*ReportTaskOutputResponse, error)
	// contains filtered or unexported methods
}

C2Server is the server API for C2 service. All implementations must embed UnimplementedC2Server for forward compatibility

type ClaimTasksRequest

type ClaimTasksRequest struct {
	Beacon *Beacon `protobuf:"bytes,1,opt,name=beacon,proto3" json:"beacon,omitempty"`
	// contains filtered or unexported fields
}

RPC Messages

func (*ClaimTasksRequest) Descriptor deprecated

func (*ClaimTasksRequest) Descriptor() ([]byte, []int)

Deprecated: Use ClaimTasksRequest.ProtoReflect.Descriptor instead.

func (*ClaimTasksRequest) GetBeacon

func (x *ClaimTasksRequest) GetBeacon() *Beacon

func (*ClaimTasksRequest) ProtoMessage

func (*ClaimTasksRequest) ProtoMessage()

func (*ClaimTasksRequest) ProtoReflect

func (x *ClaimTasksRequest) ProtoReflect() protoreflect.Message

func (*ClaimTasksRequest) Reset

func (x *ClaimTasksRequest) Reset()

func (*ClaimTasksRequest) String

func (x *ClaimTasksRequest) String() string

type ClaimTasksResponse

type ClaimTasksResponse struct {
	Tasks []*Task `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"`
	// contains filtered or unexported fields
}

func (*ClaimTasksResponse) Descriptor deprecated

func (*ClaimTasksResponse) Descriptor() ([]byte, []int)

Deprecated: Use ClaimTasksResponse.ProtoReflect.Descriptor instead.

func (*ClaimTasksResponse) GetTasks

func (x *ClaimTasksResponse) GetTasks() []*Task

func (*ClaimTasksResponse) ProtoMessage

func (*ClaimTasksResponse) ProtoMessage()

func (*ClaimTasksResponse) ProtoReflect

func (x *ClaimTasksResponse) ProtoReflect() protoreflect.Message

func (*ClaimTasksResponse) Reset

func (x *ClaimTasksResponse) Reset()

func (*ClaimTasksResponse) String

func (x *ClaimTasksResponse) String() string

type Host

type Host struct {
	Identifier string        `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	Name       string        `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Platform   Host_Platform `protobuf:"varint,3,opt,name=platform,proto3,enum=c2.Host_Platform" json:"platform,omitempty"`
	PrimaryIp  string        `protobuf:"bytes,4,opt,name=primary_ip,json=primaryIp,proto3" json:"primary_ip,omitempty"`
	// contains filtered or unexported fields
}

Host information for the system a beacon is running on.

func (*Host) Descriptor deprecated

func (*Host) Descriptor() ([]byte, []int)

Deprecated: Use Host.ProtoReflect.Descriptor instead.

func (*Host) GetIdentifier

func (x *Host) GetIdentifier() string

func (*Host) GetName

func (x *Host) GetName() string

func (*Host) GetPlatform

func (x *Host) GetPlatform() Host_Platform

func (*Host) GetPrimaryIp

func (x *Host) GetPrimaryIp() string

func (*Host) ProtoMessage

func (*Host) ProtoMessage()

func (*Host) ProtoReflect

func (x *Host) ProtoReflect() protoreflect.Message

func (*Host) Reset

func (x *Host) Reset()

func (*Host) String

func (x *Host) String() string

type Host_Platform

type Host_Platform int32
const (
	Host_PLATFORM_UNSPECIFIED Host_Platform = 0
	Host_PLATFORM_WINDOWS     Host_Platform = 1
	Host_PLATFORM_LINUX       Host_Platform = 2
	Host_PLATFORM_MACOS       Host_Platform = 3
	Host_PLATFORM_BSD         Host_Platform = 4
)

func (Host_Platform) Descriptor

func (Host_Platform) Enum

func (x Host_Platform) Enum() *Host_Platform

func (Host_Platform) EnumDescriptor deprecated

func (Host_Platform) EnumDescriptor() ([]byte, []int)

Deprecated: Use Host_Platform.Descriptor instead.

func (Host_Platform) Number

func (Host_Platform) String

func (x Host_Platform) String() string

func (Host_Platform) Type

type ReportTaskOutputRequest

type ReportTaskOutputRequest struct {
	Output *TaskOutput `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"`
	// contains filtered or unexported fields
}

func (*ReportTaskOutputRequest) Descriptor deprecated

func (*ReportTaskOutputRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReportTaskOutputRequest.ProtoReflect.Descriptor instead.

func (*ReportTaskOutputRequest) GetOutput

func (x *ReportTaskOutputRequest) GetOutput() *TaskOutput

func (*ReportTaskOutputRequest) ProtoMessage

func (*ReportTaskOutputRequest) ProtoMessage()

func (*ReportTaskOutputRequest) ProtoReflect

func (x *ReportTaskOutputRequest) ProtoReflect() protoreflect.Message

func (*ReportTaskOutputRequest) Reset

func (x *ReportTaskOutputRequest) Reset()

func (*ReportTaskOutputRequest) String

func (x *ReportTaskOutputRequest) String() string

type ReportTaskOutputResponse

type ReportTaskOutputResponse struct {
	// contains filtered or unexported fields
}

func (*ReportTaskOutputResponse) Descriptor deprecated

func (*ReportTaskOutputResponse) Descriptor() ([]byte, []int)

Deprecated: Use ReportTaskOutputResponse.ProtoReflect.Descriptor instead.

func (*ReportTaskOutputResponse) ProtoMessage

func (*ReportTaskOutputResponse) ProtoMessage()

func (*ReportTaskOutputResponse) ProtoReflect

func (x *ReportTaskOutputResponse) ProtoReflect() protoreflect.Message

func (*ReportTaskOutputResponse) Reset

func (x *ReportTaskOutputResponse) Reset()

func (*ReportTaskOutputResponse) String

func (x *ReportTaskOutputResponse) String() string

type Task

type Task struct {
	Id         int64             `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Eldritch   string            `protobuf:"bytes,2,opt,name=eldritch,proto3" json:"eldritch,omitempty"`
	Parameters map[string]string `` /* 161-byte string literal not displayed */
	// contains filtered or unexported fields
}

Task instructions for the beacon to execute.

func (*Task) Descriptor deprecated

func (*Task) Descriptor() ([]byte, []int)

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetEldritch

func (x *Task) GetEldritch() string

func (*Task) GetId

func (x *Task) GetId() int64

func (*Task) GetParameters

func (x *Task) GetParameters() map[string]string

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) ProtoReflect

func (x *Task) ProtoReflect() protoreflect.Message

func (*Task) Reset

func (x *Task) Reset()

func (*Task) String

func (x *Task) String() string

type TaskError

type TaskError struct {
	Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

TaskError provides information when task execution fails.

func (*TaskError) Descriptor deprecated

func (*TaskError) Descriptor() ([]byte, []int)

Deprecated: Use TaskError.ProtoReflect.Descriptor instead.

func (*TaskError) GetMsg

func (x *TaskError) GetMsg() string

func (*TaskError) ProtoMessage

func (*TaskError) ProtoMessage()

func (*TaskError) ProtoReflect

func (x *TaskError) ProtoReflect() protoreflect.Message

func (*TaskError) Reset

func (x *TaskError) Reset()

func (*TaskError) String

func (x *TaskError) String() string

type TaskOutput

type TaskOutput struct {
	Id     int64      `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Output string     `protobuf:"bytes,2,opt,name=output,proto3" json:"output,omitempty"`
	Error  *TaskError `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
	// Indicates the UTC timestamp task execution began, set only in the first message for reporting.
	ExecStartedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=exec_started_at,json=execStartedAt,proto3" json:"exec_started_at,omitempty"`
	// Indicates the UTC timestamp task execution completed, set only in last message for reporting.
	ExecFinishedAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=exec_finished_at,json=execFinishedAt,proto3" json:"exec_finished_at,omitempty"`
	// contains filtered or unexported fields
}

TaskOutput provides information about a running task.

func (*TaskOutput) Descriptor deprecated

func (*TaskOutput) Descriptor() ([]byte, []int)

Deprecated: Use TaskOutput.ProtoReflect.Descriptor instead.

func (*TaskOutput) GetError

func (x *TaskOutput) GetError() *TaskError

func (*TaskOutput) GetExecFinishedAt

func (x *TaskOutput) GetExecFinishedAt() *timestamp.Timestamp

func (*TaskOutput) GetExecStartedAt

func (x *TaskOutput) GetExecStartedAt() *timestamp.Timestamp

func (*TaskOutput) GetId

func (x *TaskOutput) GetId() int64

func (*TaskOutput) GetOutput

func (x *TaskOutput) GetOutput() string

func (*TaskOutput) ProtoMessage

func (*TaskOutput) ProtoMessage()

func (*TaskOutput) ProtoReflect

func (x *TaskOutput) ProtoReflect() protoreflect.Message

func (*TaskOutput) Reset

func (x *TaskOutput) Reset()

func (*TaskOutput) String

func (x *TaskOutput) String() string

type UnimplementedC2Server

type UnimplementedC2Server struct {
}

UnimplementedC2Server must be embedded to have forward compatible implementations.

func (UnimplementedC2Server) ClaimTasks

type UnsafeC2Server

type UnsafeC2Server interface {
	// contains filtered or unexported methods
}

UnsafeC2Server may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to C2Server will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL