transports

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func C2Generator

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

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

func GetInterval

func GetInterval() int64

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

func GetJitter

func GetJitter() int64

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

func GetMaxConnectionErrors

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

func SetInterval(newInterval int64)

SetInterval - Set the interval value dynamically

func SetJitter

func SetJitter(newJitter int64)

SetJitter - Set the jitter value dynamically

func SetReconnectInterval

func SetReconnectInterval(interval int64)

SetReconnectInterval - Runtime set the running reconnect interval

func StartBeaconLoop

func StartBeaconLoop(abort <-chan struct{}) <-chan *Beacon

StartBeaconLoop - Starts the beacon loop generator

func StartConnectionLoop

func StartConnectionLoop(abort <-chan struct{}, temporaryC2 ...string) <-chan *Connection

StartConnectionLoop - Starts the main connection loop

Types

type Beacon

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

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

Duration - Interval + random value <= Jitter

func (*Beacon) Interval

func (b *Beacon) Interval() int64

Interval - Interval between beacons

func (*Beacon) Jitter

func (b *Beacon) Jitter() int64

Jitter - Jitter between beacons

type BeaconCleanup

type BeaconCleanup func() error

type BeaconClose

type BeaconClose func() error

type BeaconInit

type BeaconInit func() error

type BeaconRecv

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

type BeaconSend

type BeaconSend func(*pb.Envelope) error

type BeaconStart

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

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) ReqResend

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

func (*Connection) Tunnel

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

Tunnel - Add tunnel to mapping

func (*Connection) URL

func (c *Connection) URL() string

URL - Get the c2 URL of the connection

type Start

type Start func() error

type Stop

type Stop func() error

type Tunnel

type Tunnel struct {
	ID uint64

	// Reader       io.ReadCloser
	Readers []io.ReadCloser

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

Tunnel - Duplex byte read/write

func NewTunnel

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

func (*Tunnel) Close

func (c *Tunnel) Close()

Close - close tunnel reader and writer

func (*Tunnel) IncReadSequence

func (c *Tunnel) IncReadSequence()

func (*Tunnel) IncWriteSequence

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