# 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>
```
## 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/e1000c4460c0d6ca3e530099fd1d69bad3cdae6c
├── [3.5K] hax.c
├── [ 386] lib.c
├── [4.0K] libnss_X
│ └── [ 16K] P0P_SH3LLZ_ .so.2
├── [ 179] Makefile
└── [ 694] README.md
1 directory, 5 files