2018-12-20 10:09:16 +03:00
|
|
|
|
# Pingtunnel
|
2020-01-01 11:25:02 +03:00
|
|
|
|
|
2020-01-01 11:54:54 +03:00
|
|
|
|
[<img src="https://img.shields.io/github/license/esrrhs/pingtunnel">](https://github.com/esrrhs/pingtunnel)
|
2020-01-03 04:03:49 +03:00
|
|
|
|
[<img src="https://img.shields.io/github/languages/top/esrrhs/pingtunnel">](https://github.com/esrrhs/pingtunnel)
|
2020-01-06 05:42:34 +03:00
|
|
|
|
[![Go Report Card](https://goreportcard.com/badge/github.com/esrrhs/pingtunnel)](https://goreportcard.com/report/github.com/esrrhs/pingtunnel)
|
2020-01-01 11:33:40 +03:00
|
|
|
|
[<img src="https://img.shields.io/github/v/release/esrrhs/pingtunnel">](https://github.com/esrrhs/pingtunnel/releases)
|
|
|
|
|
[<img src="https://img.shields.io/github/downloads/esrrhs/pingtunnel/total">](https://github.com/esrrhs/pingtunnel/releases)
|
|
|
|
|
[<img src="https://img.shields.io/docker/pulls/esrrhs/pingtunnel">](https://hub.docker.com/repository/docker/esrrhs/pingtunnel)
|
2020-01-01 11:54:54 +03:00
|
|
|
|
[<img src="https://img.shields.io/github/workflow/status/esrrhs/pingtunnel/Go">](https://github.com/esrrhs/pingtunnel/actions)
|
2020-01-01 11:25:02 +03:00
|
|
|
|
|
2020-12-23 05:11:06 +03:00
|
|
|
|
pingtunnel 是把 tcp/udp/sock5 流量伪装成 icmp 流量进行转发的工具
|
2019-11-05 16:09:36 +03:00
|
|
|
|
|
2020-01-04 15:01:26 +03:00
|
|
|
|
[Readme EN](./README_EN.md)
|
|
|
|
|
|
2020-12-23 05:38:49 +03:00
|
|
|
|
## 注意:本工具只是用作学习研究,请勿用于非法用途!!!
|
2020-10-31 18:09:55 +03:00
|
|
|
|
|
2019-11-01 17:38:09 +03:00
|
|
|
|
![image](network.jpg)
|
2019-10-27 15:09:51 +03:00
|
|
|
|
|
2020-12-23 05:11:06 +03:00
|
|
|
|
## 使用
|
|
|
|
|
|
2020-01-07 17:10:28 +03:00
|
|
|
|
### 安装服务端
|
2020-12-23 05:11:06 +03:00
|
|
|
|
|
2020-12-23 05:44:27 +03:00
|
|
|
|
- 首先准备好一个具有公网 ip 的服务器,假定域名或者公网 ip 是www.yourserver.com
|
|
|
|
|
- 从[releases](https://github.com/esrrhs/pingtunnel/releases)下载对应的安装包,如 pingtunnel_linux64.zip,然后解压,以**root**权限执行
|
2020-12-23 05:11:06 +03:00
|
|
|
|
|
2018-12-20 10:09:16 +03:00
|
|
|
|
```
|
2020-01-08 05:42:49 +03:00
|
|
|
|
sudo wget (最新release的下载链接)
|
2020-01-07 17:10:28 +03:00
|
|
|
|
sudo unzip pingtunnel_linux64.zip
|
2018-12-20 10:09:16 +03:00
|
|
|
|
sudo ./pingtunnel -type server
|
|
|
|
|
```
|
2020-12-23 05:11:06 +03:00
|
|
|
|
|
2020-12-23 05:44:27 +03:00
|
|
|
|
- (可选)关闭系统默认的 ping
|
2020-12-23 05:11:06 +03:00
|
|
|
|
|
2020-01-08 05:38:33 +03:00
|
|
|
|
```
|
|
|
|
|
echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all
|
|
|
|
|
```
|
2020-12-23 05:11:06 +03:00
|
|
|
|
|
|
|
|
|
### 安装 GUI 客户端(新手推荐)
|
|
|
|
|
|
2020-12-23 05:44:27 +03:00
|
|
|
|
- 从[pingtunnel-qt](https://github.com/esrrhs/pingtunnel-qt)下载 qt 的 gui 版本
|
|
|
|
|
- 双击 exe 运行,修改 server(如www.yourserver.com)、listen port(如 1080),勾上 sock5,其他设置默认即可,然后点击*GO*
|
|
|
|
|
- 一切正常,界面上会有 ping 值显示,然后可点击 X 隐藏到状态栏
|
|
|
|
|
- 设置浏览器的 sock5 代理到 127.0.0.1:1080,如果连不上网,出现 socks version not supported 错误日志,说明浏览器的代理不是 socks5 代理。如果提示非安全连接,说明 dns 有问题,勾上浏览器的【使用 socks5 代理 DNS 查询】
|
2020-10-31 18:09:55 +03:00
|
|
|
|
|
2020-01-07 17:10:28 +03:00
|
|
|
|
![image](qtrun.jpg)
|
|
|
|
|
|
2020-01-08 05:35:57 +03:00
|
|
|
|
### 安装客户端(高玩推荐)
|
2020-12-23 05:11:06 +03:00
|
|
|
|
|
2020-12-23 05:44:27 +03:00
|
|
|
|
- 从[releases](https://github.com/esrrhs/pingtunnel/releases)下载对应的安装包,如 pingtunnel_windows64.zip,解压
|
|
|
|
|
- 然后用**管理员权限**运行,不同的转发功能所对应的命令如下
|
|
|
|
|
- 如果看到有 ping pong 的 log,说明连接正常
|
2020-12-23 05:11:06 +03:00
|
|
|
|
|
|
|
|
|
#### 转发 sock5
|
|
|
|
|
|
2018-12-20 10:09:16 +03:00
|
|
|
|
```
|
2020-01-07 17:10:28 +03:00
|
|
|
|
pingtunnel.exe -type client -l :4455 -s www.yourserver.com -sock5 1
|
2018-12-20 10:09:16 +03:00
|
|
|
|
```
|
2020-12-23 05:11:06 +03:00
|
|
|
|
|
|
|
|
|
#### 转发 tcp
|
|
|
|
|
|
2018-12-23 08:09:33 +03:00
|
|
|
|
```
|
2020-01-07 17:10:28 +03:00
|
|
|
|
pingtunnel.exe -type client -l :4455 -s www.yourserver.com -t www.yourserver.com:4455 -tcp 1
|
2018-12-23 08:09:33 +03:00
|
|
|
|
```
|
2020-12-23 05:11:06 +03:00
|
|
|
|
|
|
|
|
|
#### 转发 udp
|
|
|
|
|
|
2018-12-23 08:09:33 +03:00
|
|
|
|
```
|
2020-01-07 17:10:28 +03:00
|
|
|
|
pingtunnel.exe -type client -l :4455 -s www.yourserver.com -t www.yourserver.com:4455
|
2018-12-23 08:09:33 +03:00
|
|
|
|
```
|
2020-01-07 17:10:28 +03:00
|
|
|
|
|
2021-04-01 06:49:07 +03:00
|
|
|
|
### Docker(高玩推荐)
|
|
|
|
|
也可直接用docker启动,更方便。参数同上
|
|
|
|
|
- server:
|
2019-10-28 11:54:09 +03:00
|
|
|
|
```
|
2020-01-07 17:10:28 +03:00
|
|
|
|
docker run --name pingtunnel-server -d --privileged --network host --restart=always esrrhs/pingtunnel ./pingtunnel -type server -key 123456
|
|
|
|
|
```
|
2021-04-01 06:49:07 +03:00
|
|
|
|
- client:
|
2020-01-07 17:10:28 +03:00
|
|
|
|
```
|
|
|
|
|
docker run --name pingtunnel-client -d --restart=always -p 1080:1080 esrrhs/pingtunnel ./pingtunnel -type client -l :1080 -s www.yourserver.com -sock5 1 -key 123456
|
2019-10-28 11:54:09 +03:00
|
|
|
|
```
|
2019-10-27 15:27:52 +03:00
|
|
|
|
|
2020-12-23 05:11:06 +03:00
|
|
|
|
## 效果
|
|
|
|
|
|
2021-06-18 19:50:53 +03:00
|
|
|
|
下载 centos 镜像 [centos mirror](http://centos.s.uw.edu/centos/8.4.2105/isos/x86_64/CentOS-8.4.2105-x86_64-dvd1.iso),对比如下
|
2020-12-23 05:11:06 +03:00
|
|
|
|
|
|
|
|
|
| | wget | ss | kcp | pingtunnel |
|
|
|
|
|
| ------ | -------- | -------- | ------- | ---------- |
|
|
|
|
|
| 阿里云 | 26.6KB/s | 31.8KB/s | 606KB/s | 5.64MB/s |
|