[点晴永久免费OA]chisel:穿透防火墙的瑞士军刀!Go 单文件 3 秒打通内网,frp/ngrok 集体下岗
|
admin
2026年4月1日 22:0
本文热度 34
|
⚡ 一句话优势
一个二进制文件 chisel = 客户端 + 服务端,跨平台(Win/macOS/Linux),无需 root,支持 UDP,自动穿代理,断线 0 感知。
📦 30 秒极速安装
# Linux / macOS(单文件)
curl -L https://github.com/jpillora/chisel/releases/latest/download/chisel_linux_amd64 -o chisel && chmod +x chisel
# Windows(PowerShell)
Invoke-WebRequest -Uri "https://github.com/jpillora/chisel/releases/latest/download/chisel_windows_amd64.exe" -OutFile "chisel.exe"
# 或 Go 一键装
go install github.com/jpillora/chisel@latest
# Docker 即开即用
docker run --rm -it jpillora/chisel --help
🎯 核心特性(Copy 即用)
| | |
|---|
| 穿透防火墙 | | chisel client http://server:8080 8080 |
| 自动重连 | | |
| 多路复用 | | chisel client server:8080 8080 9090 9999 |
| 反向端口转发 | | chisel server --reverse |
| SOCKS5 代理 | | --socks5 |
| 身份验证 | | --auth user:pass |
| TLS 支持 | | --tls-domain example.com |
| 代理链 | | --proxy socks://admin:pass@proxy:1080 |
🎮 拖布图(工作原理)

🔥 5 个实战场景(一行命令)
场景 1:内网穿透(最常用)
# 服务端(公网 VPS)
chisel server --port 9312 --socks5
# 客户端(内网机器)
chisel client https://vps-ip:9312 --auth admin:123456 8080
# 访问本地 8080 → 自动穿透到内网
场景 2:反向 SSH(内网机器无公网 IP)
# 服务端(公网)
chisel server --port 9312 --reverse
# 客户端(内网)
chisel client https://vps-ip:9312 R:2222:localhost:22
# 在 VPS 上 ssh -p 2222 localhost → 连接到内网机器的 22 端口
场景 3:SOCKS5 代理隧道
# 服务端
chisel server --port 9312 --socks5
# 客户端
chisel client https://vps-ip:9312 socks
# 浏览器设置代理 127.0.0.1:1080 → 所有流量走隧道
场景 4:通过 HTTP 代理连接
chisel client --proxy http://corp-proxy:8080 https://vps-ip:9312 8080
场景 5:stdio 模式(SSH ProxyCommand)
ssh -o ProxyCommand='chisel client https://vps-ip:9312 stdio:%h:%p' user@target.com
🔐 安全机制(双重保险)
- SSH 协议(crypto/ssh)封装 HTTP,端到端加密
- ECDSA 密钥对 随机生成,启动时显示指纹(Base64 SHA256),44 字符 + =
- 服务端:--authfile users.json(用户白名单)或 --auth user:pass(单用户)

users.json 示例:
{
"admin:123456": [""], // 全部权限
"user1:pass1": ["192.168.0.*:80"] // 仅 80 端口
}
📋 参数速查表(服务端)
| | |
|---|
--host | | 0.0.0.0 |
--port | | -p 9312 |
--keyfile | | --keyfile /path/to/key.pem |
--authfile | | --authfile users.json |
--auth | | --auth admin:123456 |
--socks5 | | --socks5 |
--reverse | | --reverse |
--tls-domain | | --tls-domain chisel.example.com |
--pid | | --pid |
-v | | -v |
📋 参数速查表(客户端)
| | |
|---|
--fingerprint | | --fingerprint abc123...= |
--auth | | --auth admin:123456 |
--proxy | | --proxy socks://proxy:1080 |
--keepalive | | --keepalive 25s |
--max-retry-count | | --max-retry-count 10 |
--header | | --header "User-Agent: MyApp" |
--tls-skip-verify | | --tls-skip-verify |
⚠️ WebSocket 兼容性
| |
|---|
| IaaS | |
| Heroku | |
| OpenShift | |
| Google App Engine | |
阅读原文:原文链接
该文章在 2026/4/2 12:27:14 编辑过