Repository navigation
feat: decoy ClientHello, fake among split pieces and a QUIC Initial decoy - #8
Merged
Merged
Conversation
FakeOptions gains SNI (a list, one name drawn per connection, ByeDPI wildcards), FromOriginal, Randomize and Offset (ByeDPI --fake-sni, --fake-tls-mod orig/rand, --fake-offset). The decoy is decoded and re-encoded as a valid ClientHello with every length recomputed, then padded or truncated to the fake piece. Fake now combines with Split, Random.Split, Disorder, OOB, SplitDelay and SplitWaitSent: the fake prefix end is one more cut and the piece ending there is the fake, as in ByeDPI's part sequence. A fake first piece with Disorder/OOB fails with ErrFakeFirstPiece before sending; SplitWaitAcked is rejected. Linux lowers the hop limit only after SIOCOUTQNSD reports the earlier pieces sent; Windows writes the later pieces right after the TransmitFile submission. Key() lists the decoy options only when set.
UDPOptions.Template = UDPTemplateQUICInitial generates a QUIC v1 client Initial per burst: random DCID/SCID, a CRYPTO frame with a ClientHello for UDPOptions.SNI, PADDING to 1200 bytes, payload and header protection with the RFC 9001 Initial keys. QUICInitialPayload returns one such packet for a fixed Payload. QUICOnly limits the burst to datagrams that look like a QUIC client Initial, leaving other UDP traffic untouched.
-fake-sni, -fake-tls-mod rand,orig and -fake-offset set the decoy ClientHello; -fake now combines with -split, -disorder and -oob.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three additions to the fake methods: a decoy ClientHello with another server name, the fake as one piece among split pieces, and a QUIC Initial decoy for the UDP burst.
Decoy ClientHello (ByeDPI
--fake-sni,--fake-tls-mod,--fake-offset):SNI: one name per connection,*/?/#become a random alphanumeric/letter/digit; DNS host names only, at most 64.Randomize: fresh random, session ID and key shares.FromOriginal: build the decoy from the real ClientHello (needsSNIorRandomize, excludesPayload).Offset: start the decoy at a later byte.Fake with split pieces (ByeDPI parts followed by
-f), Windows and Linux/Android:ErrFakeFirstPiecebefore any byte;SplitWaitAckedwith fake is rejected.SIOCOUTQNSDreports the earlier pieces sent. Windows applies the TTL to theTransmitFilerequest and writes later pieces right after submitting it; it holds the 2-slot transmit limit meanwhile, so a longSplitDelayafter a fake delays other connections' fakes.QUIC Initial decoy for the UDP burst, all three OSes:
QUICOnlybursts only before datagrams that look like a QUIC client Initial; other UDP is untouched.QUICInitialPayload(sni)for a fixed payload.Key()gains the new fields only when set (existing keys pinned in tests).desync-socks:-fake-sni,-fake-tls-mod rand,orig,-fake-offset;-fakenow combines with-split,-disorder,-oob. Credits inthird_party/NOTICE.Rebased onto #7 (auto TTL): the auto-TTL hook is kept in both native backends.
Tests: decoy parses with
ParseHelloand carries the SNI, wildcards,FromOriginalacross records, validation, keys; piece sequencing on every OS (boundaries, which piece is fake, partial counts,ErrFakeFirstPiece); byte-identical server stream natively on Windows and Linux; Linux low-hop drop filter (root) for split-fake, fake-split, split-fake-wait, random-fake, disorder-fake, oob-fake, disoob-fake, fake-sni, fake-orig, split-fake-sni, IPv4 and IPv6, each delivering the original after one retransmission; QUIC RFC 9001 A.1 key vectors, decrypting the template, QUICOnly gating over UDP loopback. Checks after the rebase: gofmt,go mod tidy -diff, vet windows/linux/darwin; tests on Windows (Go 1.26.10 and 1.20.14) and Linux in Docker as root with-race(34 low-hop/auto-TTL subtests pass, none skipped). Not verified: real networks and DPI (decoy names, QUIC template), macOS runtime of the QUIC parts (CI), Windows retransmission of a differing decoy (loopback does not drop), whether real QUIC servers accept the template.