-
Notifications
You must be signed in to change notification settings - Fork 82
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
Thinking about building a covert TCP proxy that's based on DPI. But is it possible? #352
Comments
This is not new, someone has already implemented. |
I believe this might be possible using fallback in xray, but I am not sure. I can tell for sure though that even if this setup exists, it is not a widely deployed one. Using a camouflaging website (example.com) is not new at all. But the idea of hiding authentication in ClientHello is interesting because I think that way, it could be possible to present as example.com with a valid ssl cert. Current attempts at camouflaging terminate the entire TLS session. This means that if authentication fails, they forward example.com back to the client, but with self-signed SSL certificate that is not valid for example.com. This makes it much easier to hide auth, but the camouflaging is imperfect this way. |
Yes, if the auth fails, I want to forward the raw TCP to example.com. |
I'd like to learn more about that. Are there any details of that implementation? |
HTTPS server fallback strategy: Authentication through TLS ClientHello: |
See also: https://github.com/sergeyfrolov/httpt |
For steganographically encoding authentication data in TLS messages, see some "tagging" schemes using in refraction networking systems:
Conjure §4.1 uses the same tagging scheme as TapDance.
|
Implemented in XRay XTLS Reality. You get real valid signed response from example.com if authentication fails. |
from my understanding, hysteria2, xray reality and also HTTPT do not forward example.com as-is, and present a self-signed or otherwise invalid certificate when the camouflage website is opened. HTTPS server fallbacks are generally extremely widespread because they can be achieved using 10 lines of nginx config (though xray and hysteria do not speak HTTP after auth, afaik) |
Not sure about Hysteria2 and Httpt but Xray in Reality mode does exactly what you want. Signed response from example.com as-is. |
About REALITY: |
You can also compare to "mask sites" in Conjure:
|
I'm thinking about a covert TCP proxy that hides authentication message in ClientHello of TLSv1.3. The goal is to make it hard to detect such proxies for both passive attacker and active attacker.
In the diagram above, "HTTPS Server" is an ordinary HTTPS server. "Proxy Client" establishes an HTTPS connection to "Proxy Server" with TLSv1.3. It hides authentication message in the ClientHello message. "Proxy Server" checks the ClientHello and looks for authentication message. If it passes checks, the "Proxy Server" forwards the TCP connection to the "HTTPS Server", otherwise it forwards it to a configured website (example.com) on the internet.
The Proxy Client can hide authentication message in various fields of ClientHello. But the authentication message should be indistinguishable from values from a normal ClientHello. One possible way is to set the Session ID to the HMAC of the whole ClientHello with Session ID set to 0s.
Since TLSv1.3 encrypts the server's cert, a passive attacker can only see "example.com". An attacker that probes Proxy Server will only see the real example.com. And an attacker that replays the ClientHello can not finish the handshake.
There can be some pitfalls in this setup. For example, one should not select an example.com that reveals client IP. And size of server cert may reveal some information. But I think with careful parroting, these pitfalls can be mitigated. Now I wonder whether this setup can reliably bypass those sophisticated firewalls (e.g. GFW).
The text was updated successfully, but these errors were encountered: