GoodbyeDPI README

The project's README from github.com/ValdikSS/GoodbyeDPI. As one markdown file: README.md.

GoodbyeDPI — Deep Packet Inspection circumvention utility

This software designed to bypass Deep Packet Inspection systems found in many Internet Service Providers which block access to certain websites.

It handles DPI connected using optical splitter or port mirroring (Passive DPI) which do not block any data but just replying faster than requested destination, and Active DPI connected in sequence.

Windows 7, 8, 8.1, 10 or 11 with administrator privileges required.

Quick start

These scripts launch GoodbyeDPI in recommended mode with DNS resolver redirection to Yandex DNS on non-standard port (to prevent DNS poisoning).
If it works — congratulations! You can use it as-is or configure further.

How to use

Download latest version from Releases page and run.

Supported arguments

To get relevant information about your version of the program, use the -h (--help) argument at startup.

Usage: goodbyedpi.exe [OPTION...]
 -p          block passive DPI
 -q          block QUIC/HTTP3
 -r          replace Host with hoSt
 -s          remove space between host header and its value
 -m          mix Host header case (test.com -> tEsT.cOm)
 -f <value>  set HTTP fragmentation to value
 -k <value>  enable HTTP persistent (keep-alive) fragmentation and set it to value
 -n          do not wait for first segment ACK when -k is enabled
 -e <value>  set HTTPS fragmentation to value
 -a          additional space between Method and Request-URI (enables -s, may break sites)
 -w          try to find and parse HTTP traffic on all processed ports (not only on port 80)
 --port        <value>    additional TCP port to perform fragmentation on (and HTTP tricks with -w)
 --ip-id       <value>    handle additional IP ID (decimal, drop redirects and TCP RSTs with this ID).
                          This option can be supplied multiple times.
 --dns-addr    <value>    redirect UDP DNS requests to the supplied IP address (experimental)
 --dns-port    <value>    redirect UDP DNS requests to the supplied port (53 by default)
 --dnsv6-addr  <value>    redirect UDPv6 DNS requests to the supplied IPv6 address (experimental)
 --dnsv6-port  <value>    redirect UDPv6 DNS requests to the supplied port (53 by default)
 --dns-verb               print verbose DNS redirection messages
 --blacklist   <txtfile>  perform circumvention tricks only to host names and subdomains from
                          supplied text file (HTTP Host/TLS SNI).
                          This option can be supplied multiple times.
 --allow-no-sni           perform circumvention if TLS SNI can't be detected with --blacklist enabled.
 --frag-by-sni            if SNI is detected in TLS packet, fragment the packet right before SNI value.
 --set-ttl     <value>    activate Fake Request Mode and send it with supplied TTL value.
                          DANGEROUS! May break websites in unexpected ways. Use with care (or --blacklist).
 --auto-ttl    [a1-a2-m]  activate Fake Request Mode, automatically detect TTL and decrease
                          it based on a distance. If the distance is shorter than a2, TTL is decreased
                          by a2. If it's longer, (a1; a2) scale is used with the distance as a weight.
                          If the resulting TTL is more than m(ax), set it to m.
                          Default (if set): --auto-ttl 1-4-10. Also sets --min-ttl 3.
                          DANGEROUS! May break websites in unexpected ways. Use with care (or --blacklist).
 --min-ttl     <value>    minimum TTL distance (128/64 - TTL) for which to send Fake Request
                          in --set-ttl and --auto-ttl modes.
 --wrong-chksum           activate Fake Request Mode and send it with incorrect TCP checksum.
                          May not work in a VM or with some routers, but is safer than set-ttl.
 --wrong-seq              activate Fake Request Mode and send it with TCP SEQ/ACK in the past.
 --native-frag            fragment (split) the packets by sending them in smaller packets, without
                          shrinking the Window Size. Works faster (does not slow down the connection)
                          and better.
 --reverse-frag           fragment (split) the packets just as --native-frag, but send them in the
                          reversed order. Works with the websites which could not handle segmented
                          HTTPS TLS ClientHello (because they receive the TCP flow "combined").
 --fake-from-hex <value>  Load fake packets for Fake Request Mode from HEX values (like 1234abcDEF).
                          This option can be supplied multiple times, in this case each fake packet
                          would be sent on every request in the command line argument order.
 --fake-with-sni <value>  Generate fake packets for Fake Request Mode with given SNI domain name.
                          The packets mimic Mozilla Firefox 130 TLS ClientHello packet
                          (with random generated fake SessionID, key shares and ECH grease).
                          Can be supplied multiple times for multiple fake packets.
 --fake-gen <value>       Generate random-filled fake packets for Fake Request Mode, value of them
                          (up to 30).
 --fake-resend <value>    Send each fake packet value number of times.
                          Default: 1 (send each packet once).
 --max-payload [value]    packets with TCP payload data more than [value] won't be processed.
                          Use this option to reduce CPU usage by skipping huge amount of data
                          (like file transfers) in already established sessions.
                          May skip some huge HTTP requests from being processed.
                          Default (if set): --max-payload 1200.


