All Projects → izuolan → Pshell

izuolan / Pshell

Licence: MIT license
ICMP/IP tunnel manager for Linux.

Programming Languages

c
50402 projects - #5 most used programming language
shell
77523 projects
Roff
2310 projects
Makefile
30231 projects

Projects that are alternatives of or similar to Pshell

Nps
一款轻量级、高性能、功能强大的内网穿透代理服务器。支持tcp、udp、socks5、http等几乎所有流量转发,可用来访问内网网站、本地支付接口调试、ssh访问、远程桌面,内网dns解析、内网socks5代理等等……,并带有功能强大的web管理端。a lightweight, high-performance, powerful intranet penetration proxy server, with a powerful web management terminal.
Stars: ✭ 19,537 (+81304.17%)
Mutual labels:  tunnel, socks
tlstun
A socks tunnel client and server using websockets over http and tls
Stars: ✭ 36 (+50%)
Mutual labels:  tunnel, socks
udp2raw
A Tunnel which Turns UDP Traffic into Encrypted UDP/FakeTCP/ICMP Traffic by using Raw Socket,helps you Bypass UDP FireWalls(or Unstable UDP Environment)
Stars: ✭ 5,256 (+21800%)
Mutual labels:  tunnel, icmp
Icmptunnel
Transparently tunnel your IP traffic through ICMP echo and reply packets.
Stars: ✭ 2,753 (+11370.83%)
Mutual labels:  tunnel, icmp
Pingtunnel
ping tunnel is a tool that advertises tcp/udp/socks5 traffic as icmp traffic for forwarding.
Stars: ✭ 1,904 (+7833.33%)
Mutual labels:  tunnel, icmp
Udp2raw Tunnel
A Tunnel which Turns UDP Traffic into Encrypted UDP/FakeTCP/ICMP Traffic by using Raw Socket,helps you Bypass UDP FireWalls(or Unstable UDP Environment)
Stars: ✭ 4,839 (+20062.5%)
Mutual labels:  tunnel, icmp
shadowsocks-perl
An asynchronous, non-blocking shadowsocks client and server written in Perl.
Stars: ✭ 37 (+54.17%)
Mutual labels:  tunnel, socks
Ssh2 Promise
ssh with promise/async await and typescript support
Stars: ✭ 110 (+358.33%)
Mutual labels:  tunnel, socks
Gateway Go
🎁GateWay Client for OpenIoTHub[云易连访问内网端口和设备的网关]
Stars: ✭ 127 (+429.17%)
Mutual labels:  tunnel, socks
sx
🖖 Fast, modern, easy-to-use network scanner
Stars: ✭ 1,267 (+5179.17%)
Mutual labels:  icmp, socks
microsocks11
A cross-platform SOCKS5 library and server based on the microsocks project.
Stars: ✭ 22 (-8.33%)
Mutual labels:  socks
ondevice
ondevice.io client
Stars: ✭ 32 (+33.33%)
Mutual labels:  tunnel
pingo
Ping library for Golang with multi-host support
Stars: ✭ 36 (+50%)
Mutual labels:  icmp
net-protocol
golang模拟内核协议栈 实现链路层、网络层、传输层、应用层 用户态协议栈 ,基于虚拟网卡TUN/TAP
Stars: ✭ 129 (+437.5%)
Mutual labels:  icmp
go-http-dialer
Go net.Dialer for HTTP(S) CONNECT Tunneling.
Stars: ✭ 55 (+129.17%)
Mutual labels:  tunnel
ICMP-server
simple web app that use icmp protocol to check some devices if there are up or not
Stars: ✭ 16 (-33.33%)
Mutual labels:  icmp
bmx7
BMX7 / SEMTOR Securely Entrusted Mesh Routing Protocol
Stars: ✭ 55 (+129.17%)
Mutual labels:  tunnel
tunman
Comprehensive solution for SSH tunnels - respawning, healthchecking/monitoring
Stars: ✭ 43 (+79.17%)
Mutual labels:  tunnel
network exporter
ICMP & MTR & TCP Port & HTTP Get - Network Prometheus exporter
Stars: ✭ 162 (+575%)
Mutual labels:  icmp
nysocks
Nysocks binds kcp and libuv to provide an aggressive tcp tunnel in nodejs.
Stars: ✭ 78 (+225%)
Mutual labels:  tunnel

