dmitryporotnikov/SSLInspectingRouter

GitHub: dmitryporotnikov/SSLInspectingRouter

一个基于 Linux 的 HTTP/HTTPS 透明拦截代理,通过 iptables NAT 和 TLS MITM 实现网络流量的检查、日志记录与内容修改。

Stars: 9 | Forks: 3

![Banner](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/0b72ebde55223500.jpg) 一个用于 Linux 上 HTTP 和 HTTPS 流量的透明拦截代理。它使用 iptables NAT 重定向流量,并在本地进行拦截以供检查、记录日志以及进行可选的内容修改。 ## 功能 - 通过 iptables NAT 透明拦截 HTTP/HTTPS - 使用动态生成的单主机证书进行 TLS MITM - **SNI-only 模式** — 无需解密的被动观察 - 使用 SQLite 记录流量日志,完整捕获请求/响应 - Web 仪表板,提供实时流量视图、策略管理和运行时控制 - WireGuard 和 Tor 出口(运行时可切换,互斥) - 基于 JSON 的响应重写 - 导出解密流量的 PCAP 以供 Wireshark 使用 - 按 FQDN、IP 或 CIDR 设置丢弃/旁路列表;支持源 IP 的白名单模式 ![Preview](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/5e1134c593223505.gif) ## 快速开始 ``` # Ubuntu / Debian sudo apt install iptables iproute2 golang # 1. Clone git clone https://github.com/dmitryporotnikov/SSLInspectingRouter.git cd SSLInspectingRouter # 2. Build(尚未进行 host 更改) go build -o sslinspectingrouter ./cmd/router # 3. Run(iptables、forwarding 和 interception 需要 root 权限) sudo ./sslinspectingrouter -web :3000 # 4. 打开 dashboard # http://:3000 · 默认 admin / admin123 ``` 对于首次设置以及完整的依赖检查,请使用 `sudo ./scripts/setup.sh`。 ## 文档 | 主题 | 位置 | | --- | --- | | 架构、iptables 链、MITM 流程、关闭 | [documentation/how-it-works.md](documentation/how-it-works.md) | | 所有 CLI 标志和环境变量 | [documentation/cli.md](documentation/cli.md) | | 仪表板身份验证、控制中心、运行时开关 | [documentation/dashboard.md](documentation/dashboard.md) | | **SNI-only 模式**(无 MITM 被动观察) | [documentation/snionly.md](documentation/snionly.md) | | WireGuard 和 Tor 出口 | [documentation/egress.md](documentation/egress.md) | | 日志模式、body 产物、PCAP、DB schema | [documentation/logging.md](documentation/logging.md) | | API 参考、状态 payload、错误代码 | [documentation/api.md](documentation/api.md) | | 安全检查清单与限制 | [documentation/security.md](documentation/security.md) | | 故障排除指南 | [documentation/troubleshooting.md](documentation/troubleshooting.md) | | 响应重写 | [rewrites/README.md](rewrites/README.md) | | 本地化 | [LOCALIZATION_CONTRIBUTING.md](LOCALIZATION_CONTRIBUTING.md) | | 贡献 | [documentation/contributing.md](documentation/contributing.md) | ## 30 秒快速了解各模式 | 模式 | 处理方式 | 启用位置 | | --- | --- | --- | | 全面检查 | MITM HTTPS,记录每个请求/响应,应用重写。 | 默认。 | | 旁路 | 原样隧道传输特定主机;记录 `BYPASSED` 标记。 | `-bypass` 或仪表板策略。 | | 丢弃 | 匹配时关闭连接。 | `-drop` 或仪表板策略。 | | 检查已暂停 | 当你在处理其他任务时,原样隧道传输所有内容。 | 仪表板中的 `Inspection` 开关。 | | **SNI-only** | 原样转发 HTTPS;仅记录 SNI 和 ClientHello 元数据(TLS 版本、cipher、ALPN、扩展)。 | `-snionly` 标志或 `SNI-only Mode` 开关。 | | 白名单(仅检查) | 仅检查来自所列源 IP 的流量。 | `-inspectonly`。 | 有关示例日志行和捕获的完整元数据列表,请参阅 [documentation/snionly.md](documentation/snionly.md)。 ## 许可证 请参阅 [LICENSE](LICENSE)。 ## 致谢 感谢 [@ankit20012006](https://github.com/ankit20012006) 和 [@Anand-240](https://github.com/Anand-240) 对本地化的贡献。
标签:DLL注入, EVTX分析, Go语言, HTTPS拦截, 中间人攻击, 日志审计, 流量审计, 程序破解, 网络中间件, 透明代理