Sploitus

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

gitee Β· 2021-05-25

Exploit Code

MARKDOWN2 lines
## https://sploitus.com/exploit?id=C94E18E2-D2A0-5399-9B80-390D76BC4CB2
This is a PoC exploit for CVE-2021-3156, a sudo vulnerability dubbed Baron Samedit by Qualys. The exploit targets the heap overflow vulnerability in sudo, aiming for singleshot execution. It does not modify system files and comes with no warranties. The exploit is designed to be used in manual mode, where the user specifies the smash length A, smash length B, null stomp length, and lc all length. The brute force target finding feature is experimental and requires GNU parallel to be installed. The exploit uses a timeout of 2 seconds and writes the output to a file named out/XXXX.txt, where XXXX is the index number. The exploit is typically invoked by running the command ./sudo-hax-me-a-sandwich <target_number>, where target_number is the index number of the target. The expected impact of this exploit is remote code execution, as it sets the user ID to 0 and executes the /bin/sh command.