Share
## https://sploitus.com/exploit?id=5E86A164-FA62-5822-A034-A558F2C68082
# CVE-2021-3156-centos7
利用sudo提权,只针对cnetos7
受影响版本:
sudo: 1.8.2 - 1.8.31p2
sudo: 1.9.0 - 1.9.5p1
以非root用户登录系统,并运行如下命令:
sudoedit -s /
回显是 not a regular file
多半是存在该漏洞

使用方法:
首先使用非root用户登录,然后将/etc/passwd里面所有的内容复制到CVE-2021-3156.py的APPEND_CONTENT = b"""\n""";里面,将改普通用户的uid和gid都改成0然后运行CVE-2021-3156.py文件
https://github.com/PhuketIsland/CVE-2021-3156-centos7/blob/main/image/1.png
https://github.com/PhuketIsland/CVE-2021-3156-centos7/blob/main/image/2.png