Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uTLS probe #14

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

uTLS probe #14

wants to merge 4 commits into from

Conversation

jmwample
Copy link
Owner

@jmwample jmwample commented Nov 7, 2022

Add a tls probe that can build the ClientHello out of a uTLS fingerprint. In whole addresses #6 because we could in theory send any fingerprint.

@jmwample
Copy link
Owner Author

jmwample commented Nov 7, 2022

The generation time for these payloads is not good, like significantly worse than Quic.

utls_payload_gen_flamegraph

This was generated using a CPU profiling benchmark comparing TLS, Quic, and uTLS probe generation.

The probe works and generates a valid TLS ClientHello, but in calling ApplyPreset the utls.UConn has to call generateECDHEParameters twice serially. Once in makeClientHello and once directly.


To generate the profiling information run:

# generate cpuprof
go test -bench=GeneratePayloads -cpuprofile=cpuprof/genpayload_utls.out

# view cpuprof
pprof -http :9000 cpuprof/genpayload_utls.out  

@jmwample jmwample changed the title Utls probe uTLS probe Nov 7, 2022
@jmwample
Copy link
Owner Author

jmwample commented Nov 7, 2022

better solution found. Generate one ClientHello with a call to ApplyPreset. From here we can modify the PubClientHelloMsg object to change out fields that need randomized (client Random, SessionID, ...?). This actually works really well and is faster than the original TLS probe generator.
NOTE: This required a PR to utls to add Marshal() for PubClientHelloMsg refraction-networking/utls#138

utls_payload_gen_better_flamegraph

todo:

  • decide what fields need swapped per probe
  • make sure seeding is happening properly so subsequent probes actually contain random data
  • allow client to specify the fingerprint somehow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant