Authors: Anonymous, Anonymous
In this post, we release and open source a modified version of Shadowsocks that can bypass the current GFW’s detection and blocking. We first introduce the reason why this modified Shadowsocks can bypass the detection and blocking. We then share a simple tutorial on how to setup the client and server. We will also cover two other ways that help Shadowsocks and VMess bypass the current GFW’s blocking.
We release this modified Shadowsocks tool today for three reasons:
First, we want to provide Chinese netizens with a (temporarily) viable solution to bypass censorship, mitigating the GFW’s massive blocking of multiple censorship circumvention tools since October 3rd, 2022.
Second, we would like to take this opportunity to start a discussion among anti-censorship researchers and developers. Our empirical research shows that the current GFW can already accurately identify Shadowsocks, VMess, and Obfs4 and many other full-encrypted protocols. We estimate that the GFW’s current traffic detection algorithm has 0.6%
false positives, while the false negatives are almost negligible. This finding urgently requires us to brainstorm and discuss how to improve the current protocols collectively.
Finally, we would like to use this release as an experiment to observe both the censor and the anti-censorship community on how fast each side can react to a new (anti-)censorship event.
We worked with other researchers to discover that the current GFW utilizes a number of different rules to identify fully encrypted protocols like Shadowsocks, VMesss, and Obfs4. One of these rules takes advantage of the fact that the ratio of 0 bit to 1 bit in these encrypted flows is close to 1:1. Therefore, if we add more 0s or 1s to the encrypted traffic and then rearrange the bit sequence, we can achieve the goal of changing the original ratio feature to bypass detection and blocking.
This modified version of Shadowsocks is based on Shadowsocks-rust, and we also make use of Shadowsocks-android to compile the apk files for Android users. All client and server side software can be found at this branch and this release.
The installation process is the same as installing any other Shadowsocks-rust
server.
wget https://github.com/gfw-report/shadowsocks-rust/releases/download/v0.0.1-beta/shadowsocks-v1.15.0-alpha.9.x86_64-unknown-linux-gnu.tar.xz
tar xvf shadowsocks-v1.15.0-alpha.9.x86_64-unknown-linux-gnu.tar.xz
sudo nano server_config.json
Copy and past the following settings to the file. Note that you need to replace the password ExamplePassword
with a much stronger one. A handy way to do this from your terminal is: openssl rand -base64 16
. You may also want to change the server_port
.
{
"server": "0.0.0.0",
"server_port": 8388,
"password": "ExamplePassword",
"method": "aes-256-gcm"
}
After finishing editing, you type Ctrl + x
to exit. The text editor will ask "Save modified buffer?"
, and you can type y
and then hit Enter
.
tmux
session by:tmux
You then do:
./ssserver -c ./server_config.json
Finally, type Ctrl + b
and then type d
to detach from the tmux session.
We use ufw
to open ports for the Shadowsocks server.
To install ufw
on a Debian-based server:
sudo apt update && sudo apt install -y ufw
Then open ports for ssh
and Shadowsocks-rust
. Note that if you set the server_port
to a value different than 8388
in server_config.json
, you need to change the value 8388
below accordingly:
sudo ufw allow ssh
sudo ufw allow 8388
Now enable ufw
:
sudo ufw enable
If it prompts Command may disrupt existing ssh connections. Proceed with operation (y|n)?
, type y
and hit Enter
.
Finally, run sudo ufw status
, and the output should look like this:
Status: active
To Action From
-- ------ ----
22/tcp ALLOW Anywhere
8388 ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
8388 (v6) ALLOW Anywhere (v6)
Below is a configuration file for Client. Remember to change the server
value from ExampleServerIP
to your remote server’s public IP address. If you used andorid and installed from the apk file we provided, the usage should be the same as usual.
{
"server": "ExampleServerIP",
"server_port": 8388,
"password": "ExamplePassword",
"method": "aes-256-gcm",
"local_address": "127.0.0.1",
"local_port": 1080
}
chacha20-ietf-poly1305
or aes-256-gcm
.We know of two other currently viable options, all of which utilize a different traffic detection rule by the GFW.
If you are a V2Ray user, you can turn on the ExperimentReducedIvHeadEntropy
option to avoid the GFW’s detection and blocking. The advantage of this option is that you do not need to make any changes to your servers.
@database64128 also implemented another way to bypass the censorship. Because the protocol is changed, it requires updating both client and server to use it.
We thank David Fifield for commenting on an earlier draft of this article.
We encourage you to share your thoughts, comments, user experiences publicly or privately. Our private contact information can be found at the footer of GFW Report.