Documentation
¶
Index ¶
- Constants
- Variables
- func ControlAutoTTL(network, address string, c syscall.RawConn) error
- func EstimateHops(ttl int) (int, bool)
- func FragmentRecord(rec []byte, cuts []int) []byte
- func QUICInitialPayload(sni string) ([]byte, error)
- func SupportsFake() bool
- func SupportsUDPFake() bool
- func WrapConn(c net.Conn, opts Options) net.Conn
- type AckCapability
- type AckState
- type AutoTTL
- type AutoTTLCapability
- type Capabilities
- type ClientHelloOptions
- type Conn
- type ConnCapabilities
- type DisorderCapability
- type FakeOptions
- type Hello
- type HopObservation
- type OOBOptions
- type Options
- type PacketConn
- type Pos
- type RandomCut
- type RandomOptions
- type SplitWait
- type UDPCounters
- type UDPOptions
- type UDPSnapshot
- type UDPTemplate
Constants ¶
const ( DefaultMaxClientHelloSize = 64 << 10 DefaultMaxClientHelloRecords = 256 DefaultClientHelloTimeout = 5 * time.Second )
const ( // MaxRandomRanges bounds RandomOptions.TLSRec and RandomOptions.Split each. MaxRandomRanges = 16 // MaxRandomCount bounds RandomCut.Count, the cuts drawn from one range. MaxRandomCount = 64 )
const DefaultOOBByte = 'a'
DefaultOOBByte is the out-of-band byte sent when OOBOptions.Byte is zero.
const DefaultQUICSNI = "www.wikipedia.org"
DefaultQUICSNI is the decoy server name of the QUIC Initial template when UDPOptions.SNI is empty (the server name of the TCP fake template).
Variables ¶
var ( // ErrAutoTTLUnsupported reports that this platform, or the connection's // address family, gives an unprivileged TCP socket no way to read the TTL // or hop limit of the packets it received. PlatformCapabilities().AutoTTL // and Unsupported["auto-ttl-ipv4"/"auto-ttl-ipv6"] say why. ErrAutoTTLUnsupported = errors.New("desync: auto TTL cannot observe the server's TTL here") // ErrAutoTTLUnobserved reports that the server's TTL was not observed or // does not yield a usable hop count, so no TTL could be derived. ErrAutoTTLUnobserved = errors.New("desync: auto TTL could not derive a TTL from the observed path") )
var ( // ErrSplitWaitUnsupported reports that the requested SplitWait mode cannot // be observed on this platform or socket. The wrapper never replaces it // with a timed pause; use SplitDelay for an explicit delay. ErrSplitWaitUnsupported = errors.New("desync: split wait is not supported on this platform") // ErrSplitWaitRequiresTCP reports a connection that does not expose a // TCP socket through SyscallConn, so its send queue cannot be observed. ErrSplitWaitRequiresTCP = errors.New("desync: split wait requires a TCP connection exposing SyscallConn") // ErrSplitWaitTimeout reports that the previous piece was not observed as // sent or acknowledged within SplitWaitTimeout. The connection is closed. ErrSplitWaitTimeout = errors.New("desync: split wait timed out") )
var ( // ErrDisorderUnsupported reports that Options.Disorder is not implemented // on this platform. ErrDisorderUnsupported = errors.New("desync: disorder is not implemented on this platform") // ErrOOBUnsupported reports that Options.OOB is not implemented on this // platform. ErrOOBUnsupported = errors.New("desync: out-of-band data is not implemented on this platform") // ErrSocketMethodRequiresTCP reports that Disorder or OOB was requested on // a connection that does not expose a TCP socket through SyscallConn. ErrSocketMethodRequiresTCP = errors.New("desync: disorder and OOB require a TCP connection exposing SyscallConn") )
var ( ErrFakeUnsupported = errors.New("desync: TCP fake is not implemented on this platform") ErrFakeRequiresTCP = errors.New("desync: TCP fake requires a connection exposing SyscallConn") ErrFakeBusy = errors.New("desync: too many pending TCP fake operations") // ErrFakeFirstPiece reports that, for this ClientHello, the fake piece // would be the first TCP piece, which Disorder or OOB already sends. It // is returned before any byte is written. ErrFakeFirstPiece = errors.New("desync: the fake piece is the first TCP piece, which Disorder/OOB send; add a split position before the fake prefix") )
var ( ErrClientHelloTooLarge = errors.New("desync: ClientHello exceeds configured size limit") ErrTooManyClientHelloRecords = errors.New("desync: ClientHello exceeds configured record limit") ErrClientHelloTimeout error = &clientHelloTimeoutError{} )
var ErrIncompleteClientHello = errors.New("desync: incomplete TLS ClientHello")
ErrIncompleteClientHello means that record framing or the complete first ClientHello handshake needs more bytes. It is not a successful missing SNI.
var ErrNotClientHello = errors.New("desync: not a TLS ClientHello")
ErrNotClientHello means the bytes are not the start of a TLS ClientHello.
var ErrUDPFakeRequiresSocket = errors.New("desync: UDP fake requires an unconnected UDP socket exposing SyscallConn")
var ErrUDPFakeUnsupported = errors.New("desync: UDP fake is not implemented on this platform")
Functions ¶
func ControlAutoTTL ¶
ControlAutoTTL prepares a socket before it connects, so that ObserveHops and FakeOptions.AutoTTL can later read the TTL of the server's SYN-ACK. Use it as (or call it from) net.Dialer.Control. Where the platform or family cannot observe the TTL it does nothing and returns nil, so a dialer can use it everywhere; the failure is reported when the TTL is needed.
On Linux it enables IPV6_RECVHOPLIMIT on IPv6 sockets. The kernel then clones every in-order segment to record its hop limit; the *Conn wrapper disables the option again once it read the value for the fake.
func EstimateHops ¶
EstimateHops guesses how many routers decremented a packet that arrived with the given TTL (or IPv6 hop limit). Senders start at one of the common initial values 64 (Linux, macOS, most network gear), 128 (Windows) or 255; paths are assumed shorter than 32 hops, so 33..64 is read as starting at 64, 97..128 at 128 and 224..255 at 255. Any other value is ambiguous and returns false. The guess is zapret's hop_count_guess (MIT, see third_party/NOTICE), except that 64 and 128 count as zero hops.
func FragmentRecord ¶
FragmentRecord splits one TLS record into several records at the given absolute offsets (header included in the numbering, like ParseHello's offsets). Every piece gets its own 5-byte header with the original content type and version, so the peer reassembles the same handshake message; a DPI box that only reads the first record no longer sees the whole ClientHello. Offsets outside the payload are ignored; rec is not modified.
func QUICInitialPayload ¶
QUICInitialPayload returns one QUIC v1 Initial decoy of 1200 bytes whose ClientHello carries sni (DefaultQUICSNI when empty; ByeDPI wildcards '*', '?' and '#' are expanded). Use it as a fixed UDPOptions.Payload; UDPOptions.Template = UDPTemplateQUICInitial generates a fresh one per burst instead.
func SupportsFake ¶
func SupportsFake() bool
SupportsFake reports platform availability, not effectiveness on a network.
func SupportsUDPFake ¶
func SupportsUDPFake() bool
Types ¶
type AckCapability ¶
type AckCapability struct {
// Mechanism names the kernel interface, empty when there is none.
Mechanism string
// Sent and Acked report which SplitWait modes are implemented.
Sent, Acked bool
// Reliable is true when the decision reads the kernel's own per-socket
// send-queue state. It is false when it is inferred from cumulative
// counters that can run ahead of the queue, so the wait may end early
// (see docs/connection-io.md).
Reliable bool
}
AckCapability describes how SplitWait observes a socket on this OS.
func (AckCapability) Supports ¶
func (a AckCapability) Supports(mode SplitWait) bool
Supports reports whether mode can be honored. SplitWaitNone always can.
type AckState ¶
type AckState struct {
// Unacked counts written bytes not yet acknowledged, sent or not.
Unacked int64
// Unsent counts written bytes not yet transmitted once.
Unsent int64
// InFlight counts transmitted bytes not yet acknowledged.
InFlight int64
// Sent is the cumulative number of distinct bytes transmitted on the
// connection (counter-based platforms only).
Sent int64
}
AckState is a snapshot of a socket's send queue. Values that the platform cannot observe are -1.
type AutoTTL ¶
type AutoTTL struct {
// Delta is subtracted from the hop count, 1..254 (0 means 1). It is the
// margin between the fake's last hop and the server.
Delta int
// Min and Max bound the TTL, 1..255 (0 means 3 and 20). A path so short
// that hops-Delta is below Min still uses Min, unless Min reaches the
// server; then no TTL is derived.
Min, Max int
}
AutoTTL derives a low TTL from the observed length of the path to the server: TTL = hops - Delta, clamped to Min..Max. A result that is not below the hop count would reach the server, so it is rejected instead. The hop count comes from the TTL of the server's packets (see EstimateHops), which assumes the return path is as long as the forward path.
Zero fields select the defaults (Delta 1, Min 3, Max 20, zapret's --dpi-desync-autottl default), so &AutoTTL{} is a complete policy.
type AutoTTLCapability ¶
type AutoTTLCapability struct {
// Mechanism names the kernel interface, empty when there is none.
Mechanism string
// IPv4 and IPv6 report the peer families that can be observed.
IPv4, IPv6 bool
}
AutoTTLCapability describes how the package observes the server's TTL.
type Capabilities ¶
type Capabilities struct {
// OS is runtime.GOOS.
OS string
// FakeTCP reports Options.Fake support (same as SupportsFake).
FakeTCP bool
// FakeUDP reports WrapPacketConn support (same as SupportsUDPFake).
FakeUDP bool
// TTLControl reports that the package changes and restores a socket's
// TTL or hop limit on this OS (used by Fake, Disorder and the UDP burst).
TTLControl bool
// Disorder describes Options.Disorder support.
Disorder DisorderCapability
// OOB reports Options.OOB support.
OOB bool
// Ack describes send-queue / acknowledgement observation for SplitWait.
Ack AckCapability
// AutoTTL describes observing the server's TTL for FakeOptions.AutoTTL.
AutoTTL AutoTTLCapability
// Unsupported explains, keyed by method ("fake-tcp", "fake-udp",
// "disorder", "oob", "auto-ttl-ipv4", "auto-ttl-ipv6"), why a method is
// not implemented on this OS.
Unsupported map[string]string
}
Capabilities describes what this build of the package implements on the current operating system. It reports availability, not effectiveness on a particular network. ProbeConn checks an actual socket.
func PlatformCapabilities ¶
func PlatformCapabilities() Capabilities
PlatformCapabilities reports what the package implements on this OS.
type ClientHelloOptions ¶
type ClientHelloOptions struct {
// MaxSize includes the four-byte handshake header; valid range 4..1 MiB.
MaxSize int
// MaxRecords bounds input records through the end of the hello (1..4096).
MaxRecords int
// Timeout bounds incomplete assembly, not socket transmission. It starts
// with the first accepted incomplete write and is never extended by input.
// The valid range is positive through one minute; zero defaults to 5 s.
Timeout time.Duration
}
ClientHelloOptions bounds first-handshake assembly. Zero fields use the defaults above. The options apply only when a transformation is enabled.
type Conn ¶
Conn applies Options to the first ClientHello written to an underlying conn.
func (*Conn) FakeTTL ¶
FakeTTL reports the TTL the fake prefix was sent with, and whether AutoTTL derived it (false: the fixed or fallback Fake.TTL). It is 0 until the fake was attempted.
type ConnCapabilities ¶
type ConnCapabilities struct {
// TTL is the socket's current TTL (IPv4 peer) or unicast hop limit (IPv6
// peer), or -1 when it cannot be read; TTLErr explains why.
TTL int
TTLErr error
// Ack lists the SplitWait modes this socket can honor; AckErr explains a
// failed probe, in which case no mode is available.
Ack AckCapability
AckErr error
// State is the send-queue snapshot taken by the probe.
State AckState
}
ConnCapabilities is the result of probing an actual connection.
type DisorderCapability ¶
type DisorderCapability struct {
// Supported reports that Options.Disorder is implemented.
Supported bool
// Mechanism names the socket query used around the low-hop piece.
Mechanism string
// Observed is true when the hop limit is restored only after the kernel
// reported the low-hop piece as transmitted. When false (macOS), the
// piece is written once the send buffer is empty, so the kernel builds
// its segment inside the send call; this is inferred, not observed.
Observed bool
// Reliable is true when the observation reads the kernel's queue state
// rather than counters (see AckCapability.Reliable).
Reliable bool
}
DisorderCapability describes Options.Disorder on this OS.
type FakeOptions ¶
type FakeOptions struct {
// TTL expires the fake before the server (1..255). With AutoTTL it is
// the fallback used when the path cannot be observed; 0 then fails the
// write instead.
TTL int
// AutoTTL derives the TTL from the TTL of the server's packets on this
// connection (see AutoTTL, ControlAutoTTL and
// PlatformCapabilities().AutoTTL).
AutoTTL *AutoTTL
// Prefix is the end of the fake piece, measured after TLS record
// fragmentation. Negative offsets count from the end; zero defaults to
// -1 (all but the last byte).
Prefix int
// Payload defaults to ByeDPI v0.17.3's MIT-licensed TLS template.
// It is zero-padded or truncated to the fake piece's length.
Payload []byte
// Timeout defaults to 3 seconds for native queue/completion waits.
// Normal tail writes obey the connection's write deadline. A deadline on
// the wrapper can shorten native waits; Close interrupts them.
Timeout time.Duration
// SNI replaces the decoy's server name. With several names one is drawn
// per connection. In a name '*' becomes a random letter or digit, '?' a
// random letter and '#' a random digit. Names must be DNS host names
// (at most 64 names). A template's padding extension absorbs the length
// change, so the template keeps its 517 bytes.
SNI []string
// FromOriginal builds the decoy from the connection's own ClientHello
// (ByeDPI --fake-tls-mod orig) instead of Payload or the template. It
// needs SNI or Randomize and excludes Payload.
FromOriginal bool
// Randomize replaces the decoy's random, session ID and key share values
// with fresh random bytes per connection (ByeDPI --fake-tls-mod rand).
// It needs a ClientHello decoy (the template, a ClientHello Payload or
// FromOriginal).
Randomize bool
// Offset starts the decoy transmission at this byte of the decoy
// (ByeDPI --fake-offset), for example to align a decoy with a fake
// piece that does not start the stream. 0 starts at its first byte.
Offset int
}
FakeOptions changes one TCP piece's initial transmission to low-TTL decoy bytes while retaining the original piece for TCP retransmission. It does not insert bytes into the application's stream. Implemented on Windows and Linux (including Android); see PlatformCapabilities for the macOS reason.
Without Split the fake piece is the prefix [0, Prefix). With Split or Random.Split positions the prefix end is one more cut, and the fake piece is the piece that ends there (ByeDPI --fake as one of several parts): the pieces before it and after it are ordinary writes, Disorder/OOB still act on the first piece, and SplitDelay/SplitWaitSent apply between pieces.
type Hello ¶
type Hello struct {
// RecordLen is the full length of the first record, header included.
RecordLen int
// SNI is the server name, "" when the hello has none.
SNI string
// SNIOffset is where the server name starts; -1 without SNI. The name can
// cross record headers, so use SNI rather than slicing contiguous wire bytes.
SNIOffset int
}
Hello describes the first complete ClientHello. Offsets refer to original wire bytes, including any existing TLS record headers.
func ParseHello ¶
ParseHello parses a complete ClientHello across consecutive TLS records. It uses default size/record limits, ignores bytes after its final record, and returns ErrIncompleteClientHello if the handshake is not complete. RecordLen remains the length of the first input record for compatibility.
type HopObservation ¶
type HopObservation struct {
// TTL is the TTL or hop limit of the last in-order segment received
// from the server, normally its SYN-ACK.
TTL int
// Hops is EstimateHops(TTL).
Hops int
}
HopObservation is what ObserveHops read from a connection.
func ObserveHops ¶
func ObserveHops(c net.Conn) (HopObservation, error)
ObserveHops reads the TTL of the packets the server sent on c (unwrapping *Conn and other NetConn wrappers) and estimates the path length. It works only where PlatformCapabilities().AutoTTL reports the connection's family, and only for a socket created with ControlAutoTTL; otherwise the error wraps ErrAutoTTLUnsupported or ErrAutoTTLUnobserved. It changes nothing; call it before the first Write of a *Conn with AutoTTL, which turns the observation off once it used it.
type OOBOptions ¶
type OOBOptions struct {
// Byte is the urgent byte; zero selects DefaultOOBByte ('a').
Byte byte
}
OOBOptions sends one byte of TCP urgent data (MSG_OOB) right after the first TCP piece (ByeDPI --oob). A receiver without SO_OOBINLINE removes the urgent byte from the stream, so the server reads the original bytes; an inspecting device that ignores the urgent pointer sees one extra byte.
type Options ¶
type Options struct {
// ClientHello bounds incomplete assembly. Nil/zero fields use defaults.
ClientHello *ClientHelloOptions
// Fake selects a platform-specific low-TTL first transmission.
Fake *FakeOptions
// TLSRec splits the ClientHello into separate TLS records at these
// positions (ByeDPI --tlsrec).
TLSRec []Pos
// Split sends the (possibly record-split) ClientHello in separate TCP
// writes, cut at these positions of the original record (ByeDPI --split).
Split []Pos
// SplitDelay is a pause between the TCP pieces; 0 sends them back to back.
SplitDelay time.Duration
// SplitWait waits, before each further TCP piece, until the kernel
// reports the previous bytes as sent or acknowledged. Unsupported modes
// fail Validate and the first Write; see PlatformCapabilities.
SplitWait SplitWait
// SplitWaitTimeout bounds each SplitWait wait (default 2 s, max 1 min).
SplitWaitTimeout time.Duration
// Random adds bounded random record/write cuts; nil keeps the strategy
// deterministic. Include Key() in a strategy ID so it is never reused for
// a different randomization policy or seed.
Random *RandomOptions
// Disorder sends the first TCP piece with hop limit 1, so it expires at
// the first router, then restores the hop limit and sends the rest; TCP
// retransmits the first piece with the normal hop limit (ByeDPI
// --disorder). It needs Split or Random.Split positions. The hop limit is
// restored once the kernel reports the piece as transmitted (bounded by
// SplitWaitTimeout); see PlatformCapabilities().Disorder.
Disorder bool
// OOB sends one urgent (MSG_OOB) byte right after the first TCP piece
// (ByeDPI --oob; with Disorder, --disoob). It needs Split or Random.Split
// positions.
OOB *OOBOptions
}
Options selects what happens to the first complete TLS ClientHello of a connection. Everything after it is passed through untouched, and a connection that does not start with a ClientHello is never modified.
func FakeTTLCandidates ¶
FakeTTLCandidates expands a TTL range into one Options per TTL, in ascending order: copies of base with Fake.TTL set to from..to and Fake.AutoTTL cleared. It is the deterministic fallback where the path cannot be observed (see PlatformCapabilities().AutoTTL): register each candidate under an ID derived from its Key, which is stable for a given base and TTL, and let automatic discovery probe them. base.Fake must be set; the candidates share base's slices, which WrapConn copies.
func (Options) Key ¶
Key returns a stable, canonical description of every field that affects the transformation, including the randomization policy and seed. Consumers that cache strategies by ID (for example with the controller package) should derive the ID or PolicyVersion from Key, so a cached ID never silently changes meaning. Equal keys mean identical behavior for this library version prefix; different keys may still behave alike (for example a nil ClientHello and its explicit defaults). The fake payload is represented by its SHA-256 digest rather than its bytes.
type PacketConn ¶
type PacketConn struct {
net.PacketConn
// contains filtered or unexported fields
}
PacketConn owns writes to its UDP socket. Do not write to the underlying socket separately: its TTL is changed temporarily during injection. ReadFrom, deadlines and Close retain net.PacketConn semantics. No raw socket or packet driver is required. Peers are bounded to 64 per socket and expire after idle.
func WrapPacketConn ¶
func WrapPacketConn(pc net.PacketConn, opts UDPOptions) (*PacketConn, error)
func (*PacketConn) Close ¶
func (c *PacketConn) Close() error
func (*PacketConn) Counters ¶
func (c *PacketConn) Counters() UDPSnapshot
type Pos ¶
Pos is an absolute byte offset in the original TLS wire input, or an offset from the server name ("+s") in logical handshake bytes, skipping record headers.
type RandomCut ¶
type RandomCut struct {
From, To Pos
// Count is 1..MaxRandomCount; zero means one cut.
Count int
// MinPiece is 1..ClientHello max size bytes; zero means one byte.
MinPiece int
}
RandomCut draws Count cut positions uniformly from the inclusive range [From, To]. Both ends use one anchor: absolute (wire offsets, like Pos) or SNI-relative (logical handshake bytes from the server name, like "+s").
Cuts are chosen among logical handshake byte boundaries, so an absolute range never places a cut inside an existing record header; a wire offset in a header means the start of that record's payload. The range is clipped to the ClientHello; an SNI-relative range is ignored without an SNI, like Pos.
MinPiece is the minimum distance between two cuts of this range and from either end of the handshake. When the clipped range cannot hold Count cuts at that spacing, as many as fit are drawn. A random cut that coincides with another cut or an existing record boundary adds nothing.
type RandomOptions ¶
type RandomOptions struct {
// TLSRec ranges add TLS record boundaries (randomized --tlsrec).
TLSRec []RandomCut
// Split ranges add TCP write boundaries (randomized --split). Like Split,
// they cannot be combined with Fake yet.
Split []RandomCut
// Seed makes the draws reproducible: every connection wrapped with the
// same nonzero Seed and options cuts the same ClientHello identically,
// which is meant for tests and bug reports. Zero (the default) draws an
// independent seed from crypto/rand for every connection.
Seed uint64
}
RandomOptions adds bounded random cuts to the deterministic TLSRec/Split positions. It is opt-in: a nil Options.Random keeps a strategy fully deterministic, and the deterministic positions keep their exact meaning when randomization is enabled; random cuts are only added to them.
Random cuts are drawn once per connection, for its first ClientHello. They never change logical handshake bytes, never create an empty TLS record or an empty write, and add no delay beyond an explicitly configured SplitDelay.
type SplitWait ¶
type SplitWait uint8
SplitWait selects what the wrapper observes on the socket before it writes the next TCP piece of a split ClientHello. It is not a delay: the wait ends as soon as the kernel reports the condition, and fails with an error when it cannot be observed. The OS still decides how bytes become segments.
const ( // SplitWaitNone writes the pieces back to back (plus SplitDelay). SplitWaitNone SplitWait = iota // SplitWaitSent waits until every byte written so far has been // transmitted at least once (it left the socket's unsent queue). SplitWaitSent // SplitWaitAcked waits until every byte written so far has been // acknowledged by the peer. SplitWaitAcked )
func ParseSplitWait ¶
ParseSplitWait parses "none", "sent" or "acked".
type UDPCounters ¶
type UDPCounters struct {
// contains filtered or unexported fields
}
UDPCounters is a concurrency-safe, optional aggregate; its zero value is ready.
func (*UDPCounters) Snapshot ¶
func (c *UDPCounters) Snapshot() UDPSnapshot
type UDPOptions ¶
type UDPOptions struct {
TTL int
// Repeats defaults to 6, and must be between 1 and 16.
Repeats int
// Packets defaults to 3 initial application datagrams per peer (1-8).
Packets int
// Payload defaults to 64 zero bytes. Custom payloads may contain 1-1200 bytes.
Payload []byte
// QUIC decoys. Template generates the decoy instead of Payload (which
// must then be empty); SNI is the server name in the QUIC Initial
// template's ClientHello (default DefaultQUICSNI, wildcards as in
// FakeOptions.SNI); QUICOnly limits the burst to datagrams that look like
// a QUIC client Initial (long header, version 1, a draft or 2, Initial
// type, at least 1200 bytes), so other UDP traffic passes untouched and
// does not count towards Packets.
Template UDPTemplate
SNI string
QUICOnly bool
// Counters can be shared by sockets belonging to one outbound. Do not copy
// or reset a counters value after it has been used.
Counters *UDPCounters
}
UDPOptions inserts a bounded burst of low-TTL datagrams before the first few application datagrams to each peer. The original payload is unchanged. TTL must expire beyond the inspecting device and before the actual peer; effectiveness and a suitable TTL must be established on the user's network.
func UDPTTLCandidates ¶
func UDPTTLCandidates(base UDPOptions, from, to int) ([]UDPOptions, error)
UDPTTLCandidates is FakeTTLCandidates for the UDP burst. The burst precedes the peer's first reply, so there is no packet whose TTL could be observed in time; a TTL range probed by discovery, or AutoTTL.TTL applied to the hops ObserveHops measured on a TCP connection to the same server, selects it instead.
func (UDPOptions) Key ¶
func (o UDPOptions) Key() string
Key returns a stable, canonical description of the fields that affect the UDP burst, like Options.Key (Counters is not part of it), including the QUIC decoy Template, SNI and QUICOnly. The payload is represented by its SHA-256 digest.
func (UDPOptions) Validate ¶
func (o UDPOptions) Validate() error
type UDPSnapshot ¶
type UDPTemplate ¶
type UDPTemplate int
UDPTemplate selects a generated decoy for the UDP burst.
const ( // UDPTemplateZero is 64 zero bytes (ByeDPI's UDP fake), the default. UDPTemplateZero UDPTemplate = iota // UDPTemplateQUICInitial is a QUIC v1 client Initial packet (RFC 9000, // RFC 9001): long header, version 1, random 8-byte DCID and SCID, a // CRYPTO frame with a TLS ClientHello for UDPOptions.SNI, PADDING to // 1200 bytes, payload and header protection with the Initial keys derived // from the DCID. An inspecting device that decrypts Initials, as anyone // can, reads the decoy's server name. A new packet is generated for every // burst. UDPTemplateQUICInitial )
func (UDPTemplate) String ¶
func (t UDPTemplate) String() string
Source Files
¶
- ack_linux.go
- autottl.go
- autottl_linux.go
- capability.go
- clienthello.go
- conn.go
- disorder.go
- fake.go
- fake_hello.go
- fake_linux.go
- fake_payload.go
- hello_assembly.go
- hello_frame.go
- hello_limits.go
- hop.go
- hop_linux.go
- key.go
- oob_unix.go
- packet.go
- packet_linux.go
- packet_quic.go
- packet_unix.go
- pos.go
- random.go
- sockopt_linux.go
- tlsrec.go
- ttlrange.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
desync-probe
command
Command desync-probe measures which desync strategies reach which sites on the network it runs on, and writes a report that is safe to share.
|
Command desync-probe measures which desync strategies reach which sites on the network it runs on, and writes a report that is safe to share. |
|
desync-socks
command
Command desync-socks is a minimal SOCKS5 proxy (CONNECT only, no auth) that applies desync.Options to every outgoing connection.
|
Command desync-socks is a minimal SOCKS5 proxy (CONNECT only, no auth) that applies desync.Options to every outgoing connection. |
|
Package controller selects opaque strategy IDs using explicitly supplied, application-aware probes.
|
Package controller selects opaque strategy IDs using explicitly supplied, application-aware probes. |
|
Package presets is the shared strategy catalog of desync: named TCP transformations (desync.Options) and UDP bursts (desync.UDPOptions) with stable IDs, the platform features each one needs, and an ordering hint.
|
Package presets is the shared strategy catalog of desync: named TCP transformations (desync.Options) and UDP bursts (desync.UDPOptions) with stable IDs, the platform features each one needs, and an ordering hint. |