这是一个 ICMP/IP 隧道管理脚本,从服务器到本地的全部操作,都可以通过这个脚本完成,目前完美支持主流 Linux 发行版(能运行最新版本 Docker 即可)。

可以用来做什么

  • 内网穿透(从外网访问内网的主机,比如在家里访问学校内网的资源)
  • 绕过认证(绕过一般的网络认证,比如绕过学校网络认证直接上网)
  • 网络代理(又双叒叕一个翻墙姿势,比如服务端放在海外就可以翻墙了)

功能

  • 支持服务器自动部署并启动,服务端遇到意外可以自动重启。
  • 支持本地自动部署并启动,支持 ICMP/IP 双协议隧道。
  • 支持断线自动重连。
  • 提供直观的监视器,可以实时查看连接状态。
  • 支持指定网卡分享 socks5 代理给他人。
  • 支持 socks5 转发为 http 代理。
  • 支持 TCP-BBR 算法,极大提高网速(需要内核支持)。
  • 密码认证。
  • 自动更新脚本。

待添加/修复功能

  • 支持自动修复 http 代理并允许指定 http 端口。
  • 自动启用负载均衡。
  • TCP-BBR 算法自动启用。
  • 添加 DNS Tunnel 功能。
  • proxy.list 文件最后一行不是空行会执行失败
$ ./Pshell.sh -h
------------------------------------------------------------------------------
   ___ ____ __  __ ____   _____ ____    ____  _          _ _ 
  |_ _/ ___|  \/  |  _ \ / /_ _|  _ \  / ___|| |__   ___| | |
   | | |   | |\/| | |_) / / | || |_) | \___ \| '_ \ / _ \ | |
   | | |___| |  | |  __/ /  | ||  __/   ___) | | | |  __/ | |
  |___\____|_|  |_|_| /_/  |___|_|     |____/|_| |_|\___|_|_|
  Email: [email protected]                 Blog: https://zuolan.me
  一个隧道部署与代理管理的脚本。不加参数直接运行脚本即可连接。
------------------------------------------------------------------------------
  可选参数         -  说明
------------------------------------------------------------------------------
  -d (driver)    -  指定网卡(enp3s0|wlp2s0|eth0|wlan0),默认全部。
  -e (edit)      -  编辑配置列表。
  -f (fast)      -  快速模式(切换为 IP 协议隧道,速度更快,安全性降低)。
  -h (help)      -  显示帮助信息。更详细说明请阅读 README 文件。
  -k (kill)      -  杀死 autossh 和 sshd 进程(当连接长时间中断时使用)。
  -l (local)     -  安装本地守护容器。
  -m (monitor)   -  查看代理与容器运行的情况。
  -n (net)       -  统计代理端口的流量(-n set/unset 开启/重置流量统计)。
  -p (port)      -  选择本地 HTTP 代理端口(默认配置/etc/privoxy/config)。
  -s (server)    -  安装服务器守护进程。
  -u (update)    -  检测版本以及更新脚本。
------------------------------------------------------------------------------

安装

第零步、ssh 免密码设置

在本地生成一对密钥(邮箱替换为你的邮箱):

ssh-keygen -t rsa -b 4096 -C "[email protected]"

把公钥(id_rsa.pub)内容复制粘贴到服务器的 ~/.ssh/authorized_keys 文件中:

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

第一步、服务器安装

执行 sudo ./Pshell.sh --server 即可自动安装并启动。服务器就一句话。

第二步、填写本地配置文件

现在回到本地,在运行脚本连接之前需要填写配置文件,模板如下。打开 proxy.list,然后按照下面的模板填写你的配置。

节点名称:容器名称:容器端口:Socks5端口:服务器IP:密码:密钥

例如:

