Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2019-5736 PoC — Docker 操作系统命令注入漏洞

Source
Associated Vulnerability
Title:Docker 操作系统命令注入漏洞 (CVE-2019-5736)
Description:runc through 1.0-rc6, as used in Docker before 18.09.2 and other products, allows attackers to overwrite the host runc binary (and consequently obtain host root access) by leveraging the ability to execute a command as root within one of these types of containers: (1) a new container with an attacker-controlled image, or (2) an existing container, to which the attacker previously had write access, that can be attached with docker exec. This occurs because of file-descriptor mishandling, related to /proc/self/exe.
Description
runc容器逃逸漏洞预警
Readme
# Usage
Edit HOST inside `payload.c`, compile with `make`. Start `nc` and run `pwn.sh` inside the container.

# Notes
- This exploit is destructive: it'll overwrite `/usr/bin/docker-runc` binary *on the host* with the
payload. It'll also overwrite `/bin/sh` inside the container.
- Tested only on Debian 9.
- No attempts were made to make it stable or reliable, it's only tested to work when a `docker exec
<id> /bin/sh` is issued on the host.

The original commit I used to write the exploit is [here](https://github.com/lxc/lxc/commit/6400238d08cdf1ca20d49bafb85f4e224348bf9d).

The researchers who actually found the vulnerability have published a writeup
[here](https://web.archive.org/web/20190213095645/https://blog.dragonsector.pl/2019/02/cve-2019-5736-escape-from-docker-and.html).

I've added the original exploit `CVE_2019_5736_tar_xz` which works differently than mine. Thanks to
[cyphar](https://github.com/cyphar) for pointing me to it.

File Snapshot

[4.0K] /data/pocs/03542b88d283e6756894328cda8b5cb7afdaede9 ├── [4.0K] CVE-2019-5736 │   ├── [1.5K] bad_init.sh │   ├── [2.8K] bad_libseccomp.c │   ├── [2.3K] make.sh │   └── [2.8K] README.md ├── [3.5K] CVE_2019_5736.tar.gz ├── [3.5K] CVE_2019_5736_tar_xz ├── [6.2K] exploit ├── [1.4K] exploit.c ├── [ 75] Makefile ├── [6.2K] payload ├── [ 647] payload.c ├── [ 52] push.sh ├── [ 455] pwn.sh └── [ 951] README.md 1 directory, 14 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →