Documentation
¶
Index ¶
- Variables
- func CurrentJobID() uint32
- func GetCurrentID() uint32
- func HandleFileOperations(op string, data []byte, task *Task) error
- func HandleScreenshot(data []byte, task *Task) error
- func LoadContext(ctx output.Context) (output.Context, error)
- func NewBroker() *eventBroker
- func NewSessions() *sessions
- func NextCtrlID() uint32
- func NextJobID() uint32
- func PushContextEvent(Op string, ctx *models.Context)
- func ReadFileForContext(ctx output.Context) ([]byte, error)
- func SaveContext(ctx output.Context, task *Task) (*models.Context, error)
- type Cache
- func (c *Cache) AddMessage(spite *implantpb.Spite, index int)
- func (c *Cache) GetAll() map[string]*implantpb.Spite
- func (c *Cache) GetLastMessage(taskID int) (*implantpb.Spite, bool)
- func (c *Cache) GetMessage(taskID, index int) (*implantpb.Spite, bool)
- func (c *Cache) GetMessages(taskID int) ([]*implantpb.Spite, bool)
- func (c *Cache) Load() error
- func (c *Cache) Save() error
- type Client
- type Connection
- type Event
- type Forward
- type Job
- type Listener
- func (l *Listener) AddPipeline(pipeline *clientpb.Pipeline)
- func (l *Listener) AllPipelines() []*clientpb.Pipeline
- func (l *Listener) GetPipeline(name string) *clientpb.Pipeline
- func (l *Listener) PushCtrl(ctrl *clientpb.JobCtrl) uint32
- func (l *Listener) RemovePipeline(pipeline *clientpb.Pipeline)
- func (l *Listener) ToProtobuf() *clientpb.Listener
- func (l *Listener) WaitCtrl(i uint32) *clientpb.JobStatus
- type Message
- type Notifier
- type Pipeline
- type PipelineConfig
- type Pipelines
- type RingCache
- type Session
- func (s *Session) Abstract() string
- func (s *Session) DeleteResp(taskId uint32)
- func (s *Session) GetResp(taskId uint32) (chan *implantpb.Spite, bool)
- func (s *Session) NewTask(name string, total int) *Task
- func (s *Session) Publish(Op string, msg string, notify bool, important bool)
- func (s *Session) PushUpdate(msg string)
- func (s *Session) Recover() error
- func (s *Session) RecoverTaskIDByLog() (int, error)
- func (s *Session) Request(msg *clientpb.SpiteRequest, stream grpc.ServerStream) error
- func (s *Session) RequestAndWait(msg *clientpb.SpiteRequest, stream grpc.ServerStream, timeout time.Duration) (*implantpb.Spite, error)
- func (s *Session) RequestWithAsync(msg *clientpb.SpiteRequest, stream grpc.ServerStream, timeout time.Duration) (chan *implantpb.Spite, error)
- func (s *Session) RequestWithStream(msg *clientpb.SpiteRequest, stream grpc.ServerStream, timeout time.Duration) (chan *implantpb.Spite, chan *implantpb.Spite, error)
- func (s *Session) RpcLogger() *logs.Logger
- func (s *Session) StoreResp(taskId uint32, ch chan *implantpb.Spite)
- func (s *Session) TaskLog(task *Task, spite *implantpb.Spite) error
- func (s *Session) ToModel() *models.Session
- func (s *Session) ToProtobuf() *clientpb.Session
- func (s *Session) ToProtobufLite() *clientpb.Session
- func (s *Session) Update(req *clientpb.RegisterSession)
- func (s *Session) UpdateSysInfo(info *implantpb.SysInfo)
- type Task
- func (t *Task) Close()
- func (t *Task) Done(spite *implantpb.Spite, msg string)
- func (t *Task) Finish(spite *implantpb.Spite, msg string)
- func (t *Task) Finished() bool
- func (t *Task) Name() string
- func (t *Task) Panic(event Event)
- func (t *Task) Publish(op string, spite *implantpb.Spite, msg string)
- func (t *Task) String() string
- func (t *Task) TaskID() string
- func (t *Task) Timeout() bool
- func (t *Task) ToProtobuf() *clientpb.Task
- type Tasks
- type Ticker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Sessions - Manages implant connections Sessions *sessions ExtensionModules = []string{consts.ModuleExecuteBof, consts.ModuleExecuteDll} // ErrUnknownMessageType - Returned if the implant did not understand the message for // example when the command is not supported on the platform ErrUnknownMessageType = errors.New("unknown message type") // ErrImplantSendTimeout - The implant did not respond prior to timeout deadline ErrImplantSendTimeout = errors.New("implant timeout") )
View Source
var CacheName = "cache.bin"
View Source
var ( // Clients - Manages client active Clients = &clients{ mutex: &sync.Mutex{}, active: map[int]*Client{}, } )
View Source
var ( Connections = &connections{ connections: &sync.Map{}, } )
View Source
var (
// EventBroker - Distributes event messages
EventBroker *eventBroker
)
View Source
var ( Forwarders = &forwarders{ forwarders: &sync.Map{}, } )
View Source
var (
GlobalTicker = NewTicker()
)
View Source
var ( Jobs = &jobs{ Map: &sync.Map{}, } )
View Source
var ( Listeners = listeners{ &sync.Map{}, } )
Functions ¶
func CurrentJobID ¶
func CurrentJobID() uint32
func GetCurrentID ¶ added in v0.0.3
func GetCurrentID() uint32
func HandleFileOperations ¶ added in v0.1.0
func HandleScreenshot ¶ added in v0.1.0
func NewSessions ¶ added in v0.0.3
func NewSessions() *sessions
func NextCtrlID ¶
func NextCtrlID() uint32
func PushContextEvent ¶ added in v0.1.0
func ReadFileForContext ¶ added in v0.1.0
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) AddMessage ¶
AddMessage adds a new item to the cache with TaskId and Index as part of the key
func (*Cache) GetMessage ¶
GetMessage retrieves a cache item by TaskId and Index
type Connection ¶
type Connection struct {
RawID uint32
SessionID string
LastMessage time.Time
PipelineID string
C chan *clientpb.SpiteRequest // spite
Sender chan *implantpb.Spites
Alive bool
Parser *parser.MessageParser
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(p *parser.MessageParser, sid uint32, pipelineID string) *Connection
func (*Connection) Handler ¶ added in v0.0.3
func (c *Connection) Handler(ctx context.Context, conn *cryptostream.Conn) error
func (*Connection) HandlerSimplex ¶ added in v0.1.0
func (c *Connection) HandlerSimplex(ctx context.Context, conn *cryptostream.Conn) error
func (*Connection) Send ¶
func (c *Connection) Send(ctx context.Context, conn *cryptostream.Conn)
type Event ¶
type Event struct {
Session *clientpb.Session
Job *clientpb.Job
Client *clientpb.Client
Task *clientpb.Task
Spite *implantpb.Spite
Important bool
EventType string
Op string
Message string
Err string
Callee string
IsNotify bool
}
func (*Event) ToProtobuf ¶ added in v0.1.0
toprotobuf
type Forward ¶
type Forward struct {
Pipeline
ListenerId string
Stream listenerrpc.ListenerRPC_SpiteStreamClient
ListenerRpc listenerrpc.ListenerRPCClient
// contains filtered or unexported fields
}
Forward is a struct that handles messages from listener and server
func NewForward ¶
func NewForward(rpc listenerrpc.ListenerRPCClient, pipeline Pipeline) (*Forward, error)
type Job ¶
func (*Job) ToProtobuf ¶
type Listener ¶
type Listener struct {
Name string
IP string
Active bool
Pipelines map[string]*clientpb.Pipeline
Ctrl chan *clientpb.JobCtrl
CtrlJob *sync.Map
}
func (*Listener) AddPipeline ¶ added in v0.0.3
func (*Listener) AllPipelines ¶ added in v0.0.3
func (*Listener) GetPipeline ¶ added in v0.0.3
func (*Listener) RemovePipeline ¶ added in v0.0.3
func (*Listener) ToProtobuf ¶
type PipelineConfig ¶ added in v0.0.3
type PipelineConfig struct {
ListenerID string
Parser string
TLSConfig *types.TlsConfig
Encryption types.EncryptionsConfig
}
func FromPipeline ¶ added in v0.1.1
func FromPipeline(pipeline *clientpb.Pipeline) *PipelineConfig
func (*PipelineConfig) WrapConn ¶ added in v0.0.3
func (p *PipelineConfig) WrapConn(conn io.ReadWriteCloser) (*cryptostream.Conn, error)
type Pipelines ¶
func (Pipelines) ToProtobuf ¶
type RingCache ¶ added in v0.1.0
type RingCache struct {
// contains filtered or unexported fields
}
func NewMessageCache ¶ added in v0.1.0
type Session ¶
type Session struct {
Type string
PipelineID string
ListenerID string
ID string
RawID uint32
Name string
Group string
Note string
Target string
Initialized bool
LastCheckin int64
CreatedAt time.Time
Tasks *Tasks // task manager
*types.SessionContext
*Cache
Taskseq uint32
Ctx context.Context
Cancel context.CancelFunc
// contains filtered or unexported fields
}
Session - Represents a connection to an implant
func RegisterSession ¶ added in v0.0.3
func RegisterSession(req *clientpb.RegisterSession) (*Session, error)
func (*Session) DeleteResp ¶
func (*Session) PushUpdate ¶ added in v0.1.1
func (*Session) RecoverTaskIDByLog ¶ added in v0.0.3
func (*Session) Request ¶
func (s *Session) Request(msg *clientpb.SpiteRequest, stream grpc.ServerStream) error
Request
func (*Session) RequestAndWait ¶
func (s *Session) RequestAndWait(msg *clientpb.SpiteRequest, stream grpc.ServerStream, timeout time.Duration) (*implantpb.Spite, error)
func (*Session) RequestWithAsync ¶
func (s *Session) RequestWithAsync(msg *clientpb.SpiteRequest, stream grpc.ServerStream, timeout time.Duration) (chan *implantpb.Spite, error)
func (*Session) RequestWithStream ¶
func (s *Session) RequestWithStream(msg *clientpb.SpiteRequest, stream grpc.ServerStream, timeout time.Duration) (chan *implantpb.Spite, chan *implantpb.Spite, error)
RequestWithStream - 'async' means that the response is not returned immediately, but is returned through the channel 'ch
func (*Session) ToProtobuf ¶
func (*Session) ToProtobufLite ¶ added in v0.0.3
func (*Session) Update ¶
func (s *Session) Update(req *clientpb.RegisterSession)
func (*Session) UpdateSysInfo ¶
type Task ¶
type Task struct {
Id uint32
Type string
SessionId string
Callee string
Cur int
Total int
Callback func()
Ctx context.Context
Cancel context.CancelFunc
Session *Session
DoneCh chan bool
Closed bool
Deadline time.Time
CallBy string
}
func FromTaskProtobuf ¶ added in v0.0.3
func (*Task) ToProtobuf ¶
type Tasks ¶
type Tasks struct {
// contains filtered or unexported fields
}
func (*Tasks) GetNotFinish ¶ added in v0.0.3
func (*Tasks) ToProtobuf ¶
Click to show internal directories.
Click to hide internal directories.