# SecuBox mitmproxy App > **Languages:** [English](README.md) | [Francais](README.fr.md) | 中文 带有 mitmproxy 的 LXC 容器,用于 HTTPS 流量检查和威胁检测。 ## 多实例支持 SecuBox 支持多个 mitmproxy 实例用于不同的流量: | 实例 | 用途 | 代理端口 | Web 端口 | 模式 | |------|------|----------|----------|------| | **out** | LAN → 互联网(出站代理) | 8888 | 8089 | transparent | | **in** | WAN → 服务(WAF/反向) | 8889 | 8090 | upstream | ### 实例命令 ```bash # 列出所有实例 mitmproxyctl list-instances # 特定实例状态 mitmproxyctl status out mitmproxyctl status in # 进入实例 shell mitmproxyctl shell in # 启动/停止实例(通过 init.d) /etc/init.d/mitmproxy start /etc/init.d/mitmproxy stop ``` ### UCI 配置 实例在 `/etc/config/mitmproxy` 中配置: ``` config instance 'out' option enabled '1' option description 'LAN->Internet Proxy' option container_name 'mitmproxy-out' option proxy_port '8888' option web_port '8089' option mode 'transparent' config instance 'in' option enabled '1' option description 'WAF/Reverse Proxy' option container_name 'mitmproxy-in' option proxy_port '8889' option web_port '8090' option mode 'upstream' option haproxy_backend '1' ``` ## 组件 | 组件 | 描述 | |------|------| | **LXC 容器** | 基于 Debian 的容器,带有 mitmproxy(每个实例一个) | | **secubox_analytics.py** | mitmproxy 的威胁检测插件 | | **haproxy_router.py** | HAProxy 后端路由插件 | | **CrowdSec 集成** | 用于自动 IP 封禁的威胁日志记录 | ## 威胁检测模式 ### 检测的攻击类型 | 类别 | 模式 | |------|------| | **SQL 注入** | UNION SELECT, OR 1=1, SLEEP(), BENCHMARK() | | **XSS** | `