Aploium Blog

Cold code, warm soul.

@Aploium2年前

04/29
12:12
编程 网络

shootback:穿透内网与防火墙的反向TCP隧道

A fast and reliable reverse TCP tunnel, designed to be multi-clients and hold high concurrency (support Gzip and AES in transmission)
Github: https://github.com/Aploium/PyReverseTcpTunnel

It also can be used as reverse socks/http/ftp/smtp… proxy, anything as long as is use TCP! Help you to bypass firewall or NAT to access the LAN.
高性能,高稳定性的Python反向TCP隧道代理, 穿透内网,用于内网NAT或防火墙后的内网机器与外网建立TCP隧道. 也可用作Socks/http/ftp…代理
写它之前也尝试过用nc实现,但是nc太简陋了。
我需要用它来带一整个网站的并发和请求. 用来把一个内网站点镜像到外网

特性: (感谢@jinzihao指出)
1.支持多个client, 多个TCP链接(多个Socket) 相互独立不影响
2.支持比较高的并发, 在高负荷的时候比nc资源占用和性能都要好得多
3.自动的连接维护, 快速根据负荷调整链接池容量
4.lazy连接target
5.方便部署和维护
6.简单的握手认证
6.Gzip什么的

Brief explain about how the reverse tcp proxy works

In some situations, Machine Slaver can connect to Machine Master, but Master cannot connect to Slaver directly, by reusing the slaver’s connection, programs in the master machine can connect to the slaver’s machine directly(in those programs’ sight)

In default config,
Master will listen 127.0.0.1:1088 and 0.0.0.0:2082
Slaver will connect master_ip:20822 and target_ip:80 (in default cfg, they are all 127.0.0.1)
Read More →

shootback:穿透内网与防火墙的反向TCP隧道