GithubHelp home page GithubHelp logo

refraction-networking / uquic Goto Github PK

View Code? Open in Web Editor NEW
32.0 32.0 2.0 14.93 MB

Low-level access to the QUIC Initial Packet for mimicry purposes, hard fork of quic-go.

Home Page: https://quic.tlsfingerprint.io

License: MIT License

Shell 0.08% Go 99.89% Dockerfile 0.03%
anti-censorship anticensorship golang parrot quic utls

uquic's People

Contributors

aaronriekenberg avatar birneee avatar bt90 avatar dependabot[bot] avatar dunglas avatar ebi-yade avatar gaukas avatar glonee avatar hareku avatar jbenoist avatar jfgiorgi avatar juliens avatar julienschmidt avatar kelmenhorst avatar lucas-clemente avatar marcopolo avatar marten-seemann avatar mengelbart avatar mw-jn avatar nmldiegues avatar q191201771 avatar renbou avatar sukunrt avatar tanghaowillow avatar tatianab avatar tobyxdd avatar twdkeule avatar vinozzz avatar weidideng avatar ydnar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gaukas orzuzro

uquic's Issues

feat: Customize Retry Initial Packet behavior

It is implementation-specific that when the server is not responding to QUIC Initial Packets carrying ClientHello messages, how often does the QUIC client retry by sending a new Initial Packet with a greater (by how many?) Packet Number, as well as how many retry will be made in total before the client gives up.

This could be trivially fingerprint-able and should be considered in designing a QUIC parrot.

bug: quic-go sending fallback Initial Packets that is not according to parrot specs

When the first (parroted) Initial Packets fail to send or not getting an response, quic-go will send 2 identical fallback Initial Packets with default FRAMEs (PADDING, CRYPTO) with the only difference being the packet number (PN=1, PN=2 respectively), therefore violating the specs. The packets are sent in the following section.

uquic/connection.go

Lines 1807 to 1815 in b248750

case ackhandler.SendPTOInitial:
if err := s.sendProbePacket(protocol.EncryptionInitial, now); err != nil {
return err
}
if s.sendQueue.WouldBlock() {
s.scheduleSending()
return nil
}
return s.triggerSending(now)

feat: Support variable length fields

Many QUIC clients don't have a single length for certain fields. Instead, they seem to have an upper and lower bound, which each connection randomly chooses a length within. Some of the fields I have noticed for this are as follows:

  • Destination ID
  • Source ID
  • Grease Length

feat: variable length QUIC Padding Frame

Some implementation (Google Chrome) uses Padding Frames to pad the QUIC payload to a certain length. Therefore despite being able to specify the exact bytes of each padding frames, it is also required to set a pad-to-N-bytes for QUIC Frames.

feat: oversized TLS ClientHello

Google Chrome 122 (or maybe earlier) started to send an oversized TLS ClientHello if Kyber768-based PQ Key Share has been enabled.

In terms of QUIC, the TLS ClientHello will be broken into several pieces, a fix-sized (~1200B) large piece with offset 0 and other smaller pieces with random length/offset. The fix-sized large chunk was send in the first initial packet as the only frame in the packet, and the rest of the chunks are send in the second packets with other frames (PING/PADDING).

feat: disable Initial ACK if server sends coalesced Initial+Handshake

As discussed in quic-go#4007, uQUIC would prefer having this OPTIONAL feature implemented since observation indicates it is implementation-specific:

Mozilla Firefox and Google Chrome will send Initial ACK only if server sends an Initial ServerHello that is NOT coalesced with a Handshake packet. Otherwise, as the Initial ServerHello being coalesced with Handshake EncryptedExtensions, they will omit the ACK to the Initial ServerHello.

Apple Safari behaves differently, it will explicitly ACK to the Initial ServerHello even when it is coalesced.


Related RFC9001 section:

4.9.1. Discarding Initial Keys
Packets protected with Initial secrets (Section 5.2) are not authenticated, meaning that an attacker could spoof packets with the intent to disrupt a connection. To limit these attacks, Initial packet protection keys are discarded more aggressively than other keys.

The successful use of Handshake packets indicates that no more Initial packets need to be exchanged, as these keys can only be produced after receiving all CRYPTO frames from Initial packets. Thus, a client MUST discard Initial keys when it first sends a Handshake packet and a server MUST discard Initial keys when it first successfully processes a Handshake packet. Endpoints MUST NOT send Initial packets after this point.

This results in abandoning loss recovery state for the Initial encryption level and ignoring any outstanding Initial packets.

feat: Allow variable length frame padding

Some implementations (quic-go) size their padding frames such that the entire datagram is less than a certain size. In order to accomplish this, func (qfs QUICFrames) Build(cryptoData []byte) (payload []byte, err error) should be updated to determine the size of all other frames and then size the padding frames accordingly.

bug: CI Test fails randomly

Further investigation needed on CI tests, for some of them are failing randomly and could not be reproduced stably (rerun the failed job and it may pass).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.