利用sudo提权,只针对cnetos7# 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
[4.0K] /data/pocs/9d7d8d150b45410f3ded43c360828f7e8c4b2794
├── [5.5K] CVE-2021-3156.py
├── [4.0K] image
│ ├── [ 52K] 1.png
│ └── [ 93K] 2.png
└── [ 631] README.md
1 directory, 4 files