Docker container with all required CTF pwn tools. Had to do this cuz macOS moment.
docker build -t pwn:pwn .
alias pwn="docker run --security-opt seccomp=unconfined --privileged --cap-add=SYS_PTRACE -p 31337:31337 -v ./:/pwn -it pwn:pwn bash"
When I tried debugging inside the container built with and run as --platform=linux/amd64
, it did not work. I looked around a bit to find that this is a known issue with Docker on Mac. As an alternative to debug and run x86_64 binaries, I switched to Colima.
It is slower because it uses QEMU to emulate the entire VM in x86_64 but it works flawlessly. I guess the performance hit is bearable as long as everything works. So until Docker fixes their issue with Rosetta2 we'll just have to use QEMU.
Here's the command to install and set everything:
brew install docker
brew install colima
brew install docker-buildx
colima start -p x64 -a x86_64 -c 8 -m 4 -d 10 --vm-type qemu
docker-buildx -t pwn:pwn .
docker run --security-opt seccomp=unconfined --privileged --cap-add=SYS_PTRACE -p 31337:31337 -v ./:/pwn -it pwn:pwn bash
Modified from ScarletFireLabs.