Skip to content

Instantly share code, notes, and snippets.

@tomrittervg
Forked from asn-d6/opportunistic socks
Last active October 11, 2019 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomrittervg/e0552ed007dbe50077528936b09a2eff to your computer and use it in GitHub Desktop.
Save tomrittervg/e0552ed007dbe50077528936b09a2eff to your computer and use it in GitHub Desktop.
Normal situation
blabla.onion Tor Tor Browser
<user asks for blabla.onion>
<--- SOCKS CONNECT to blabla.onion ---
<Tor fetches descriptor>
<Tor does introduction>
<Tor does rendezvous>
<---- RELAY_BEGIN ----
----- CONNECTED ------>
----- SOCKS REPLY to blabla.onion ----->
<---- HTTP GET -------------------------
<---- DATA -----------
----- DATA ---------->
----- HTTP RESPONSE --------------------->
Optimized situation
blabla.onion Tor Tor Browser
<user asks for blabla.onion>
<--- SOCKS CONNECT to blabla.onion ---
<Tor fetches descriptor>
<Tor does introduction>
----- FAKE SUCCESSFUL SOCKS REPLY --->
<---- HTTP GET -----------------------
<Tor does rendezvous>
<---- RELAY_BEGIN ----
<---- DATA -----------
----- CONNECTED ------>
----- DATA ---------->
----- HTTP RESPONSE --------------------->
Alternate Optimized Situation (Race Condition)
blabla.onion Tor Tor Browser
<user asks for blabla.onion>
<--- SOCKS CONNECT to blabla.onion ---
<Tor fetches descriptor>
<Tor does introduction>
----- FAKE SUCCESSFUL SOCKS REPLY --->
<Tor does rendezvous>
<---- RELAY_BEGIN ----
----- CONNECTED ------>
<---- HTTP GET -----------------------
<---- DATA -----------
----- DATA ---------->
----- HTTP RESPONSE --------------------->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment