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
- The size of executable file is very small.（100+kb）
- Easy to run, without any dependence , can run directly to the background of the daemon process.
- The configuration file is simple.
- Encryped transmission, the forwarded data will be encrypted and then transmitted, encryption algorithm defaults to aes-256-cbc.
- High performance IO, based on IO multiplexing, network event processing refers to redis Reactor event driven model.
git clone https://github.com/DeaglePC/XTunnel.git && cd XTunnel/xtun/ && cmake -DCMAKE_BUILD_TYPE=Release . && make
[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
[common] server_ip = 184.108.40.206 # 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|
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)
- Run server（Runs on a host with a public network IP）
./xtuns -c ts.ini -d
-d Parameter representation runs as a daemon
- Run client（Runs on a host in LAN）
./xtunc-c tc.ini -d
- Connect to LAN applications by connecting to public network IP
ssh email@example.com -p 12300
- 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