https://github.com/cbeuw/cloak
A censorship circumvention tool to evade detection by authoritarian state adversaries
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.1%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
A censorship circumvention tool to evade detection by authoritarian state adversaries
Basic Info
Statistics
- Stars: 3,590
- Watchers: 66
- Forks: 323
- Open Issues: 134
- Releases: 32
Topics
Metadata Files
README.md
Cloak is a pluggable transport that enhances traditional proxy tools like OpenVPN to evade sophisticated censorship and data discrimination.
Cloak is not a standalone proxy program. Rather, it works by masquerading proxied traffic as normal web browsing activities. In contrast to traditional tools which have very prominent traffic fingerprints and can be blocked by simple filtering rules, it's very difficult to precisely target Cloak with little false positives. This increases the collateral damage to censorship actions as attempts to block Cloak could also damage services the censor state relies on.
To any third party observer, a host running Cloak server is indistinguishable from an innocent web server. Both while passively observing traffic flow to and from the server, as well as while actively probing the behaviours of a Cloak server. This is achieved through the use a series of cryptographic steganography techniques.
Cloak can be used in conjunction with any proxy program that tunnels traffic through TCP or UDP, such as Shadowsocks, OpenVPN and Tor. Multiple proxy servers can be running on the same server host and Cloak server will act as a reverse proxy, bridging clients with their desired proxy end.
Cloak multiplexes traffic through multiple underlying TCP connections which reduces head-of-line blocking and eliminates TCP handshake overhead. This also makes the traffic pattern more similar to real websites.
Cloak provides multi-user support, allowing multiple clients to connect to the proxy server on the same port (443 by default). It also provides traffic management features such as usage credit and bandwidth control. This allows a proxy server to serve multiple users even if the underlying proxy software wasn't designed for multiple users
Cloak also supports tunneling through an intermediary CDN server such as Amazon Cloudfront. Such services are so widely used, attempts to disrupt traffic to them can lead to very high collateral damage for the censor.
Quick Start
To quickly deploy Cloak with Shadowsocks on a server, you can run this script written by @HirbodBehnam
Table of Contents
Build
bash
git clone https://github.com/cbeuw/Cloak
cd Cloak
go get ./...
make
Built binaries will be in build folder.
Configuration
Examples of configuration files can be found under example_config folder.
Server
RedirAddr is the redirection address when the incoming traffic is not from a Cloak client. Ideally it should be set to
a major website allowed by the censor (e.g. www.bing.com)
BindAddr is a list of addresses Cloak will bind and listen to (e.g. [":443",":80"] to listen to port 443 and 80 on
all interfaces)
ProxyBook is an object whose key is the name of the ProxyMethod used on the client-side (case-sensitive). Its value is
an array whose first element is the protocol, and the second element is an IP:PORT string of the upstream proxy server
that Cloak will forward the traffic to.
Example:
json
{
"ProxyBook": {
"shadowsocks": [
"tcp",
"localhost:51443"
],
"openvpn": [
"tcp",
"localhost:12345"
]
}
}
PrivateKey is the static curve25519 Diffie-Hellman private key encoded in base64.
BypassUID is a list of UIDs that are authorised without any bandwidth or credit limit restrictions
AdminUID is the UID of the admin user in base64. You can leave this empty if you only ever add users to BypassUID.
DatabasePath is the path to userinfo.db, which is used to store user usage information and restrictions. Cloak will
create the file automatically if it doesn't exist. You can leave this empty if you only ever add users to BypassUID.
This field also has no effect if AdminUID isn't a valid UID or is empty.
KeepAlive is the number of seconds to tell the OS to wait after no activity before sending TCP KeepAlive probes to the
upstream proxy server. Zero or negative value disables it. Default is 0 (disabled).
Client
UID is your UID in base64.
Transport can be either direct or CDN. If the server host wishes you to connect to it directly, use direct. If
instead a CDN is used, use CDN.
PublicKey is the static curve25519 public key in base64, given by the server admin.
ProxyMethod is the name of the proxy method you are using. This must match one of the entries in the
server's ProxyBook exactly.
EncryptionMethod is the name of the encryption algorithm you want Cloak to use. Options are plain, aes-256-gcm (
synonymous to aes-gcm), aes-128-gcm, and chacha20-poly1305. Note: Cloak isn't intended to provide transport
security. The point of encryption is to hide fingerprints of proxy protocols and render the payload statistically
random-like. You may only leave it as plain if you are certain that your underlying proxy tool already provides BOTH
encryption and authentication (via AEAD or similar techniques).
ServerName is the domain you want to make your ISP or firewall think you are visiting. Ideally it should
match RedirAddr in the server's configuration, a major site the censor allows, but it doesn't have to. Use random to randomize the server name for every connection made.
AlternativeNames is an array used alongside ServerName to shuffle between different ServerNames for every new
connection. This may conflict with CDN Transport mode if the CDN provider prohibits domain fronting and rejects
the alternative domains.
Example:
json
{
"ServerName": "bing.com",
"AlternativeNames": ["cloudflare.com", "github.com"]
}
CDNOriginHost is the domain name of the origin server (i.e. the server running Cloak) under CDN mode. This only
has effect when Transport is set to CDN. If unset, it will default to the remote hostname supplied via the
commandline argument (in standalone mode), or by Shadowsocks (in plugin mode). After a TLS session is established with
the CDN server, this domain name will be used in the Host header of the HTTP request to ask the CDN server to
establish a WebSocket connection with this host.
CDNWsUrlPath is the url path used to build websocket request sent under CDN mode, and also only has effect
when Transport is set to CDN. If unset, it will default to "/". This option is used to build the first line of the
HTTP request after a TLS session is extablished. It's mainly for a Cloak server behind a reverse proxy, while only
requests under specific url path are forwarded.
NumConn is the amount of underlying TCP connections you want to use. The default of 4 should be appropriate for most
people. Setting it too high will hinder the performance. Setting it to 0 will disable connection multiplexing and each
TCP connection will spawn a separate short-lived session that will be closed after it is terminated. This makes it
behave like GoQuiet. This maybe useful for people with unstable connections.
BrowserSig is the browser you want to appear to be using. It's not relevant to the browser you are actually using.
Currently, chrome, firefox and safari are supported.
KeepAlive is the number of seconds to tell the OS to wait after no activity before sending TCP KeepAlive probes to the
Cloak server. Zero or negative value disables it. Default is 0 (disabled). Warning: Enabling it might make your server
more detectable as a proxy, but it will make the Cloak client detect internet interruption more quickly.
StreamTimeout is the number of seconds of Cloak waits for an incoming connection from a proxy program to send any
data, after which the connection will be closed by Cloak. Cloak will not enforce any timeout on TCP connections after it
is established.
Setup
Server
- Install at least one underlying proxy server (e.g. OpenVPN, Shadowsocks).
- Download the latest release or clone and build this repo.
- Run
ck-server -key. The public should be given to users, the private key should be kept secret. - (Skip if you only want to add unrestricted users) Run
ck-server -uid. The new UID will be used asAdminUID. - Copy example_config/ckserver.json into a desired location. Change
PrivateKeyto the private key you just obtained; changeAdminUIDto the UID you just obtained. - Configure your underlying proxy server so that they all listen on localhost. Edit
ProxyBookin the configuration file accordingly - Configure the proxy program.
Run
sudo ck-server -c <path to ckserver.json>. ck-server needs root privilege because it binds to a low numbered port (443). Alternatively you can follow https://superuser.com/a/892391 to avoid granting ck-server root privilege unnecessarily.
To add users
Unrestricted users
Run ck-server -uid and add the UID into the BypassUID field in ckserver.json
Users subject to bandwidth and credit controls
- First make sure you have
AdminUIDgenerated and set inckserver.json, along with a path touserinfo.dbinDatabasePath(Cloak will create this file for you if it didn't already exist). - On your client, run
ck-client -s <IP of the server> -l <A local port> -a <AdminUID> -c <path-to-ckclient.json>to enter admin mode - Visit https://cbeuw.github.io/Cloak-panel (Note: this is a pure-js static site, there is no backend and all data
entered into this site are processed between your browser and the Cloak API endpoint you specified. Alternatively you
can download the repo at https://github.com/cbeuw/Cloak-panel and open
index.htmlin a browser. No web server is required). - Type in
127.0.0.1:<the port you entered in step 1>as the API Base, and clickList. - You can add in more users by clicking the
+panel
Note: the user database is persistent as it's in-disk. You don't need to add the users again each time you start ck-server.
Client
Android client is available here: https://github.com/cbeuw/Cloak-android
- Install the underlying proxy client corresponding to what the server has.
- Download the latest release or clone and build this repo.
- Obtain the public key and your UID from the administrator of your server
- Copy
example_config/ckclient.jsoninto a location of your choice. Enter theUIDandPublicKeyyou have obtained. SetProxyMethodto match exactly the corresponding entry inProxyBookon the server end - Configure the proxy program.
Run
ck-client -c <path to ckclient.json> -s <ip of your server>
Support me
If you find this project useful, you can visit my merch store; alternatively you can donate directly to me
BTC: bc1q59yvpnh0356qq9vf0j2y7hx36t9ysap30spx9h
ETH: 0x8effF29a8F9bD38A367580527AC303972c92b60c
Owner
- Name: Andy Wang
- Login: cbeuw
- Kind: user
- Location: United Kingdom
- Repositories: 50
- Profile: https://github.com/cbeuw
Qian
GitHub Events
Total
- Create event: 7
- Release event: 1
- Issues event: 15
- Watch event: 294
- Delete event: 3
- Issue comment event: 27
- Push event: 10
- Pull request review comment event: 8
- Pull request review event: 8
- Pull request event: 14
- Fork event: 23
Last Year
- Create event: 7
- Release event: 1
- Issues event: 15
- Watch event: 294
- Delete event: 3
- Issue comment event: 27
- Push event: 10
- Pull request review comment event: 8
- Pull request review event: 8
- Pull request event: 14
- Fork event: 23
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Andy Wang | c****y@g****m | 623 |
| notsure2 | n****2@p****m | 19 |
| Hirbod Behnam | c****y@g****m | 4 |
| renovate[bot] | 2****] | 3 |
| name | l****l@g****m | 3 |
| zaferatli | z****r@p****m | 1 |
| moonburnt | m****t@d****g | 1 |
| dependabot[bot] | 4****] | 1 |
| beans | 4****l | 1 |
| Selim | 4****0 | 1 |
| Prajwal Koirala | 1****f | 1 |
| Nikita | 6****V | 1 |
| Kirill Buev | k****v@p****e | 1 |
| Ian Brown | i****n@z****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 149
- Total pull requests: 45
- Average time to close issues: 4 months
- Average time to close pull requests: about 1 month
- Total issue authors: 100
- Total pull request authors: 14
- Average comments per issue: 2.97
- Average comments per pull request: 1.93
- Merged pull requests: 26
- Bot issues: 1
- Bot pull requests: 19
Past Year
- Issues: 22
- Pull requests: 18
- Average time to close issues: about 1 month
- Average time to close pull requests: 28 days
- Issue authors: 20
- Pull request authors: 5
- Average comments per issue: 0.86
- Average comments per pull request: 1.17
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 10
Top Authors
Issue Authors
- notsure2 (9)
- LindaFerum (9)
- windstander (7)
- lootnath (4)
- Evolve6996 (4)
- qwerttvv (4)
- klaaktu (3)
- malikshi (3)
- taylorwin (3)
- bingzhangdai (2)
- cyqsimon (2)
- gokaybiz (2)
- obvioususername (2)
- StunTMaN7 (2)
- aboka2k (2)
Pull Request Authors
- dependabot[bot] (15)
- notsure2 (11)
- renovate[bot] (10)
- cbeuw (7)
- BANanaD3V (2)
- zaferatli (2)
- zestysoft (2)
- moonburnt (1)
- lima0 (1)
- bitnom (1)
- selivan (1)
- HirbodBehnam (1)
- outspace (1)
- githablocal (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
- Total downloads: unknown
- Total docker downloads: 129
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 12
proxy.golang.org: github.com/cbeuw/Cloak
- Homepage: https://github.com/cbeuw/Cloak
- Documentation: https://pkg.go.dev/github.com/cbeuw/Cloak#section-documentation
- License: GPL-3.0
-
Latest release: v1.1.2
published over 6 years ago
Rankings
proxy.golang.org: github.com/cbeuw/cloak
- Homepage: https://github.com/cbeuw/cloak
- Documentation: https://pkg.go.dev/github.com/cbeuw/cloak#section-documentation
- License: gpl-3.0
-
Latest release: v1.1.2
published over 6 years ago