Giter VIP home page Giter VIP logo

5l1v3r1 / xtunnel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from deaglepc/xtunnel

0.0 1.0 0.0 1.8 MB

A tool for penetrating the NAT, allowing LAN ports to expose to the public network to penetrate the LAN, similar to FRP, ngork and other software, but more lightweight, only for TCP connections, support multi-user multi-client.

License: Apache License 2.0

C++ 84.81% C 14.21% CMake 0.98%

xtunnel's Introduction

中文 | English

Principle

Introduction

A tool for penetrating the Intranet, allowing LAN ports to expose to the public network to penetrate the LAN, similar to FRP, ngork and other software, but more lightweight, only for TCP connections, support multi-user and multi-client.

The network IO model adopts the event driven model of reactor pattern, and the implementation method refers to redis source code

Supporting Linux only for now. WSL is recommended under Windows

Features

  1. The size of executable file is very small.(100+kb)
  2. Easy to run, without any dependence , can run directly to the background of the daemon process.
  3. The configuration file is simple.
  4. Encryped transmission, the forwarded data will be encrypted and then transmitted, encryption algorithm defaults to aes-256-cbc.
  5. High performance IO, based on IO multiplexing, network event processing refers to redis Reactor event driven model.

Installation

  • Compile
git clone https://github.com/DeaglePC/XTunnel.git && cd XTunnel/xtun/ && cmake -DCMAKE_BUILD_TYPE=Release . && make

Configuration

Server

Example: ts.ini

[common]
server_port = 10087         # for client connection
password = 666              # keep it private
log_path = /home/xxx/log    # log file path, make sure you have permission to write and read

Client

Example: tc.ini

[common]
server_ip = 12.13.14.15     # server public ip address
server_port = 10087         # the server_port in ts.ini
password = 666              # server password in ts.ini
log_path = /home/xxx/log    # log file path, make sure you have permission to write and read

[ssh]
local_ip = 127.0.0.1
local_port = 22             # local application's port, here is ssh
remote_port = 12300         # You want to expose the port on the public network

[vnc]
local_ip = 192.168.1.11
local_port = 5900
remote_port = 12301

[rdp]
local_ip = 192.168.1.12
local_port = 3389
remote_port = 12302

The port mapping is as follows:

LAN network Public network
127.0.0.1:22 12.13.14.15:12300
192.168.1.11:5900 12.13.14.15:12301
192.168.1.12:3389 12.13.14.15:12302

According to the above configuration file, by connecting to the IP: port of the public network, you can connect to the application in the LAN. For example, the above configuration files can be connected to SSH, VNC, and Windows RDP remote desktop respectively.

Startup(Server & Client)

  1. Run server(Runs on a host with a public network IP)
./xtuns -c ts.ini -d

-d Parameter representation runs as a daemon

  1. Run client(Runs on a host in LAN)
./xtunc-c tc.ini -d
  1. Connect to LAN applications by connecting to public network IP
ssh [email protected] -p 12300

TODO:

  • 1. The configuration file
  • 2. Password encryption
  • 3. Heartbeats
  • 4. Encrypted transmission
  • 5. Reconnect after disconnection
  • 6. Keep log files for n days only
  • 7. Add restart and stop parameters
  • 8. Optimize the code

Thanks:

Winnerhust for inifile2
JieweiWei for MD5
ttfutt for logger

xtunnel's People

Contributors

deaglepc avatar

Watchers

 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.