TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

GreenTunnel: anti-censorship utility designed to bypass deep packet inspection

280 pointsby hieudang9about 5 years ago

17 comments

snvzzabout 5 years ago
This is a nice workaround for those stuck under censorship regimes such as the UK, South Korea, Turkey, India or China.<p>Now, Encrypted DNS (thanks to DNS over TLS&#x2F;HTTPS) and HTTPS (thanks to Let&#x27;s Encrypt and HSTS) are getting deployed somewhat widely.<p>The next step is encrypted SNI[0], and it&#x27;ll get this much harder to do any meaningful DPI, for censorship or else.<p>[0]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Server_Name_Indication#Security_implications_(ESNI)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Server_Name_Indication#Securit...</a>
评论 #22657890 未加载
评论 #22658764 未加载
评论 #22660595 未加载
travisgriggsabout 5 years ago
Why hasn&#x27;t this become the modern Right to Bear Arms? The root of the second amendment was trying to ensure that one class of citizenry did not have tools at their hands to force another class of citizenry to comply. It maintained a balance. The right to encrypt and keep your data private should be a modern equivalent of the right to bear arms.
评论 #22660505 未加载
评论 #22662936 未加载
评论 #22660091 未加载
m_a_gabout 5 years ago
It is working perfectly for Turkcell Superonline, Turkey. Unfortunately, anti-censorship tools are very crucial for us these days. Thank you for your work.
评论 #22662538 未加载
segfaultbuserrabout 5 years ago
&gt; <i>GET &#x2F; HTTP&#x2F;1.0</i><p>&gt; <i>Host: www.youtube.com</i><p>&gt; <i>We send it in 2 parts: first comes GET &#x2F; HTTP&#x2F;1.0 \n Host: www.you and second sends as tube.com \n .... In this example, ISP cannot find blocked word YouTube in packets and you can bypass it!</i><p>If you talk to anyone from China that <i>this</i> is how you bypass (HTTP) &quot;deep packet inspection&quot;, it would sound incrediblely naive. I&#x27;m not criticizing here, thanks for developing an anti-censorship tool, but my point is, any DPI that can be bypassed in this way is simply too outdated, it&#x27;s far from the state-of-art threats we are facing worldwide.<p>What China does today is what your ISP&#x2F;government is going to do tomorrow, when they upgrade the equipment. Learning a history lesson from China, can help providing insights for developers in other countries to know where this cat-and-mouse game is heading to...<p>&gt; paulryanrogers: So basically it just does two things: carefully chunking HTTP header packets and encrypted DNS? Not sure this will work for very long.<p>Of course it will not. I&#x27;ll explain why.<p>---<p>Literally, the same technique was used in China during the early days of Great Firewall, around 2007. At that time, the &quot;censorship stack&quot; was simple, basically, it had...<p>* A brute-force IP blocking list<p>This is a constantly updated list of IP addresses of &quot;unwanted&quot; web servers, such as YouTube or Facebook. They are distributed via the BGP protocol, just like how normal routing information is distributed. Once your server enters this blacklist, nothing can be done. Not all unwanted websites enter the list due to its computational&#x2F;storage costs.<p>* A DNS poisoning infrastructure<p>A list of &quot;unwanted&quot; domain names are maintained. These domain names are entered to the national DNS root server as records with bogus IP addresses. It was used more widely than the IP blocklist, since it has zero cost to operate, but it can only block websites in the list and it takes time for the censor to be aware of a target&#x27;s existence.<p>* A naive keyword filtering system.<p>All outgoing international traffic is mirrored for inspection. A keyword inspection system attempts to match the URLs in HTTP requests against a blacklist of unwanted keywords. Rumors said the string matching was performed by hardware in ASIC&#x2F;FPGA, allowing enormous throughput.<p>* A TCP reset attack system<p>Once an unwanted TCP connection is identified by the keyword inspection system, the TCP Reset attack system fires a bogus RST packet to your computer, fooled by the packet, your operating system will voluntarily work against you and terminate the connection, saving the censors&#x27; CPU time. The keyword filtering system paired with reset attack was the preferred way to carry out censorship.<p>That&#x27;s all. The principle of operation was simple and easy to understand. So what were the options for bypassing it? There were a lot. To begin with, the blocked IP addresses were blocked, you could do nothing about it. But in the earliest day, accessing them was as simple as finding a random HTTP proxy server. Later, the inspection system was upgraded to match HTTP proxy requests. Then, you could simply play some magic tricks with your HTTP requests, like the example in the beginning, so that your request wouldn&#x27;t trigger a match. Around the same time, in-browser web proxy tools became popular, they were PHP scripts running on a web server that fetched pages. However, they became useless when the keyword matching system was upgraded to match the content of the entire page, not simply the requests (remember, few sites had HTTPS). At this point, all plaintext proxy techniques and HTTP request &quot;massaging&quot; techniques were all officially dead.<p>Some naive rot13-like techniques were later implemented to some web proxies, HTTPS web proxies were also a thing, but they saw limited use.<p>* New: A complete keyword filtering system - Inspect all HTML pages (Was: A naive keyword filtering system)<p>Another target to attack was the DNS poisoning system, sometimes all you needed was a correct IP address, since not all IPs were included in the blocklist due to the costs. Initially, all one needed to do was modifying one nameserver to 8.8.8.8. However, countermeasures were quickly deployed. A simple countermeasure was rerouting 8.8.8.8 to the ISP&#x27;s nameserver, continued feeding the same bogus records to you. Nevertheless, there were always alternative resolvers to use. So the system was upgraded to provide a DNS spoofing infrastructure - at the instant an outgoing DNS packet is detected, the spoofing system would immediately answer with a bogus packet. The real packet would arrive at a hundred milliseconds later, but it would be too late, your OS had already accepted the bogus result.<p>And ironically, even if DNSSEC was widely supported (it was not), it couldn&#x27;t do anything but returning an SERVFAIL, since DNSSEC can only check whether the result was true, dropping the bogus packet and accepting the true one was outside the capabilities of a standard DNSSEC implementation.<p>* New: A Real-time DNS Spoofing System<p>Better tools were developed later, that acted like a transparent resolver between the upstream resolver and your computer, that identified the bogus results to drop them, but the use was limited. Also, at this point, the IP blocklist has been greatly expanded. Even if a correct IP could be obtained, it was still inaccessible. Around 2008 or so, a special open source project was launched by developers in China - &#x2F;etc&#x2F;hosts list, whenever someone found a Facebook IP address that was not in the blocklist yet, one sent patches to the project. There were also shell scripts to keep your list up-to-date.<p>However, a &#x2F;etc&#x2F;hosts list was useful but its usefulness was limited. First, it was a matter of time before a new IP address was blocked. Also, a working IP address still was restricted by the same keyword filtering system.<p>* New: Expanded IP Blocklist.<p>Some people also realized that the firewall was only able to terminate a connection by fooling the operating system. Soon, iptables rules for blocking RST packets appeared in technical blogs. By ignoring all RST packets, one essentially gained immunity at the expense of network stability, as legitimate RSTs were also ignored. Soon, the censorship responded by upgrading the reset attack system, so that RST packets were sent to both directions - even if you ignored RST, the server on the other side would still terminate it. Also, RST was now &quot;latched-on&quot; for a limited time, when the first RST was triggered, the target remained inaccessible in several minutes.<p>* New: Bidirectional TCP Reset Attack<p>* New: &quot;Latched-On&quot; Reset Attack<p>When HTTPS was enabled, it was impossible to perform keyword inspection in the HTML pages - at this time, censor sometimes still wished to allow partial access, only triggering the block when detected a match. This strategy cannot be applied to HTTPS, since the content was all encrypted. Some people realized some popular websites supported HTTPS but not enabled it by default, such as Wikipedia. The Great Firewall responded by implementing a HTTPS certificate matching subsystem in the keyword matching system, when a particular certificate was matched, you were greeted by a TCP RST packet (this system has been removed later when HTTPS saw widespread use).<p>* New: Certificate-Based HTTPS Blocking System<p>At this point, around 2010, the only reliable way to browse the web was using a fully-encrypted proxy, such as SSH dynamic port forwarding or a VPN, which required purchasing a VPS from a hosting provider. SSH was more popular due to its ease of use - all one needed was finding a SSH server and ran &quot;ssh -D 1337&quot;, so that port 1337 would be a SOCKS5 proxy provided by OpenSSH. OpenVPN was reserved for heavy web users, since it&#x27;s more difficult to setup, but had better performance.<p>From the beginning to the 2010s, anyone who was using VPN or SSH can enjoy reliable web browsing (only be disturbed from time to time due to the overloaded international bandwidth). However, the good days came to an end when the Great Firewall implemented a real-time traffic classifier, it was first applied to SSH. It observed the SSH packets in real-time and attempted to identify whether an overlay proxy traffic was carried on top of it. The blocking mechanism was enhanced as well, now it was able to dynamically inserting null route entries when it decided that the communication with a server was unwanted. The IP blocking system was also improved, now it was able to collect unwanted IP addresses at a faster rate with help of the traffic classifier. If you used SSH as a proxy, after a while the connection would be identified, with all packets dropped, repeated offenses would earn you a permanent IP block. For VPNs, the firewall implemented a real-time classifier to detect OpenVPN&#x27;s TLS handshakes. When handshakes were detected, a RST packet is sent (or if you use UDP, all packets are dropped). Repeated offenses would earn you a permanent IP block as well.<p>New: Real-Time Traffic Classifier<p>New: Real-Time IP Blocking<p>New: Actively Updated IP Blocklist using Classifiers as Feedback<p>Traffic classifiers would later be expanded to cover HTTPS-in-HTTPS as well, so a naive HTTPS proxy wouldn&#x27;t work, and possibly have other features, it&#x27;s a mystery.<p>BTW, after Google exited from China, the HTTPS version was immediately blocked, and for HTTP, a ridiculous keyword blocklist was enforced and it generated huge amount of false-positive RSTs for harmless words, apparently a deliberate decision, preferring false-positive over false-negative. Eventually, all Google services had been permanently blocked. The IP block became extensive, major websites have been completely blocked, the unblocked sites were only exceptions. For most people, the arrival of widely-used HTTPS was too late and useless, since IPs were blocked. And as mentioned, SSH and VPNs were classified and blocked as well.<p>This was when a new generation of proxy tools started to gain popularity,
评论 #22659550 未加载
评论 #22662171 未加载
1996about 5 years ago
A simple countermeasure at the ISP level: a buffer to merge &#x27;www.you&#x27; to &#x27;tube.com&#x27;<p>A far greater danger is DPI that use statistical analysis to detect possible tunnels. You want your traffic to be as close as possible to normal traffic. There is no perfect solution there. The current best is generating valid images with a hidden data payload (to download), and generating pseudo text posted on public forums or email (to upload) while limiting the download&#x2F;upload ratio, by downloading random content if necessary as most people download far more than they upload.<p>It works best when using &quot;known&quot; websites like gmail (draft folder) or facebook (messenger), as all the traffic goes to a whitelisted host and look like regular usage.
评论 #22656426 未加载
paulryanrogersabout 5 years ago
So basically it just does two things: carefully chunking HTTP header packets and encrypted DNS?<p>Not sure this will work for very long.
评论 #22656122 未加载
评论 #22655923 未加载
kburmanabout 5 years ago
Works with You Broadband, India. Thanks a lot man!
__sy__about 5 years ago
This is great if there isn&#x27;t a blanket ban on VPN&#x27;s, but unfortunately, it won&#x27;t work in China. I&#x27;ve had next to zero-luck keeping my own VPN tunnels open for more than a couple of days at a time when behind the great firewall.
评论 #22657461 未加载
评论 #22658175 未加载
jogundasabout 5 years ago
Is that a SOCKS proxy, or just a HTTP proxy? The github readme does not make that clear.
benbristowabout 5 years ago
Doesn&#x27;t work against Virgin Media UK
评论 #22655667 未加载
评论 #22659554 未加载
oedmarapabout 5 years ago
It&#x27;s really good to see more tools in the privacy space, resulting in more options and fallbacks for the end-user.<p>I think the author should also try to market this as much as possible outside of the HN crowd, since this seems targeted at non-tech users — I could be wrong but my reasoning is that HN users who care about privacy would prefer a combination of a VPN and DoH to defend against traffic &amp; DNS inspection, respectively.
评论 #22657505 未加载
dontdieychabout 5 years ago
It&#x27;s working very well against South Korea, KT(ISP)
Thorentisabout 5 years ago
&gt; We send it in 2 parts: first comes GET &#x2F; HTTP&#x2F;1.0 \n Host: www.you and second sends as tube.com<p>How does this even work? &quot;www.you&quot; won&#x27;t return a valid HTTP response and &quot;tube.com&quot; won&#x27;t either. How can you fetch the content at &quot;youtube.com&quot; but splitting the domain name in half? Won&#x27;t you get two completely wrong responses that don&#x27;t fit together?
评论 #22659645 未加载
the_resistenceabout 5 years ago
Need some more insights into proper use. I couldn&#x27;t get to work in mainland China
hrdwdmrblabout 5 years ago
How does this differ from Gigsaw&#x27;s Outline, Shadowsocks or V2Ray?
terrycodyabout 5 years ago
Any one tested if this tool work in China or not?
david_dracoabout 5 years ago
Why not use Tor?
评论 #22658153 未加载