Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gill-singh-a/docker-api-remote-root-shell-exploit

A Simple Python Program that uses Docker Module to communicate with Docker API and gets a Remote Root Shell on the Target Device
https://github.com/gill-singh-a/docker-api-remote-root-shell-exploit

docker exploit python ssh

Last synced: 3 months ago
JSON representation

A Simple Python Program that uses Docker Module to communicate with Docker API and gets a Remote Root Shell on the Target Device

Awesome Lists containing this project

README

        

# Docker API Remote Root Shell Exploit
A Simple Python Program that uses Docker Module to communicate with Docker API and gets a Remote Root Shell on the Target Device
## Requirements
Language Used = Python3

Modules/Packages used:
* os
* docker
* paramiko
* socket
* random
* string
* base64
* getpass
* datetime
* subprocess
* optparse
* multithreading
* colorama
* time

Install the dependencies:
```bash
pip install -r requirements.txt
```
## Setup
After installing Docker on your local device, run the following commands as root user
```bash
docker pull ubuntu:20.04
docker save ubuntu:20.04 -o ubuntu_image.tar
chmod 666 ubuntu_image.tar
```
## Working
![Working of Exploit](assets/images/working.png)
## Result
After Successful Exploitation, we can directly ssh to the target device as root user or the provided user.
## Note
This Method won't work if the Docker API is password Protected or when Docker is run with non-root user.