transports

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: GPL-3.0 Imports: 18 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func C2Generator added in v1.5.0

func C2Generator(c2Servers []string, abort <-chan struct{}) <-chan *url.URL

C2Generator - Creates a stream of C2 URLs based on a connection strategy

func GetMaxConnectionErrors added in v1.5.0

func GetMaxConnectionErrors() int

GetMaxConnectionErrors - Parse the max connection errors inserted at compile-time

func GetReconnectInterval

func GetReconnectInterval() time.Duration

GetReconnectInterval - Parse the reconnect interval inserted at compile-time

func SetReconnectInterval added in v1.4.15

func SetReconnectInterval(interval int64)

SetReconnectInterval - Runtime set the running reconnect interval

func StartBeaconLoop added in v1.5.0

func StartBeaconLoop(c2s []string, abort <-chan struct{}) <-chan *Beacon

StartBeaconLoop - Starts the beacon loop generator

func StartConnectionLoop

func StartConnectionLoop(c2s []string, abort <-chan struct{}) <-chan *Connection

StartConnectionLoop - Starts the main connection loop

Types

type Beacon added in v1.5.0

type Beacon struct {
	Init    BeaconInit
	Start   BeaconStart
	Send    BeaconSend
	Recv    BeaconRecv
	Close   BeaconClose
	Cleanup BeaconCleanup

	ActiveC2 string
	ProxyURL string
}

Beacon - Abstract connection to the server

func (*Beacon) Duration added in v1.5.0

func (b *Beacon) Duration() time.Duration

Duration - Interval + random value <= Jitter

func (*Beacon) Interval added in v1.5.0

func (b *Beacon) Interval() int64

Interval - Interval between beacons

func (*Beacon) Jitter added in v1.5.0

func (b *Beacon) Jitter() int64

Jitter - Jitter between beacons

type BeaconCleanup added in v1.5.0

type BeaconCleanup func() error

type BeaconClose added in v1.5.0

type BeaconClose func() error

type BeaconInit added in v1.5.0

type BeaconInit func() error

type BeaconRecv added in v1.5.0

type BeaconRecv func() (*pb.Envelope, error)

type BeaconSend added in v1.5.0

type BeaconSend func(*pb.Envelope) error

type BeaconStart added in v1.5.0

type BeaconStart func() error

type Connection

type Connection struct {
	Send   chan *pb.Envelope
	Recv   chan *pb.Envelope
	IsOpen bool

	Start Start
	Stop  Stop
	// contains filtered or unexported fields
}

Connection - Abstract connection to the server

func (*Connection) AddTunnel

func (c *Connection) AddTunnel(tun *Tunnel)

AddTunnel - Add tunnel to mapping

func (*Connection) Cleanup

func (c *Connection) Cleanup()

Cleanup - Execute cleanup once

func (*Connection) ProxyURL added in v1.5.0

func (c *Connection) ProxyURL() string

ProxyURL - Get the c2 URL of the connection

func (*Connection) RemoveTunnel

func (c *Connection) RemoveTunnel(ID uint64)

RemoveTunnel - Add tunnel to mapping

func (*Connection) RequestResend added in v1.4.15

func (c *Connection) RequestResend(data []byte)

func (*Connection) Tunnel

func (c *Connection) Tunnel(ID uint64) *Tunnel

Tunnel - Add tunnel to mapping

func (*Connection) URL added in v1.5.0

func (c *Connection) URL() string

URL - Get the c2 URL of the connection

type Start added in v1.5.0

type Start func() error

type Stop added in v1.5.0

type Stop func() error

type Tunnel

type Tunnel struct {
	ID uint64

	Reader       io.ReadCloser
	ReadSequence uint64

	Writer        io.WriteCloser
	WriteSequence uint64
}

Tunnel - Duplex byte read/write

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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