Rapid7 Vulnerability & Exploit Database

Docker Privileged Container Escape

Back to Search

Docker Privileged Container Escape

Disclosed
07/17/2019
Created
08/05/2020

Description

This module escapes from a privileged Docker container and obtains root on the host machine by abusing the Linux cgroup notification on release feature. This exploit should work against any container started with the following flags: `--cap-add=SYS_ADMIN`, `--privileged`.

Author(s)

  • stealthcopter

Platform

Linux

Architectures

x86, x64, armle, mipsle, mipsbe

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/linux/local/docker_privileged_container_escape
msf exploit(docker_privileged_container_escape) > show targets
    ...targets...
msf exploit(docker_privileged_container_escape) > set TARGET < target-id >
msf exploit(docker_privileged_container_escape) > show options
    ...show and set options...
msf exploit(docker_privileged_container_escape) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;