core

package
v0.0.6-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Clients - Manages client connections
	Clients = &clientConns{
		Connections: &map[int]*Client{},
		mutex:       &sync.RWMutex{},
	}
)
View Source
var (
	// EventBroker - Distributes event messages
	EventBroker = newBroker()
)
View Source
var (
	// Hive - Manages sliver connections
	Hive = &SliverHive{
		Slivers: &map[uint32]*Sliver{},
		mutex:   &sync.RWMutex{},
	}
)
View Source
var (
	// Jobs - Holds pointers to all the current jobs
	Jobs = &jobs{
		Active: &map[int]*Job{},
		mutex:  &sync.RWMutex{},
	}
)
View Source
var (
	// Tunnels - Interating with duplex tunnels
	Tunnels = tunnels{
		// contains filtered or unexported fields
	}
)

Functions

func EnvelopeID

func EnvelopeID() uint64

EnvelopeID - Generate random ID of randomIDSize bytes

func GetClientID

func GetClientID() int

GetClientID - Get a client ID

func GetHiveID

func GetHiveID() uint32

GetHiveID - Returns an incremental nonce as an id

func GetJobID

func GetJobID() int

GetJobID - Returns an incremental nonce as an id

Types

type Client

type Client struct {
	ID          int
	Operator    string
	Certificate *x509.Certificate
	Send        chan *sliverpb.Envelope
	Resp        map[uint64]chan *sliverpb.Envelope
	// contains filtered or unexported fields
}

Client - Single client connection

func GetClient

func GetClient(certificate *x509.Certificate) *Client

GetClient - Create a new client object

func (*Client) Response

func (c *Client) Response(envelope *sliverpb.Envelope)

Response - Drop an evelope into a response channel

func (*Client) ToProtobuf

func (c *Client) ToProtobuf() *clientpb.Client

ToProtobuf - Get the protobuf version of the object

type Event

type Event struct {
	Sliver    *Sliver
	Job       *Job
	Client    *Client
	EventType string
	Data      []byte
	Err       error
}

Event - Sliver connect/disconnect

type Job

type Job struct {
	ID          int
	Name        string
	Description string
	Protocol    string
	Port        uint16
	JobCtrl     chan bool
}

Job - Manages background jobs

func (*Job) ToProtobuf

func (j *Job) ToProtobuf() *pb.Job

ToProtobuf - Get the protobuf version of the object

type Sliver

type Sliver struct {
	ID            uint32
	Name          string
	Hostname      string
	Username      string
	UID           string
	GID           string
	Os            string
	Arch          string
	Transport     string
	RemoteAddress string
	PID           int32
	Filename      string
	LastCheckin   *time.Time
	Send          chan *sliverpb.Envelope
	Resp          map[uint64]chan *sliverpb.Envelope
	RespMutex     *sync.RWMutex
	ActiveC2      string
}

Sliver implant

func (*Sliver) Config

func (s *Sliver) Config() error

Config - Get the config the sliver was generated with

func (*Sliver) Request

func (s *Sliver) Request(msgType uint32, timeout time.Duration, data []byte) ([]byte, error)

Request - Sends a protobuf request to the active sliver and returns the response

func (*Sliver) ToProtobuf

func (s *Sliver) ToProtobuf() *clientpb.Sliver

ToProtobuf - Get the protobuf version of the object

type SliverHive

type SliverHive struct {
	Slivers *map[uint32]*Sliver
	// contains filtered or unexported fields
}

SliverHive - Mananges the slivers, provides atomic access

func (*SliverHive) AddSliver

func (h *SliverHive) AddSliver(sliver *Sliver)

AddSliver - Add a sliver to the hive (atomically)

func (*SliverHive) RemoveSliver

func (h *SliverHive) RemoveSliver(sliver *Sliver)

RemoveSliver - Add a sliver to the hive (atomically)

func (*SliverHive) Sliver

func (h *SliverHive) Sliver(sliverID uint32) *Sliver

Sliver - Get Sliver by ID

Jump to

Keyboard shortcuts

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