fragmentor

package
v2.0.7+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_FRAGMENTOR_NOTICES               = 3
	MAX_FRAGMENTOR_ITERATIONS_PER_NOTICE = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config specifies a fragmentor configuration. NewUpstreamConfig and NewDownstreamConfig will generate configurations based on the given client parameters.

func NewDownstreamConfig

func NewDownstreamConfig(
	p *parameters.ClientParametersSnapshot, tunnelProtocol string, seed *prng.Seed) *Config

NewDownstreamConfig creates a new Config; may return nil. Specifying the PRNG seed allows for optional replay of a fragmentor sequence.

func NewUpstreamConfig

func NewUpstreamConfig(
	p *parameters.ClientParametersSnapshot, tunnelProtocol string, seed *prng.Seed) *Config

NewUpstreamConfig creates a new Config; may return nil. Specifying the PRNG seed allows for optional replay of a fragmentor sequence.

func (*Config) MayFragment added in v1.0.10

func (config *Config) MayFragment() bool

MayFragment indicates whether the fragmentor configuration may result in any fragmentation; config can be nil. When MayFragment is false, the caller should skip wrapping the associated conn with a fragmentor.Conn.

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

Conn implements simple fragmentation of application-level messages/packets into multiple TCP packets by splitting writes into smaller sizes and adding delays between writes.

The intent of Conn is both to frustrate firewalls that perform DPI on application-level messages that cross TCP packets as well as to perform a simple size and timing transformation to the traffic shape of the initial portion of a TCP flow.

func NewConn

func NewConn(
	config *Config,
	noticeEmitter func(string),
	conn net.Conn) *Conn

NewConn creates a new Conn. When no seed was provided in the Config, SetPRNG must be called before the first Write.

func (*Conn) Close

func (c *Conn) Close() (err error)

func (*Conn) CloseWrite

func (c *Conn) CloseWrite() error

func (*Conn) GetMetrics

func (c *Conn) GetMetrics() common.LogFields

GetMetrics implements the common.MetricsSource interface.

func (*Conn) IsClosed

func (c *Conn) IsClosed() bool

func (*Conn) SetPRNG added in v1.0.10

func (c *Conn) SetPRNG(PRNG *prng.PRNG)

SetPRNG sets the PRNG to be used by the fragmentor. Specifying a PRNG allows for optional replay of a fragmentor sequence. SetPRNG is intended to be used with obfuscator.GetDerivedPRNG and allows for setting the PRNG after a conn has already been wrapped with a fragmentor.Conn (but before the first Write).

If no seed is specified in NewUp/DownstreamConfig and SetPRNG is not called before the first Write, the Write will fail. If a seed was specified, or SetPRNG was already called, SetPRNG has no effect.

func (*Conn) Write

func (c *Conn) Write(buffer []byte) (int, error)

Jump to

Keyboard shortcuts

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