# CVE-2021-3156
#### Root shell PoC for CVE-2021-3156 (no bruteforce)
For educational purposes etc.
Tested on Ubuntu 20.04 against sudo 1.8.31
All research credit: **Qualys Research Team**
Check out the details on their [blog](https://blog.qualys.com/vulnerabilities-research/2021/01/26/cve-2021-3156-heap-based-buffer-overflow-in-sudo-baron-samedit).
You can check your version of sudo is vulnerable with: `$ sudoedit -s Y`.
If it asks for your password it's most likely vulnerable, if it prints usage information it isn't.
You can downgrade to the vulnerable version on Ubuntu 20.04 for testing purposes with `$ sudo apt install sudo=1.8.31-1ubuntu1`
#### Usage
`$ make`
`$ ./exploit`
[4.0K] /data/pocs/8e2db213e757cd7ffedfadb6a4b0f26b43f7e918
├── [5.6K] CVE-2021-3156.tar.gz
├── [ 16K] exploit
├── [2.0K] exploit.c
├── [4.0K] libnss_x
│ └── [ 14K] x.so.2
├── [ 208] Makefile
├── [ 692] README.md
└── [ 599] shellcode.c
1 directory, 7 files