广州:gz:8001:10001:123.45.67.89:pass1:~/.ssh/id_rsa.gz
香港:hk:8002:10002:123.45.67.89:pass1:~/.ssh/id_rsa.hk
青岛:qd:8003:10003:123.45.67.89:pass2:~/.ssh/id_rsa.qd
东京:to:8004:10004:123.45.67.89:password:~/.ssh/id_rsa.to

填完就可以进行下一步了,但如果你想更详细定义脚本变量可以在脚本头部中设置(不建议)。

第三步、本地电脑安装

执行 ./Pshell.sh --local 即可自动安装并运行。

使用

下面方法任选其一。

一、基于 SSH 的 Socks5 代理

1. ICMP 模式(限速150KB/s)

使用 ./Pshell.sh 直接运行脚本即为 ICMP 协议隧道,然后你可以使用配置文件中设置的 Socks5 端口(见安装步骤第二步)连接到外网。设置方法和普通 Socks5 端口使用一样。(例如 Google Chrome 中的插件 SwitchyOmega。)

2. IP 模式(不限速)

使用 ./Pshell.sh -f 即可启用 IP 协议的隧道,相比使用 ICMP 协议的隧道而言,IP 协议的隧道速度更快(有可能被云服务提供商误判为DDos攻击)。启用之后使用方式和 ICMP 模式一样,连接 Socks5 端口即可。

二、基于 IP 协议的端口映射

由于 SSH 的连接不是非常稳定,即便加了自动重连的方法还是会出现短暂的断网现象(自动重连大概要零点几秒),对于下载、游戏等过程有比较大影响,所以建议设置端口映射,由于 ICMP 协议速度不快,我就不写 ICMP 的端口映射了,用 ICMP 刷个网页基本不会感受到断网的情况。

由于脚本尚未完善,目前仅支持一台服务器的端口映射,如果你列表中有多台服务器,只会连接列表中的第一台服务器。

广州:gz:8001:10001:123.45.67.89:pass1:~/.ssh/id_rsa.gz为例,完成服务端和客户端的安装之后,在服务端启动一个代理(SS、SSR之类的你懂的软件),然后本地可以通过10.1.2.1这个地址连接到服务器的代理软件。

服务端完整示例:

# 安装 Pshell 服务端
$ ./Pshell.sh -s
# 安装 Shadowsocks 服务端
$ docker run -d --name ss -p 10001:10001 mritd/shadowsocks -s "-s 0.0.0.0 -p 10001 -k ss_password -m aes-256-cfb"

然后回到本地的电脑,安装好 Pshell 本地端之后(./Pshell.sh -l),打开 Shadowsocks 客户端,服务器地址为10.1.2.1,其他根据你的设置改变。

现在你可以使用 IP 协议稳定连接网络了。

扩展

一、Socks5 转 http

有些软件不支持 Socks5 代理协议,所以提供端口转换功。

使用 ./Pshell.sh -p <port> 可以指定其中一个 socks5 端口转换为 http 端口(转换后 http 协议代理端口为 8118)。

端口转换功能是保存起来的,不需要每次运行都指定它,除非你想重新指定转换的 socks5 端口。

二、分享 Socks5 端口

如果你想分享代理给他人用,可以使用 ./Pshell.sh -d <enp3s0> 参数指定网卡分享 Socks5 端口。

常用的网卡有 enp3s0|wlp2s0|eth0|wlan0 这些,使用 ifconfig 命令可以查看。

注意一点就是 Privoxy 的 8118 端口默认为仅 localhost 访问,如果需要他人访问,你还需要修改 localhost 为其他地址(例如 0.0.0.0),这样他人可以通过这个 http 端口访问外网。

三、重启 sshd 进程

在使用过程中可能会出现 sshd 进程崩溃的情况,这时候明明没有连接异常但死活连不上。

这个时候你可以使用 ./Pshell.sh -k 参数来杀死崩溃 sshd 进程并手动执行 ./Pshell.sh 重新启动 sshd 进程。

最后

使用 alias 指定脚本为特定命令即可更加方便启动。

其他功能自己发现(其实也没什么其他功能了),在脚本中可以看到全部可选参数。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].