LEGACY modesets:
 -1          -p -r -s -f 2 -k 2 -n -e 2 (most compatible mode)
 -2          -p -r -s -f 2 -k 2 -n -e 40 (better speed for HTTPS yet still compatible)
 -3          -p -r -s -e 40 (better speed for HTTP and HTTPS)
 -4          -p -r -s (best speed)

Modern modesets (more stable, more compatible, faster):
 -5          -f 2 -e 2 --auto-ttl --reverse-frag --max-payload
 -6          -f 2 -e 2 --wrong-seq --reverse-frag --max-payload
 -7          -f 2 -e 2 --wrong-chksum --reverse-frag --max-payload
 -8          -f 2 -e 2 --wrong-seq --wrong-chksum --reverse-frag --max-payload
 -9          -f 2 -e 2 --wrong-seq --wrong-chksum --reverse-frag --max-payload -q (this is the default)

 Note: combination of --wrong-seq and --wrong-chksum generates two different fake packets.

How to check

To check if your ISP's DPI could be circumvented, first make sure that your provider does not poison DNS answers by enabling "Secure DNS (DNS over HTTPS)" option in your browser.

Then run the goodbyedpi.exe executable without any options. If it works — congratulations! You can use it as-is or configure further, for example by using --blacklist option if the list of blocked websites is known and available for your country.

If your provider intercepts DNS requests, you may want to use --dns-addr option to a public DNS resolver running on non-standard port (such as Yandex DNS 77.88.8.8:1253) or configure DNS over HTTPS/TLS using third-party applications.

Check the .cmd scripts and modify it according to your preference and network conditions.

How does it work

Passive DPI

Most Passive DPI send HTTP 302 Redirect if you try to access blocked website over HTTP and TCP Reset in case of HTTPS, faster than destination website. Packets sent by DPI usually have IP Identification field equal to 0x0000 or 0x0001, as seen with Russian providers. These packets, if they redirect you to another website (censorship page), are blocked by GoodbyeDPI.

Active DPI

Active DPI is more tricky to fool. Currently the software uses 7 methods to circumvent Active DPI:

These methods should not break any website as they're fully compatible with TCP and HTTP standards, yet it's sufficient to prevent DPI data classification and to circumvent censorship. Additional space may break some websites, although it's acceptable by HTTP/1.1 specification (see 19.3 Tolerant Applications).

The program loads WinDivert driver which uses Windows Filtering Platform to set filters and redirect packets to the userspace. It's running as long as console window is visible and terminates when you close the window.

How to build from source

This project can be built using GNU Make and mingw. The only dependency is WinDivert.

To build x86 exe run:

make CPREFIX=i686-w64-mingw32- WINDIVERTHEADERS=/path/to/windivert/include WINDIVERTLIBS=/path/to/windivert/x86

And for x86_64:

