Documentation ¶
Index ¶
- Constants
- Variables
- func AddBuilder(builder *clientpb.Builder) error
- func AddCrackstation(crack *Crackstation) error
- func AllBuilders() []*clientpb.Builder
- func AllCrackstations() []*clientpb.Crackstation
- func EnvelopeID() int64
- func GetBuilder(builderName string) *clientpb.Builder
- func NewTunnelID() uint64
- func NextJobID() int
- func RemoveBuilder(builderName string)
- func RemoveCrackstation(hostUUID string)
- func StartEventAutomation()
- type Client
- type Crackstation
- type Event
- type ImplantConnection
- type Job
- type Pivot
- type PivotGraphEntry
- type Session
- type TcpTunnel
- type Tunnel
Constants ¶
const (
PivotTransportName = "pivot"
)
Variables ¶
var ( // Sessions - Manages implant connections Sessions = &sessions{ sessions: &sync.Map{}, } // 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") // ErrImplantTimeout - The implant did not respond prior to timeout deadline ErrImplantTimeout = errors.New("implant timeout") )
var ( // Tunnels - Interacting with duplex tunnels Tunnels = tunnels{ // contains filtered or unexported fields } // ErrInvalidTunnelID - Invalid tunnel ID value ErrInvalidTunnelID = errors.New("invalid tunnel ID") )
var ( // Clients - Manages client active Clients = &clients{ active: map[int]*Client{}, mutex: &sync.Mutex{}, } )
var (
ErrDuplicateExternalBuilderName = errors.New("builder name must be unique, this name is already in use")
)
var (
ErrDuplicateHosts = errors.New("only one crackstation instance per host")
)
var (
// EventBroker - Distributes event messages
EventBroker = newBroker()
)
var ( // Jobs - Holds pointers to all the current jobs Jobs = &jobs{ active: &sync.Map{}, } )
var (
PivotSessions = &sync.Map{} // ID -> Pivot
)
var ( // TunSocksTunnels - Interacting with duplex SocksTunnels SocksTunnels = tcpTunnel{ // contains filtered or unexported fields } )
Functions ¶
func AddBuilder ¶
func AddCrackstation ¶
func AddCrackstation(crack *Crackstation) error
func AllBuilders ¶
func AllCrackstations ¶
func AllCrackstations() []*clientpb.Crackstation
func GetBuilder ¶
func RemoveBuilder ¶
func RemoveBuilder(builderName string)
func RemoveCrackstation ¶
func RemoveCrackstation(hostUUID string)
func StartEventAutomation ¶
func StartEventAutomation()
StartEventAutomation - Starts an event automation goroutine
Types ¶
type Client ¶
Client - Single client connection
func (*Client) ToProtobuf ¶
ToProtobuf - Get the protobuf version of the object
type Crackstation ¶
type Crackstation struct { HostUUID string Station *clientpb.Crackstation Events chan *clientpb.Event // contains filtered or unexported fields }
func GetCrackstation ¶
func GetCrackstation(hostUUID string) *Crackstation
func NewCrackstation ¶
func NewCrackstation(station *clientpb.Crackstation) *Crackstation
func (*Crackstation) GetStatus ¶
func (c *Crackstation) GetStatus() *clientpb.CrackstationStatus
func (*Crackstation) UpdateStatus ¶
func (c *Crackstation) UpdateStatus(status *clientpb.CrackstationStatus)
type Event ¶
type Event struct { Session *Session Job *Job Client *Client Beacon *models.Beacon EventType string Data []byte Err error }
Event - An event is fired when there's a state change involving a
session, job, or client.
type ImplantConnection ¶
type ImplantConnection struct { ID string Send chan *sliverpb.Envelope RespMutex *sync.RWMutex Resp map[int64]chan *sliverpb.Envelope Transport string RemoteAddress string LastMessage time.Time LastMessageMutex *sync.RWMutex Cleanup func() }
ImplantConnection - Abstract connection to an implant
func NewImplantConnection ¶
func NewImplantConnection(transport string, remoteAddress string) *ImplantConnection
NewImplantConnection - Creates a new implant connection
func (*ImplantConnection) GetLastMessage ¶
func (c *ImplantConnection) GetLastMessage() time.Time
GetLastMessage - Retrieves the last message time
func (*ImplantConnection) ReqResend ¶
func (c *ImplantConnection) ReqResend(data []byte)
func (*ImplantConnection) UpdateLastMessage ¶
func (c *ImplantConnection) UpdateLastMessage()
UpdateLastMessage - Updates the last message time
type Job ¶
type Job struct { ID int Name string Description string Protocol string Port uint16 Domains []string JobCtrl chan bool PersistentID string ProfileName string }
Job - Manages background jobs
func (*Job) ToProtobuf ¶
ToProtobuf - Get the protobuf version of the object
type Pivot ¶
type Pivot struct { ID string OriginID int64 ImplantConn *ImplantConnection ImmediateImplantConn *ImplantConnection CipherCtx *cryptography.CipherContext Peers []*sliverpb.PivotPeer }
Pivot - Wraps an ImplantConnection
func NewPivotSession ¶
NewPivotSession - Creates a new pivot session
type PivotGraphEntry ¶
type PivotGraphEntry struct { PeerID int64 SessionID string Name string // PeerID -> Child Children map[int64]*PivotGraphEntry }
PivotGraphEntry - A single entry in the pivot graph
func PivotGraph ¶
func PivotGraph() []*PivotGraphEntry
PivotGraph - Creates a graph structure of sessions/pivots
func (*PivotGraphEntry) AllChildren ¶
func (e *PivotGraphEntry) AllChildren() []*PivotGraphEntry
AllChildren - Flat list of all children (including children of children)
func (*PivotGraphEntry) FindEntryByPeerID ¶
func (e *PivotGraphEntry) FindEntryByPeerID(peerID int64) *PivotGraphEntry
FindEntryByPeerID - Finds a pivot graph entry by peer ID, recursively
func (*PivotGraphEntry) Insert ¶
func (e *PivotGraphEntry) Insert(input *PivotGraphEntry)
Insert - Inserts a pivot into the graph, if it doesn't yet exist
func (*PivotGraphEntry) ToProtobuf ¶
func (e *PivotGraphEntry) ToProtobuf() *clientpb.PivotGraphEntry
ToProtobuf - Recursively converts the pivot graph to protobuf
type Session ¶
type Session struct { ID string Name string Hostname string Username string UUID string UID string GID string OS string Version string Arch string PID int32 Filename string Connection *ImplantConnection ActiveC2 string ReconnectInterval int64 ProxyURL string PollTimeout int64 Burned bool Extensions []string ConfigID string PeerID int64 Locale string FirstContact int64 Integrity string }
Session - Represents a connection to an implant
func NewSession ¶
func NewSession(implantConn *ImplantConnection) *Session
NewSession - Create a new session
func (*Session) LastCheckin ¶
LastCheckin - Get the last time a session message was received
func (*Session) Request ¶
Request - Sends a protobuf request to the active sliver and returns the response
func (*Session) ToProtobuf ¶
ToProtobuf - Get the protobuf version of the object
type Tunnel ¶
type Tunnel struct { ID uint64 SessionID string ToImplant chan []byte ToImplantSequence uint64 FromImplant chan *sliverpb.TunnelData FromImplantSequence uint64 Client rpcpb.SliverRPC_TunnelDataServer // contains filtered or unexported fields }
Tunnel - Essentially just a mapping between a specific client and sliver with an identifier, these tunnels are full duplex. The server doesn't really care what data gets passed back and forth it just facilitates the connection
func (*Tunnel) GetLastMessageTime ¶
func (*Tunnel) SendDataFromImplant ¶
func (t *Tunnel) SendDataFromImplant(tunnelData *sliverpb.TunnelData)