Sploitus

Exploit for Off-by-one Error in Sudo Project Sudo

gitee Β· 2021-08-27

Exploit Code

MARKDOWN13 lines
## https://sploitus.com/exploit?id=5DF19114-1376-5D1B-B84E-EA96D2B95314
This repository is a collection of exploit code for the CVE-2021-3156 vulnerability in sudo, a Unix command that allows users to execute commands as another user. The vulnerability is a heap-based overflow in the sudo library, which can be exploited to gain elevated privileges.

The repository contains multiple exploit scripts, each targeting different versions of glibc and nsswitch.conf configurations. The exploits are written in Python and use the ctypes library to interact with the libc library.

The exploits work by overwriting the service_user struct in the nsswitch.conf configuration, which is used by the sudo library to determine the user's identity. By overwriting this struct, the exploit can gain control of the user's identity and execute arbitrary commands as the target user.

The repository contains the following exploit scripts:

`exploit_nss.py`: This script targets glibc with tcache and nscd service not running.
`exploit_nss_manual.py`: This script is a simplified version of `exploit_nss.py` that removes all checking code and manual a number of services before group line.
`exploit_nss_d9.py`: This script targets glibc without tcache and nscd service not running.
`exploit_nss_u14.py`: This script targets