Docker Container Escape
Looking For Potential Files
Whenever you are in a docker container, always try to enumerate the system as much as you can, because you will always find something interesting in it.
// Potential Directories where you can find something interesting
/opt
/home
/home/<username>
/tmp
/var/www/htmlDoing Reverse Proxy Using Chisel
We can also do reverse proxy using chisel. It will help us in such a way that you want to connect to MySQL or Redis database and you are not having such tools installed on the docker container so you can do a reverse proxy and connect to MySQL or redis using proxychains
//Running Chisel on the Kali Linux First
chisel server --reverse -p 1234 --socks5
// Running Chisel on the docker container
./chisel client <ip of kali linux>:1234 R:socks
// Now you can use proxychains and access the things on docker containerLooking For IP Addresses
Sometimes you cannot run ip a or ifconfig command so you can run the following to obtain the ip address

Route Information
We can look for routes using below command

to convert the hexadecimal ip we can use below python script
Command To See Open Port
if you want to see an open port and there is no Nmap or Netcat, you can run the below command

Automated Tools
Deepce
We can use Deepce tool from the below link to enumerate docker containers for potential escapes

Docker Privileged Mode Enabled
We can escalate our privileges from docker container to host machine if we have privilege mode turned on, in this case we can mount the Host Files and Folders on the Docker Container and access them

Last updated