make CPREFIX=x86_64-w64-mingw32- BIT64=1 WINDIVERTHEADERS=/path/to/windivert/include WINDIVERTLIBS=/path/to/windivert/amd64

How to install as Windows Service

Check examples in service_install_russia_blacklist.cmd, service_install_russia_blacklist_dnsredir.cmd and service_remove.cmd scripts.

Modify them according to your own needs.

Known issues

Similar projects

Kudos

Thanks @basil00 for WinDivert. That's the main part of this program.

Thanks for every BlockCheck contributor. It would be impossible to understand DPI behaviour without this utility.

GoodbyeDPI (ValdikSS/GoodbyeDPI)

Searching Database…

这是什么?一款免费的 Windows 小工具,用来绕过运营商用来封锁网站的深度包检测(DPI)系统。它既能对付被动式 DPI(分光器或端口镜像),也能对付串联在链路中的主动式 DPI。
它是 VPN 吗,还是用别的方式工作?都不是——它不会把你的流量转发到任何地方。WinDivert 驱动会拦截数据包并修改或注入数据包(分片、伪造包、改动包头),让 DPI 无法识别和拦截。
怎么在我的电脑上跑起来?从 Releases 页面下载最新版本,解压后运行 1_russia_blacklist_dnsredir.cmd(俄罗斯用)或 2_any_country_dnsredir.cmd(其他国家用)。它们会以推荐模式启动程序,并把 DNS 重定向到非标准端口上的 Yandex DNS。
支持哪些 Windows 版本?需要管理员权限吗?需要 Windows 7、8、8.1、10 或 11,并以管理员身份运行。程序依赖的 WinDivert 驱动已随程序附带,只有从源码构建才需要额外工具(GNU Make 和 mingw)。
和其他软件或网络硬件有已知的冲突吗?有几处:Intel/Qualcomm Killer 网卡要关闭 Advanced Stream Detect 功能;QUIK 交易软件要先于 GoodbyeDPI 启动;过于老旧、长期没打补丁的 Windows 7 需要安装 KB3033929 更新才能加载 WinDivert 驱动。
怎么知道它对我的运营商有没有用?先把浏览器切换到 DNS over HTTPS(README 里演示了 Chrome 和 Firefox 使用 NextDNS 的设置),排除 DNS 污染的因素,然后不带任何参数运行 goodbyedpi.exe。如果被封锁的网站能打开了,就说明有效,之后可以用 --blacklist 之类的参数进一步调整。
它到底是怎么骗过 DPI 系统的?它用了七种小技巧:对第一个数据包和 HTTP keep-alive 会话做 TCP 层分片;篡改 Host 头(把 'Host' 改成 'hoSt'、混用大小写、去掉冒号后的空格);在 HTTP 方法和 URI 之间多加一个空格;以及发送 TTL 值很低、校验和错误或序号不对的伪造包——这些包能到达 DPI,却永远到不了目标服务器。
它会把我访问的网站弄坏或变慢吗?这些方法都设计成完全兼容 TCP 和 HTTP 标准的,所以网站应该照常工作。唯一要注意的是:多加空格的技巧虽然符合 HTTP/1.1 规范,但可能会让个别网站出问题。
它能在后台运行吗?还是必须一直开着那个命令行窗口?默认情况下,它只在命令行窗口开着时运行,窗口一关就退出。想让它持续运行,可以用 service_install 脚本把 GoodbyeDPI 注册成 Windows 服务——按自己的需要修改这些脚本即可。
我用的是 macOS、Linux 或安卓,有没有类似的工具?README 里列出了类似的项目:zapret 和 Green Tunnel 支持 macOS、Linux 和 Windows;PowerTunnel 和 SpoofDPI 支持桌面平台,还有安卓版;ByeDPI 是安卓免 root 的方案;youtubeUnblock 适用于 OpenWRT 路由器和 Linux。
Creator
ValdikSS
Size
0.2 MB
Stars
28.8K
Age
9y
Commits · 90 Days