• Stars
    star
    4,119
  • Rank 10,523 (Top 0.3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 5 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

GreenTunnel is an anti-censorship utility designed to bypass the DPI system that is put in place by various ISPs to block access to certain websites.

Green Tunnel

green tunnel logo

GreenTunnel bypasses DPI (Deep Packet Inspection) systems found in many ISPs (Internet Service Providers) which block access to certain websites.

green tunnel demo

How to use

Graphical user interface (GUI)

You can simply choose the suitable installation for your OS in the releases section.

Command-line interface (CLI)

You can install GreenTunnel using npm:

$ npm i -g green-tunnel

or using snap (edge version):

sudo snap install --edge green-tunnel --devmode

after installation you can run it using gt or green-tunnel commands.

$ gt --help
Usage: green-tunnel [options]
Usage: gt [options]

Options:
  --help, -h      Show help                                            [boolean]
  --version, -V   Show version number                                  [boolean]
  --ip            ip address to bind proxy server[string] [default: "127.0.0.1"]
  --https-only    Block insecure HTTP requests        [boolean] [default: false]
  --port          port address to bind proxy server     [number] [default: 8000]
  --dns-type               [string] [choices: "https", "tls"] [default: "https"]
  --dns-server        [string] [default: "https://cloudflare-dns.com/dns-query"]
  --dns-ip        IP address for unencrypted DNS  [string][default: "127.0.0.1"]
  --dns-port      Port for unencrypted DNS                [number] [default: 53]
  --silent, -s    run in silent mode                  [boolean] [default: false]
  --verbose, -v   debug mode                              [string] [default: ""]
  --system-proxy  automatic set system-proxy           [boolean] [default: true]

Examples:
  gt
  gt --ip 127.0.0.1 --port 8000 --https-only
  gt --dns-server https://doh.securedns.eu/dns-query
  gt --verbose 'green-tunnel:proxy*'

ISSUES:  https://github.com/SadeghHayeri/GreenTunnel/issues

for debug use verbose option:

$ green-tunnel --verbose 'green-tunnel:*'

Docker

$ docker run -p 8000:8000 sadeghhayeri/green-tunnel

envs

  • PORT
  • HTTPS-ONLY
  • VERBOSE
  • SILENT
  • DNS_TYPE
  • DNS_SERVER

usage:

$ docker run -e 'PORT=1000' -p 8000:1000 sadeghhayeri/green-tunnel

On Raspberry Pi

$ docker run -p 8000:8000 sadeghhayeri/green-tunnel:arm

If you want to make container keep running when reboot:

$ docker run -d --restart unless-stopped -p 8000:8000 sadeghhayeri/green-tunnel:arm

Please make sure port 8000 is not blocked on Raspberry Pi firewall. (sudo ufw allow 8000 comment Green-Tunnel)

To use it on your other device, set http proxy to <Raspberry Pi IP Address>:<PORT>. (PORT = 8000)

Tested on

  • MacOS Catalina with node 12
  • Ubuntu 18.04 with node 8
  • Windows 10 with node 8

FAQ

How does it work?

HTTP

There are gaps in providers in DPI. They happen from what the DPI rules write for ordinary user programs, omitting all possible cases that are permissible by standards. This is done for simplicity and speed. Some DPIs cannot recognize the HTTP request if it is divided into TCP segments. For example, a request of the form

GET / HTTP/1.0`
Host: www.youtube.com
...

we send it in 2 parts: first comes GET / HTTP/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!

HTTPS

Server Name Indication (SNI) is an extension to TLS (Transport Layer Security) that indicates the actual destination hostname a client is attempting to access over HTTPS. For this Web Filter feature, SNI hostname information is used for blocking access to specific sites over HTTPS. For example, if the administrator chooses to block the hostname youtube using this feature, all Website access attempts over HTTPS that contain youtube like www.youtube.com in the SNI would be blocked. However, access to the same hostname over HTTP would not be blocked by this feature. GreenTunnel tries to split first CLIENT-HELLO packet into small chunks and ISPs can't parse packet and found SNI field so bypass traffic!

DNS

When you enter a URL in a Web browser, the first thing the Web browser does is to ask a DNS (Domain Name System) server, at a known numeric address, to look up the domain name referenced in the URL and supply the corresponding IP address. If the DNS server is configured to block access, it consults a blacklist of banned domain names. When a browser requests the IP address for one of these domain names, the DNS server gives a wrong answer or no answer at all. GreenTunnel use DNS over HTTPS and DNS over TLS to get real IP address and bypass DNS Spoofing.

Development notes

GreenTunnel is an open-source app and I really appreciate other developers adding new features and/or helping fix bugs. If you want to contribute to GreenTunnel, you can fork this repository, make the changes and create a pull request.

However, please make sure you follow a few rules listed below to ensure that your changes get merged into the main repo. The rules listed below are enforced to make sure the changes made are well-documented and can be easily kept track of.

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Make sure your pull request has an informative title. You should use prefixes like ADD:, FIX:, etc at the start of the title which describes the changes followed by a one-line description of the changes. Example: ADD: Added a new feature to GreenTunnel
  • Commits in your fork should be informative, as well. Make sure you don't combine too many changes into a single commit.

TODO List

  • enable/disable proxy on windows
  • HTTPHandler
  • add CLI arguments
  • catch all exceptions
  • add preferences menu
  • fix close button

Donation

Love GreenTunnel? Please consider donating to sustain our activities.

DOGECOIN!: DTGjx8KKDCUkSEbtVHgQx1GYEnNaVVuXLa
BITCOIN: bc1qknjsmsa98lljwxjwl4pmjh48s8su8r8ajkqd8w
ETHEREUM: 0x018fbf3fAC7165b2c85f856cC90E2d9410415150
LITECOIN: ltc1q5tfprazpkzjvzf5shgprkpkhnnku3p72feutxt
RIPPLE/XRP: rt6ZTkKdBVYzBee9CpQsDTsewnTbAoV13



Donate with Bitcoin Donate with Ethereum Donate with Ripple

License

Licensed under the MIT license. See LICENSE.

More Repositories

1

Mili

Mili is an open source tool for auto login hotspot pages! (MacOS + Linux)
Shell
204
star
2

LoL-Hacking

My Hacking Activities!
Python
35
star
3

pgkit

Pgkit - Backup, PITR and recovery management made easy
Python
31
star
4

Self-Balancing-Robot

A two-wheel self-balancing robot based on Arduino and RaspberryPi board.
Python
18
star
5

CheatSheets

🍻 My Awesome Cheatsheet!
Swift
17
star
6

Twitter-Friend-Connections

Visualizing Twitter Friend Connections
Jupyter Notebook
14
star
7

Google-Foobar

Google foobar challenge!
Python
11
star
8

Together

Download manager using multi devices
JavaScript
7
star
9

live-stream-microservice

Shell
4
star
10

Smoola-Compiler

A Compiler for Smoola
Java
3
star
11

coronavirus

JavaScript
3
star
12

M-Fucker

JavaScript
2
star
13

TwitterAngular

My first twitter app using Angular2
TypeScript
2
star
14

homeassistant

2
star
15

xSim

Manage MTN / MCI Account from terminal!
Python
2
star
16

Nine-Men-s-Morris

CA4 for Artificial intelligence student! (TA) + with python and C++ interface
JavaScript
2
star
17

note-telegram-bot

Sample notebook bot for telegram.
Python
2
star
18

TwitterDjango

My first twitter app using Django + REST + JWT
Python
2
star
19

pintos

New schedule mechanism implimention for pintos! yeah!
C
1
star
20

Connect4

CA4 for Artificial intelligence student! (TA)
Python
1
star
21

Computer-Networks-CA3

Tahoe TCP implementation over UDP using java
Java
1
star
22

shortener

Simple URL shortener with analytics (in memory LRU + redis + mongodb)
JavaScript
1
star
23

CPS-Communication

C++
1
star
24

kbd-nodejs-version

'Khane-Be-Doosh' server side using nodejs
JavaScript
1
star
25

json-placeholder

1
star
26

black-projects

this projects never complete!
C++
1
star
27

linux

New Semaphore implementation for linux!
C
1
star
28

Ambilight

Python
1
star
29

monGen

Mongodb dataset generator
JavaScript
1
star
30

DeepSkyBlueACM

DeepSkyBlue Website
HTML
1
star
31

OpenCV

My first try to learn OpenCV!
Jupyter Notebook
1
star
32

autism-server

JavaScript
1
star
33

smart-home

1
star
34

Ticketi

!با تیکتی دهن استادا رو سرویس کنیم (powered Django)
Python
1
star
35

dns-resolver-go

Go
1
star
36

autism-client

JavaScript
1
star
37

Machine-Learning

My tries to learning ML concept!
Jupyter Notebook
1
star
38

Twitter-Analyzer

Find crushes in Twitter using fav-time and online-time!
Jupyter Notebook
1
star
39

Cracking-the-Coding-Interview

My solution for 'Cracking the Coding Interview' problems.
Python
1
star