protocol

package
v0.7.1-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageInfoRequest = uint8(iota)
	MessageInfoReply
	MessageConnectRequest
	MessageConnectResponse
	MessageHostPingRequest
	MessageHostPingResponse
	MessageListenerRequest // Start a listener
	MessageListenerResponse
	MessageListenerBindRequest // Bind to a listener
	MessageListenerBindResponse
	MessageListenerSockRequest // Bind to a socket
	MessageListenerSockResponse
	MessageListenerCloseRequest
	MessageListenerCloseResponse
	MessageClose
)
View Source
const (
	TransportTCP = uint8(iota)
	TransportUDP
)
View Source
const (
	Networkv4 = uint8(iota)
	Networkv6
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectRequestPacket

type ConnectRequestPacket struct {
	Net       uint8
	Transport uint8
	Address   string
	Port      uint16
}

ConnectRequestPacket is sent by the proxy to request a new TCP/UDP connection

type ConnectResponsePacket

type ConnectResponsePacket struct {
	Established bool
	Reset       bool
}

ConnectResponsePacket is the response to the ConnectRequestPacket and indicate if the connection can be established, and if a RST packet need to be sent

type Envelope

type Envelope struct {
	Type    uint8
	Size    int32
	Payload interface{}
}

Envelope is the structure used when Encoding/Decode ligolo packets

type HostPingRequestPacket

type HostPingRequestPacket struct {
	Address string
}

HostPingRequestPacket is used when a ICMP packet is received on the proxy server. It is used to request a ping request to the agent

type HostPingResponsePacket

type HostPingResponsePacket struct {
	Alive bool
}

HostPingResponsePacket is sent by the agent to indicate the requested host status

type InfoReplyPacket

type InfoReplyPacket struct {
	Name       string
	Interfaces []NetInterface
	SessionID  string
}

InfoReplyPacket contains the Name of the agent and the network interfaces configuration

type InfoRequestPacket

type InfoRequestPacket struct {
}

InfoRequestPacket is sent by the proxy to discover the agent information

type LigoloDecoder

type LigoloDecoder struct {
	Envelope Envelope
	// contains filtered or unexported fields
}

LigoloDecoder is the struct containing the decoded Envelope and the reader

func NewDecoder

func NewDecoder(reader io.Reader) LigoloDecoder

NewDecoder decode Ligolo-ng packets

func (*LigoloDecoder) Decode

func (d *LigoloDecoder) Decode() error

Decode read content from the reader and fill the Envelope

type LigoloEncoder

type LigoloEncoder struct {
	// contains filtered or unexported fields
}

LigoloEncoder is the structure containing the writer used when encoding Envelopes

func NewEncoder

func NewEncoder(writer io.Writer) LigoloEncoder

NewEncoder encode Ligolo-ng packets

func (*LigoloEncoder) Encode

func (e *LigoloEncoder) Encode(envelope Envelope) error

Encode an Envelope packet and write the result into the writer

type LigoloEncoderDecoder added in v0.5.1

type LigoloEncoderDecoder struct {
	LigoloDecoder
	LigoloEncoder
}

func NewEncoderDecoder added in v0.5.1

func NewEncoderDecoder(rw io.ReadWriter) LigoloEncoderDecoder

type ListenerBindPacket

type ListenerBindPacket struct {
	ListenerID int32
}

ListenerBindPacket is used by the proxy to Bind to a ListenerID, waiting for connections.

type ListenerBindReponse

type ListenerBindReponse struct {
	SockID    int32
	Err       bool
	ErrString string
}

ListenerBindReponse is returned when listener sockets are ready to be relayed from the agent to the proxy.

type ListenerCloseRequestPacket

type ListenerCloseRequestPacket struct {
	ListenerID int32
}

ListenerCloseRequestPacket is the packet sent when closing Listeners

type ListenerCloseResponsePacket

type ListenerCloseResponsePacket struct {
	ErrString string
	Err       bool
}

ListenerCloseResponsePacket is the response to ListenerCloseRequestPacket

type ListenerRequestPacket

type ListenerRequestPacket struct {
	Network string
	Address string
}

ListenerRequestPacket is used when a new listener socket is created by the proxy.

type ListenerResponsePacket

type ListenerResponsePacket struct {
	ListenerID int32
	Err        bool
	ErrString  string
}

ListenerResponsePacket is used to indicate if the Listener was created, and send the ListenerID.

type ListenerSockRequestPacket

type ListenerSockRequestPacket struct {
	SockID int32
}

ListenerSockRequestPacket is used by the proxy when relaying a listener socket

type ListenerSockResponsePacket

type ListenerSockResponsePacket struct {
	ErrString string
	Err       bool
}

ListenerSockRequestPacket is the response to ListenerSockRequestPacket

type ListenerUDPPacket added in v0.4.5

type ListenerUDPPacket struct {
}

ListenerUDPPacket

type NetInterface

type NetInterface struct {
	Index        int              // positive integer that starts at one, zero is never used
	MTU          int              // maximum transmission unit
	Name         string           // e.g., "en0", "lo0", "eth0.100"
	HardwareAddr net.HardwareAddr // IEEE MAC-48, EUI-48 and EUI-64 form
	Flags        net.Flags        // e.g., FlagUp, FlagLoopback, FlagMulticast
	Addresses    []string
}

NetInterface is the structure containing the agent network informations

func NewNetInterfaces

func NewNetInterfaces(netif []net.Interface) (out []NetInterface)

NewNetInterfaces converts a net.Interface slice to a NetInterface slice that can be transmitted over Gob

Jump to

Keyboard shortcuts

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