pwn.college - Docker Setup
On Host Machine
-
Download sample Dockerfile
-
Build Custom Docker Image
docker image prune -f && docker build -t pwncollege_custom:v1 .
docker image prune -f
forcefully removes unused images [optional]-t
gives image a tag in 'name:tag' format.
specifies location of Dockerfile is in current working directory
- Run Docker Container
docker image prune -f && docker run -it --rm --name pwncollege_challenges pwncollege_custom:v1 /bin/bash
docker image prune -f
forcefully removes unused images [optional]-it
keeps STDIN open even if not attached and allocates pseudo-TTY--rm
automatically removes container when it exits--name pwncollege_challenges
assigns name to containerpwncollege_custom:v1
custom Docker image from step 1 above/bin/bash
command run by container
- [optional] Connect to Running Container (from another terminal)
docker exec -it pwncollege_challenges /bin/bash
In Docker Container
- Copy ELF binary, then set privileges and setuid
sudo cp /challenges/<module_dir>/<elf_binary> / && sudo chmod 4755 /<elf_binary>