transports

package
v1.15.16 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: GPL-3.0 Imports: 18 Imported by: 4

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 GetInterval added in v1.5.5

func GetInterval() int64

GetInterval - Get the beacon interval {{if .Config.IsBeacon}}

func GetJitter added in v1.5.5

func GetJitter() int64

GetJitter - Get the beacon jitter {{if .Config.IsBeacon}}

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 SetInterval added in v1.5.5

func SetInterval(newInterval int64)

SetInterval - Set the interval value dynamically

func SetJitter added in v1.5.5

func SetJitter(newJitter int64)

SetJitter - Set the jitter value dynamically

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
}

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

	Writer io.WriteCloser
	// contains filtered or unexported fields
}

Tunnel - Duplex byte read/write

func NewTunnel added in v1.5.14

func NewTunnel(id uint64, reader io.ReadCloser, writer io.WriteCloser) *Tunnel

func (*Tunnel) Close added in v1.5.15

func (c *Tunnel) Close()

Close - close tunnel reader and writer

func (*Tunnel) IncReadSequence added in v1.5.14

func (c *Tunnel) IncReadSequence()

func (*Tunnel) IncWriteSequence added in v1.5.14

func (c *Tunnel) IncWriteSequence()

func (*Tunnel) ReadSequence

func (c *Tunnel) ReadSequence() uint64

func (*Tunnel) WriteSequence

func (c *Tunnel) WriteSequence() uint64

Directories

Path Synopsis
drivers/win/wininet
Code generated by tools/defines.go; DO NOT EDIT.
Code generated by tools/defines.go; DO NOT EDIT.

Jump to

Keyboard shortcuts

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