POC详情: 040c97952ea6d349f36c579192f617d7f0cc2740

来源
关联漏洞
标题: Sudo 缓冲区错误漏洞 (CVE-2021-3156)
描述:Sudo是一款使用于类Unix系统的,允许用户通过安全的方式使用特殊的权限执行命令的程序。 Sudo 1.9.5p2 之前版本存在缓冲区错误漏洞,攻击者可使用sudoedit -s和一个以单个反斜杠字符结束的命令行参数升级到root。
描述
This repository contains a Proof-of-Concept (PoC) exploit for the Baron Samedit vulnerability (CVE-2021-3156). The exploit demonstrates privilege escalation on Ubuntu 20.04 with sudo version 1.8.31 and glibc version 2.31. It includes an assembly-based exploit, a shared object payload, and a Makefile for automated compilation.
介绍
# Baron Samedit PoC

## Description
This is a Proof-of-Concept (PoC) exploit for the Baron Samedit vulnerability (CVE-2021-3156) tested on Ubuntu 20.04 with sudo version 1.8.31 and glibc version 2.31. The exploit leverages a heap-based buffer overflow in sudo's handling of command-line arguments when using `sudoedit` to achieve privilege escalation.

## Exploit Components
- **`exploit.asm`**: A handcrafted assembly exploit that constructs the argument and environment buffers to trigger the vulnerability.
- **`shellcode.c`**: A minimal shared object payload that executes `/bin/sh` with elevated privileges.
- **`Makefile`**: Automates the build process for both the shellcode and exploit binary.

## Build Instructions
To compile the exploit:
```sh
make
```

## Exploit Execution
1. Run the exploit binary:
   ```sh
   ./exploit
   ```
2. If successful, this will invoke the vulnerable sudoedit with a corrupted environment, leading to privilege escalation.

## Prerequisites
- Ensure that sudo version 1.8.31 is installed and unpatched.
- Ubuntu 20.04 with glibc 2.31.
- Proper permissions to execute the exploit.

## Cleanup
To remove generated files:
```sh
make clean
```

## Disclaimer
This PoC is for educational and research purposes only. Unauthorized use on systems without explicit permission is illegal and unethical, I will not be held accountable for your actions. Thank you.

文件快照

[4.0K] /data/pocs/040c97952ea6d349f36c579192f617d7f0cc2740 ├── [3.4K] exploit.asm ├── [ 11K] LICENSE ├── [ 253] makefile ├── [1.4K] README.md └── [ 647] shellcode.c 0 directories, 5 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。