Git Product home page Git Product logo

tunnel's Introduction

tunnel

Network tunneling tools

Scenario

Suppose Client wants to access Server, but the network can't be trust. It needs to encrypt the traffic, make sure only Server can see the data. Server also wants to verify the data seems from Client trully is.

                      + Untrusted network
                      |
                      |
                      |
+---------+           |             +--------+
| Client  +------------------------>+ Server |
+---------+           |             +--------+
                      +

Here comes tunnel. tunnel.local for encrypting the traffic, and tunel.remote decrypting the traffic.

                                      + Untrusted network
                                      |
                                      |
                                      |
+---------+    +------------+         |           +------------+   +--------+
| Client  +--->+tunnel.local+-------------------->+tunel.remote+-->+ Server |
+---------+    +------------+         |           +------------+   +--------+
                                      +

Client and tunnel.local can be same device, and tunel.remote can also be running on Server.

Install

Requires Python3.7.3+

python3.7 -m pip install --user tunnel-0.1.0-py3-none-any.whl

Usage

Because tunnel use a bi-verified SSL cert, generate a pair of cert and key using (change "ssl.what5g.com" to other domain):

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 3650 -nodes -subj "/CN=ssl.what5g.com"

Copy key.pem and cert.pem to both servers of tunnel.local and tunnel.remote.

Suppose Client wants to access port 1080 of Server. Start tunnel.local as:

python3.7 -m tunnel.local -l 0.0.0.0:1080 -f tunnel.remote:10800 -k key.pem -c cert.pem -d ssl.what5g.com

Start tunnel.remote as:

python3.7 -m tunnel.remote -l 0.0.0.0:10800 -f server:1080 -k key.pem -c cert.pem

Finally, let Client access port 1080 of tunnel.local, resulting accessing port 1080 of Server, with traffic encrypted.

Use Case

  • tunneling socks5/http proxy traffic
  • tunneling Shadowsocks traffic

tunnel's People

Contributors

ichuan avatar

Stargazers

zz of NSFOCUS Security Team avatar Julian avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.