pivots

package
v1.5.34 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFailedWrite - Failed to write to a connection
	ErrFailedWrite = errors.New("failed to write")
	// ErrFailedKeyExchange - Failed to exchange session and/or peer keys
	ErrFailedKeyExchange = errors.New("failed key exchange")

	// MyPeerID - This implant's Peer ID, a per-execution instance ID
	MyPeerID = generatePeerID()
)

Functions

func AddListener

func AddListener(listener *PivotListener)

AddListener - Add a listener

func GetListeners

func GetListeners() []*pb.PivotListener

GetListeners - Get a list of active listeners

func ListenerID

func ListenerID() uint32

ListenerID - Generate a new pivot id

func RemoveListener

func RemoveListener(id uint32)

RemoveListener - Stop a pivot listener

func RestartAllListeners

func RestartAllListeners(send chan<- *pb.Envelope)

RestartAllListeners - Start all pivot listeners

func SendToPeer

func SendToPeer(envelope *pb.Envelope) (bool, error)

SendToPeer - Forward an envelope to a peer

func StartListener

func StartListener(id uint32)

StartListener - Stop a pivot listener

func StopAllListeners

func StopAllListeners()

StopAllListeners - Stop all pivot listeners

func StopListener

func StopListener(id uint32)

StopListener - Stop a pivot listener

Types

type CreateListener

type CreateListener func(string, chan<- *pb.Envelope, ...bool) (*PivotListener, error)

CreateListener - Generic interface to a start listener function

type NetConnPivot

type NetConnPivot struct {
	Downstream chan *pb.Envelope
	// contains filtered or unexported fields
}

NetConnPivot - A generic pivot connection to a peer via net.Conn

func (*NetConnPivot) Close

func (p *NetConnPivot) Close() error

Close - Close connection to peer

func (*NetConnPivot) DownstreamPeerID

func (p *NetConnPivot) DownstreamPeerID() int64

DownstreamPeerID - ID of peer pivot

func (*NetConnPivot) RemoteAddress

func (p *NetConnPivot) RemoteAddress() string

RemoteAddress - Remote address of peer

func (*NetConnPivot) Start

func (p *NetConnPivot) Start(pivots *sync.Map)

Start - Starts the pivot connection handler

func (*NetConnPivot) ToProtobuf

func (p *NetConnPivot) ToProtobuf() *pb.NetConnPivot

ToProtobuf - Protobuf of pivot peer

type PivotListener

type PivotListener struct {
	ID               uint32
	Type             pb.PivotType
	Listener         net.Listener
	PivotConnections *sync.Map // PeerID (int64) -> NetConnPivot
	BindAddress      string
	Upstream         chan<- *pb.Envelope
	Options          []bool
}

PivotListener - A pivot listener

func CreateTCPPivotListener

func CreateTCPPivotListener(address string, upstream chan<- *pb.Envelope, opts ...bool) (*PivotListener, error)

CreateTCPPivotListener - Start a TCP listener

func (*PivotListener) Start

func (p *PivotListener) Start()

Start - Start the pivot listener

func (*PivotListener) Stop

func (l *PivotListener) Stop()

Stop - Stop the pivot listener

func (*PivotListener) ToProtobuf

func (l *PivotListener) ToProtobuf() *pb.PivotListener

ToProtobuf - Get the protobuf version of the pivot listener

Jump to

Keyboard shortcuts

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