A simple and fast anti-censorship tool written in Go
Go to file
xvzc 884a855a4d
chore: add release action (#143)
* docs: uppercase names of readme files

* cicd: add release action

* cicd: add release-template

* cicd: make release action run on workflow_dispatch

* cicd: test

* No commit message

* cicd: test

* No commit message

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd test

* cicd: test

* cicd: test

* cicd: test

* cicd: test

* cicd: test
2024-08-15 13:22:07 +09:00
_docs chore: add release action (#143) 2024-08-15 13:22:07 +09:00
.github chore: add release action (#143) 2024-08-15 13:22:07 +09:00
cmd/spoof-dpi remove unnecessary import 2024-08-07 07:49:06 +09:00
dns fix: re-add handling leading https and trailing /dns-query 2024-08-13 13:30:59 +09:00
packet refactor reading http request 2024-08-15 02:39:23 +09:00
proxy fix: nil pointer deref 2024-08-14 18:55:04 +05:00
util remove buffer-size parameter 2024-08-14 12:06:29 +05:00
version prepare for v0.10.8 2024-08-15 02:57:36 +09:00
.gitignore preserve legacy fragmentation 2024-07-27 11:00:53 +09:00
build preserve legacy fragmentation 2024-07-27 11:00:53 +09:00
Dockerfile Update Dockerfile 2024-08-05 18:20:26 +03:00
go.mod fixed: move doh to internal 2024-08-10 13:43:12 +07:00
go.sum fixed: move doh to internal 2024-08-10 13:43:12 +07:00
install.sh update readme 2024-07-27 11:10:32 +09:00
LICENSE Update LICENSE 2023-02-17 01:53:03 +09:00
make-releases.sh add windows release 2024-08-15 01:58:52 +09:00
README.md chore: add release action (#143) 2024-08-15 13:22:07 +09:00

PRs or any form of contribution will be appreciated

SpoofDPI

Read in other Languages: 🇬🇧English, 🇰🇷한국어, 🇨🇳简体中文, 🇷🇺Русский, 🇯🇵日本語

A simple and fast software designed to bypass Deep Packet Inspection

image

Installation

Binary

SpoofDPI will be installed in ~/.spoof-dpi/bin. To run SpoofDPI in any directory, add the line below to your ~/.bashrc || ~/.zshrc || ...

export PATH=$PATH:~/.spoof-dpi/bin

# macOS Intel
curl -fsSL https://raw.githubusercontent.com/xvzc/SpoofDPI/main/install.sh | bash -s darwin-amd64

# macOS Apple Silicon
curl -fsSL https://raw.githubusercontent.com/xvzc/SpoofDPI/main/install.sh | bash -s darwin-arm64

# linux-amd64
curl -fsSL https://raw.githubusercontent.com/xvzc/SpoofDPI/main/install.sh | bash -s linux-amd64

# linux-arm
curl -fsSL https://raw.githubusercontent.com/xvzc/SpoofDPI/main/install.sh | bash -s linux-arm

# linux-arm64
curl -fsSL https://raw.githubusercontent.com/xvzc/SpoofDPI/main/install.sh | bash -s linux-arm64

# linux-mips
curl -fsSL https://raw.githubusercontent.com/xvzc/SpoofDPI/main/install.sh | bash -s linux-mips

# linux-mipsle
curl -fsSL https://raw.githubusercontent.com/xvzc/SpoofDPI/main/install.sh | bash -s linux-mipsle

Go

You can also install SpoofDPI with go install

$ go install github.com/xvzc/SpoofDPI/cmd/spoof-dpi@latest

Git

You can also build your own

$ git clone https://github.com/xvzc/SpoofDPI.git
$ cd SpoofDPI
$ go build ./cmd/...

Usage

Usage: spoof-dpi [options...]
  -addr string
        listen address (default "127.0.0.1")
  -debug
        enable debug output
  -dns-addr string
        dns address (default "8.8.8.8")
  -dns-port int
        port number for dns (default 53)
  -enable-doh
        enable 'dns-over-https'
  -no-banner
        disable banner
  -pattern value
        bypass DPI only on packets matching this regex pattern; can be given multiple times
  -port int
        port (default 8080)
  -system-proxy
        enable system-wide proxy (default true)
  -timeout int
        timeout in milliseconds; no timeout when not given
  -v    print spoof-dpi's version; this may contain some other relevant information
  -window-size int
        chunk size, in number of bytes, for fragmented client hello,
        try lower values if the default value doesn't bypass the DPI;
        when not given, the client hello packet will be sent in two parts:
        fragmentation for the first data packet and the rest

If you are using any vpn extensions such as Hotspot Shield in Chrome browser, go to Settings > Extensions, and disable them.

OSX

Run spoof-dpi and it will automatically set your proxy

Linux

Run spoof-dpi and open your favorite browser with proxy option

google-chrome --proxy-server="http://127.0.0.1:8080"

How it works

HTTP

Since most of websites in the world now support HTTPS, SpoofDPI doesn't bypass Deep Packet Inspections for HTTP requets, However It still serves proxy connection for all HTTP requests.

HTTPS

Although TLS encrypts every handshake process, the domain names are still shown as plaintext in the Client hello packet. In other words, when someone else looks on the packet, they can easily guess where the packet is headed to. The domain name can offer a significant information while DPI is being processed, and we can actually see that the connection is blocked right after sending Client hello packet. I had tried some ways to bypass this, and found out that it seemed like only the first chunk gets inspected when we send the Client hello packet splited in chunks. What SpoofDPI does to bypass this is to send the first 1 byte of a request to the server, and then send the rest.

Inspirations

Green Tunnel by @SadeghHayeri GoodbyeDPI by @ValdikSS