Documentation ¶
Index ¶
- Variables
- type AgentMessage
- func (*AgentMessage) Descriptor() ([]byte, []int)
- func (this *AgentMessage) Equal(that interface{}) bool
- func (m *AgentMessage) GetLogs() []string
- func (m *AgentMessage) GetMetadata() *AgentMetadata
- func (m *AgentMessage) GetResults() []*TaskResult
- func (this *AgentMessage) GoString() string
- func (m *AgentMessage) Marshal() (dAtA []byte, err error)
- func (m *AgentMessage) MarshalTo(dAtA []byte) (int, error)
- func (m *AgentMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*AgentMessage) ProtoMessage()
- func (m *AgentMessage) Reset()
- func (m *AgentMessage) Size() (n int)
- func (this *AgentMessage) String() string
- func (m *AgentMessage) Unmarshal(dAtA []byte) error
- func (m *AgentMessage) XXX_DiscardUnknown()
- func (m *AgentMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AgentMessage) XXX_Merge(src proto.Message)
- func (m *AgentMessage) XXX_Size() int
- func (m *AgentMessage) XXX_Unmarshal(b []byte) error
- type AgentMetadata
- func (*AgentMetadata) Descriptor() ([]byte, []int)
- func (this *AgentMetadata) Equal(that interface{}) bool
- func (m *AgentMetadata) GetAgentID() string
- func (m *AgentMetadata) GetHostname() string
- func (m *AgentMetadata) GetMachineUUID() string
- func (m *AgentMetadata) GetPrimaryIP() string
- func (m *AgentMetadata) GetPrimaryMAC() string
- func (m *AgentMetadata) GetSessionID() string
- func (this *AgentMetadata) GoString() string
- func (m *AgentMetadata) Marshal() (dAtA []byte, err error)
- func (m *AgentMetadata) MarshalTo(dAtA []byte) (int, error)
- func (m *AgentMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*AgentMetadata) ProtoMessage()
- func (m *AgentMetadata) Reset()
- func (m *AgentMetadata) Size() (n int)
- func (this *AgentMetadata) String() string
- func (m *AgentMetadata) Unmarshal(dAtA []byte) error
- func (m *AgentMetadata) XXX_DiscardUnknown()
- func (m *AgentMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AgentMetadata) XXX_Merge(src proto.Message)
- func (m *AgentMetadata) XXX_Size() int
- func (m *AgentMetadata) XXX_Unmarshal(b []byte) error
- type Server
- func (srv Server) HandleAgent(ctx context.Context, msg AgentMessage) (*ServerMessage, error)
- func (srv Server) HandleJSON(ctx context.Context, src io.Reader, dst io.Writer) error
- func (srv Server) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (srv *Server) ServeStatus(w http.ResponseWriter, req *http.Request)
- type ServerMessage
- func (*ServerMessage) Descriptor() ([]byte, []int)
- func (this *ServerMessage) Equal(that interface{}) bool
- func (m *ServerMessage) GetTasks() []*Task
- func (this *ServerMessage) GoString() string
- func (m *ServerMessage) Marshal() (dAtA []byte, err error)
- func (m *ServerMessage) MarshalTo(dAtA []byte) (int, error)
- func (m *ServerMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ServerMessage) ProtoMessage()
- func (m *ServerMessage) Reset()
- func (m *ServerMessage) Size() (n int)
- func (this *ServerMessage) String() string
- func (m *ServerMessage) Unmarshal(dAtA []byte) error
- func (m *ServerMessage) XXX_DiscardUnknown()
- func (m *ServerMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ServerMessage) XXX_Merge(src proto.Message)
- func (m *ServerMessage) XXX_Size() int
- func (m *ServerMessage) XXX_Unmarshal(b []byte) error
- type Task
- func (*Task) Descriptor() ([]byte, []int)
- func (this *Task) Equal(that interface{}) bool
- func (m *Task) GetContent() string
- func (m *Task) GetId() int64
- func (this *Task) GoString() string
- func (m *Task) Marshal() (dAtA []byte, err error)
- func (m *Task) MarshalTo(dAtA []byte) (int, error)
- func (m *Task) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Task) ProtoMessage()
- func (m *Task) Reset()
- func (m *Task) Size() (n int)
- func (this *Task) String() string
- func (m *Task) Unmarshal(dAtA []byte) error
- func (m *Task) XXX_DiscardUnknown()
- func (m *Task) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Task) XXX_Merge(src proto.Message)
- func (m *Task) XXX_Size() int
- func (m *Task) XXX_Unmarshal(b []byte) error
- type TaskResult
- func (m *TaskResult) CloseWithError(err error)
- func (*TaskResult) Descriptor() ([]byte, []int)
- func (this *TaskResult) Equal(that interface{}) bool
- func (m *TaskResult) GetError() string
- func (m *TaskResult) GetExecStartTime() *types.Timestamp
- func (m *TaskResult) GetExecStopTime() *types.Timestamp
- func (m *TaskResult) GetId() int64
- func (m *TaskResult) GetOutput() string
- func (this *TaskResult) GoString() string
- func (m *TaskResult) Marshal() (dAtA []byte, err error)
- func (m *TaskResult) MarshalTo(dAtA []byte) (int, error)
- func (m *TaskResult) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TaskResult) ProtoMessage()
- func (m *TaskResult) Reset()
- func (m *TaskResult) Size() (n int)
- func (m *TaskResult) Start()
- func (this *TaskResult) String() string
- func (m *TaskResult) Unmarshal(dAtA []byte) error
- func (m *TaskResult) XXX_DiscardUnknown()
- func (m *TaskResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TaskResult) XXX_Merge(src proto.Message)
- func (m *TaskResult) XXX_Size() int
- func (m *TaskResult) XXX_Unmarshal(b []byte) error
- type Teamserver
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AgentMessage ¶
type AgentMessage struct { Metadata *AgentMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Results []*TaskResult `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` Logs []string `protobuf:"bytes,3,rep,name=logs,proto3" json:"logs,omitempty"` }
func NewPopulatedAgentMessage ¶
func NewPopulatedAgentMessage(r randyTransport, easy bool) *AgentMessage
func (*AgentMessage) Descriptor ¶
func (*AgentMessage) Descriptor() ([]byte, []int)
func (*AgentMessage) Equal ¶
func (this *AgentMessage) Equal(that interface{}) bool
func (*AgentMessage) GetLogs ¶
func (m *AgentMessage) GetLogs() []string
func (*AgentMessage) GetMetadata ¶
func (m *AgentMessage) GetMetadata() *AgentMetadata
func (*AgentMessage) GetResults ¶
func (m *AgentMessage) GetResults() []*TaskResult
func (*AgentMessage) GoString ¶
func (this *AgentMessage) GoString() string
func (*AgentMessage) Marshal ¶
func (m *AgentMessage) Marshal() (dAtA []byte, err error)
func (*AgentMessage) MarshalToSizedBuffer ¶
func (m *AgentMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*AgentMessage) ProtoMessage ¶
func (*AgentMessage) ProtoMessage()
func (*AgentMessage) Reset ¶
func (m *AgentMessage) Reset()
func (*AgentMessage) Size ¶
func (m *AgentMessage) Size() (n int)
func (*AgentMessage) String ¶
func (this *AgentMessage) String() string
func (*AgentMessage) Unmarshal ¶
func (m *AgentMessage) Unmarshal(dAtA []byte) error
func (*AgentMessage) XXX_DiscardUnknown ¶
func (m *AgentMessage) XXX_DiscardUnknown()
func (*AgentMessage) XXX_Marshal ¶
func (m *AgentMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AgentMessage) XXX_Merge ¶
func (m *AgentMessage) XXX_Merge(src proto.Message)
func (*AgentMessage) XXX_Size ¶
func (m *AgentMessage) XXX_Size() int
func (*AgentMessage) XXX_Unmarshal ¶
func (m *AgentMessage) XXX_Unmarshal(b []byte) error
type AgentMetadata ¶
type AgentMetadata struct { AgentID string `protobuf:"bytes,1,opt,name=agentID,proto3" json:"agentID,omitempty"` MachineUUID string `protobuf:"bytes,2,opt,name=machineUUID,proto3" json:"machineUUID,omitempty"` SessionID string `protobuf:"bytes,3,opt,name=sessionID,proto3" json:"sessionID,omitempty"` Hostname string `protobuf:"bytes,4,opt,name=hostname,proto3" json:"hostname,omitempty"` PrimaryIP string `protobuf:"bytes,5,opt,name=primaryIP,proto3" json:"primaryIP,omitempty"` PrimaryMAC string `protobuf:"bytes,6,opt,name=primaryMAC,proto3" json:"primaryMAC,omitempty"` }
func NewPopulatedAgentMetadata ¶
func NewPopulatedAgentMetadata(r randyTransport, easy bool) *AgentMetadata
func (*AgentMetadata) Descriptor ¶
func (*AgentMetadata) Descriptor() ([]byte, []int)
func (*AgentMetadata) Equal ¶
func (this *AgentMetadata) Equal(that interface{}) bool
func (*AgentMetadata) GetAgentID ¶
func (m *AgentMetadata) GetAgentID() string
func (*AgentMetadata) GetHostname ¶
func (m *AgentMetadata) GetHostname() string
func (*AgentMetadata) GetMachineUUID ¶
func (m *AgentMetadata) GetMachineUUID() string
func (*AgentMetadata) GetPrimaryIP ¶
func (m *AgentMetadata) GetPrimaryIP() string
func (*AgentMetadata) GetPrimaryMAC ¶
func (m *AgentMetadata) GetPrimaryMAC() string
func (*AgentMetadata) GetSessionID ¶
func (m *AgentMetadata) GetSessionID() string
func (*AgentMetadata) GoString ¶
func (this *AgentMetadata) GoString() string
func (*AgentMetadata) Marshal ¶
func (m *AgentMetadata) Marshal() (dAtA []byte, err error)
func (*AgentMetadata) MarshalToSizedBuffer ¶
func (m *AgentMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*AgentMetadata) ProtoMessage ¶
func (*AgentMetadata) ProtoMessage()
func (*AgentMetadata) Reset ¶
func (m *AgentMetadata) Reset()
func (*AgentMetadata) Size ¶
func (m *AgentMetadata) Size() (n int)
func (*AgentMetadata) String ¶
func (this *AgentMetadata) String() string
func (*AgentMetadata) Unmarshal ¶
func (m *AgentMetadata) Unmarshal(dAtA []byte) error
func (*AgentMetadata) XXX_DiscardUnknown ¶
func (m *AgentMetadata) XXX_DiscardUnknown()
func (*AgentMetadata) XXX_Marshal ¶
func (m *AgentMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AgentMetadata) XXX_Merge ¶
func (m *AgentMetadata) XXX_Merge(src proto.Message)
func (*AgentMetadata) XXX_Size ¶
func (m *AgentMetadata) XXX_Size() int
func (*AgentMetadata) XXX_Unmarshal ¶
func (m *AgentMetadata) XXX_Unmarshal(b []byte) error
type Server ¶
type Server struct {
Teamserver
}
Server manages communication with agents. Upon check-in, the server will claim and respond with any tasks available for the agent.
func (Server) HandleAgent ¶
func (srv Server) HandleAgent(ctx context.Context, msg AgentMessage) (*ServerMessage, error)
HandleAgent is a transport-agnostic method for handling agent communications.
func (Server) HandleJSON ¶
HandleJSON provides wraps HandleAgent by decoding a JSON AgentMessage from src and encoding a JSON ServerMessage to dst.
func (Server) ServeHTTP ¶
func (srv Server) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP wraps HandleJSON to provide a server handler for HTTP(s) transport.
func (*Server) ServeStatus ¶
func (srv *Server) ServeStatus(w http.ResponseWriter, req *http.Request)
ServeStatus is an HTTP handler that returns the C2 Server status
type ServerMessage ¶
type ServerMessage struct {
Tasks []*Task `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"`
}
func NewPopulatedServerMessage ¶
func NewPopulatedServerMessage(r randyTransport, easy bool) *ServerMessage
func (*ServerMessage) Descriptor ¶
func (*ServerMessage) Descriptor() ([]byte, []int)
func (*ServerMessage) Equal ¶
func (this *ServerMessage) Equal(that interface{}) bool
func (*ServerMessage) GetTasks ¶
func (m *ServerMessage) GetTasks() []*Task
func (*ServerMessage) GoString ¶
func (this *ServerMessage) GoString() string
func (*ServerMessage) Marshal ¶
func (m *ServerMessage) Marshal() (dAtA []byte, err error)
func (*ServerMessage) MarshalToSizedBuffer ¶
func (m *ServerMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ServerMessage) ProtoMessage ¶
func (*ServerMessage) ProtoMessage()
func (*ServerMessage) Reset ¶
func (m *ServerMessage) Reset()
func (*ServerMessage) Size ¶
func (m *ServerMessage) Size() (n int)
func (*ServerMessage) String ¶
func (this *ServerMessage) String() string
func (*ServerMessage) Unmarshal ¶
func (m *ServerMessage) Unmarshal(dAtA []byte) error
func (*ServerMessage) XXX_DiscardUnknown ¶
func (m *ServerMessage) XXX_DiscardUnknown()
func (*ServerMessage) XXX_Marshal ¶
func (m *ServerMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ServerMessage) XXX_Merge ¶
func (m *ServerMessage) XXX_Merge(src proto.Message)
func (*ServerMessage) XXX_Size ¶
func (m *ServerMessage) XXX_Size() int
func (*ServerMessage) XXX_Unmarshal ¶
func (m *ServerMessage) XXX_Unmarshal(b []byte) error
type Task ¶
type Task struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` }
func NewPopulatedTask ¶
func (*Task) Descriptor ¶
func (*Task) GetContent ¶
func (*Task) ProtoMessage ¶
func (*Task) ProtoMessage()
func (*Task) XXX_DiscardUnknown ¶
func (m *Task) XXX_DiscardUnknown()
func (*Task) XXX_Unmarshal ¶
type TaskResult ¶
type TaskResult 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 string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` ExecStartTime *types.Timestamp `protobuf:"bytes,4,opt,name=execStartTime,proto3" json:"execStartTime,omitempty"` ExecStopTime *types.Timestamp `protobuf:"bytes,5,opt,name=execStopTime,proto3" json:"execStopTime,omitempty"` }
func NewPopulatedTaskResult ¶
func NewPopulatedTaskResult(r randyTransport, easy bool) *TaskResult
func (*TaskResult) CloseWithError ¶
func (m *TaskResult) CloseWithError(err error)
CloseWithError marks the end of task execution, and provides any error the task resulted in.
func (*TaskResult) Descriptor ¶
func (*TaskResult) Descriptor() ([]byte, []int)
func (*TaskResult) Equal ¶
func (this *TaskResult) Equal(that interface{}) bool
func (*TaskResult) GetError ¶
func (m *TaskResult) GetError() string
func (*TaskResult) GetExecStartTime ¶
func (m *TaskResult) GetExecStartTime() *types.Timestamp
func (*TaskResult) GetExecStopTime ¶
func (m *TaskResult) GetExecStopTime() *types.Timestamp
func (*TaskResult) GetId ¶
func (m *TaskResult) GetId() int64
func (*TaskResult) GetOutput ¶
func (m *TaskResult) GetOutput() string
func (*TaskResult) GoString ¶
func (this *TaskResult) GoString() string
func (*TaskResult) Marshal ¶
func (m *TaskResult) Marshal() (dAtA []byte, err error)
func (*TaskResult) MarshalToSizedBuffer ¶
func (m *TaskResult) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*TaskResult) ProtoMessage ¶
func (*TaskResult) ProtoMessage()
func (*TaskResult) Reset ¶
func (m *TaskResult) Reset()
func (*TaskResult) Size ¶
func (m *TaskResult) Size() (n int)
func (*TaskResult) String ¶
func (this *TaskResult) String() string
func (*TaskResult) Unmarshal ¶
func (m *TaskResult) Unmarshal(dAtA []byte) error
func (*TaskResult) XXX_DiscardUnknown ¶
func (m *TaskResult) XXX_DiscardUnknown()
func (*TaskResult) XXX_Marshal ¶
func (m *TaskResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TaskResult) XXX_Merge ¶
func (m *TaskResult) XXX_Merge(src proto.Message)
func (*TaskResult) XXX_Size ¶
func (m *TaskResult) XXX_Size() int
func (*TaskResult) XXX_Unmarshal ¶
func (m *TaskResult) XXX_Unmarshal(b []byte) error
type Teamserver ¶
type Teamserver interface { ClaimTasks(context.Context, models.ClaimTasksRequest) ([]*ent.Task, error) SubmitTaskResult(context.Context, models.SubmitTaskResultRequest) error }
Teamserver provides client methods used to interact with a teamserver.
Click to show internal directories.
Click to hide internal directories.