Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2021-3156 PoC — Sudo 缓冲区错误漏洞

Source
Associated Vulnerability
Title:Sudo 缓冲区错误漏洞 (CVE-2021-3156)
Description:Sudo是一款使用于类Unix系统的,允许用户通过安全的方式使用特殊的权限执行命令的程序。 Sudo 1.9.5p2 之前版本存在缓冲区错误漏洞,攻击者可使用sudoedit -s和一个以单个反斜杠字符结束的命令行参数升级到root。
Description
利用sudo提权,只针对cnetos7
Readme
# 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
File Snapshot

[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
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.