├── Dockerfile.m ├── Dockerfile.x86 ├── Makefile └── README.md /Dockerfile.m: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/amd64 ubuntu:22.04 2 | 3 | #https://wiki.ubuntu.com/Releases 4 | 5 | ENV DEBIAN_FRONTEND=noninteractive 6 | 7 | #RUN dpkg --add-architecture arm64 8 | 9 | RUN apt-get update --fix-missing && \ 10 | apt-get install -y --no-install-recommends \ 11 | git \ 12 | gdb \ 13 | wget \ 14 | patchelf \ 15 | file \ 16 | strace \ 17 | tmux \ 18 | python3 \ 19 | nasm \ 20 | binwalk \ 21 | bsdmainutils \ 22 | netcat \ 23 | python3-pip \ 24 | ruby-full \ 25 | valgrind \ 26 | vim \ 27 | xclip \ 28 | elfutils \ 29 | checksec \ 30 | ca-certificates && \ 31 | apt-get clean && \ 32 | rm -rf /var/lib/apt/lists/* 33 | # Try multiarch gdb? 34 | # gdb-multiarch \ 35 | # libc6-dbg \ 36 | # libc6-dev 37 | 38 | WORKDIR /opt 39 | RUN git clone https://github.com/pwndbg/pwndbg 40 | WORKDIR /opt/pwndbg 41 | ENV LC_ALL=C.UTF-8 42 | RUN ./setup.sh 43 | # put this after setup.sh in case of multiarch --force-gdb-version /usr/bin/gdb-multiarch 44 | 45 | WORKDIR /opt 46 | RUN wget https://github.com/io12/pwninit/releases/download/3.3.0/pwninit && \ 47 | chmod +x pwninit 48 | 49 | RUN gem install one_gadget 50 | RUN pip3 install IPython icecream angr pwntools 51 | 52 | WORKDIR /home/localdir 53 | CMD ["bash"] 54 | -------------------------------------------------------------------------------- /Dockerfile.x86: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | #https://wiki.ubuntu.com/Releases 4 | 5 | ENV DEBIAN_FRONTEND noninteractive 6 | 7 | RUN apt update --fix-missing 8 | RUN apt install -y git gdb git wget patchelf file strace tmux python3 nasm binwalk bsdmainutils 9 | RUN apt install -y netcat python3-pip ruby-full valgrind vim xclip elfutils 10 | RUN apt install -y checksec 11 | 12 | WORKDIR /opt 13 | RUN git clone https://github.com/pwndbg/pwndbg 14 | WORKDIR /opt/pwndbg 15 | ENV LC_ALL=C.UTF-8 16 | RUN ./setup.sh 17 | 18 | WORKDIR /opt 19 | RUN wget https://github.com/io12/pwninit/releases/download/3.3.0/pwninit 20 | RUN chmod +x pwninit 21 | 22 | RUN gem install one_gadget 23 | RUN pip3 install IPython icecream angr pwntools 24 | 25 | WORKDIR /home/localdir 26 | CMD bash 27 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | Green=\033[0;32m 2 | BGreen=\033[1;32m 3 | Color_Off=\033[0m 4 | 5 | build_m: 6 | @docker build --platform linux/amd64 -f Dockerfile.m --no-cache -t ubuntu-pwner . 7 | @if [ "$$SHELL" = "/bin/zsh" ]; then \ 8 | echo 'alias pwnbox="docker run -it -v `pwd`:/home/localdir ubuntu-pwner /bin/bash"' >> ~/.zshrc; \ 9 | else \ 10 | echo 'alias pwnbox="docker run -it -v `pwd`:/home/localdir ubuntu-pwner /bin/bash"' >> ~/.bashrc; \ 11 | fi 12 | @echo "${Green}[+] The Building is done and pwnbox alias is created${Color_Off}" 13 | @echo "${BGreen}[+] Source your user interface to apply the aliases with (source .bashrc) or (source .zshrc)${Color_Off}" 14 | 15 | build_x86: 16 | @docker build -f Dockerfile.x86 -t ubuntu-pwner . 17 | @if [ "$$SHELL" = "/bin/zsh" ]; then \ 18 | echo 'alias pwnbox="docker run -it -v `pwd`:/home/localdir ubuntu-pwner /bin/bash"' >> ~/.zshrc; \ 19 | else \ 20 | echo 'alias pwnbox="docker run -it -v `pwd`:/home/localdir ubuntu-pwner /bin/bash"' >> ~/.bashrc; \ 21 | fi 22 | @echo "${Green}[+] The Building is done and pwnbox alias is created${Color_Off}" 23 | @echo "${BGreen}[+] Source your user interface to apply the aliases with (source .bashrc) or (source .zshrc)${Color_Off}" 24 | 25 | destroy: 26 | @docker rmi -f ubuntu-pwner || echo "${Green}[+] No image named ubuntu-pwner to remove${Color_Off}" 27 | @echo "${Green}[+] Removed the ubuntu-pwner image${Color_Off}" 28 | 29 | .PHONY: build_m build_x86 build destroy 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PWNBOX 2 | 3 | Mostly while doing pwn challenges, you feel the need of having to install pwn tools, gdb, one gadget ... Here is a docker image that contains everything you need with an alias `pwnbox` you can run it anywhere in your system and it's gonna automatically mount your folder, into the image. 4 | 5 | ## PREREQUISITE 6 | Docker sould be installed and running. You can check it using this command : 7 | ```bash 8 | sudo systemctl status docker 9 | ``` 10 | Makefile, you can also check it, using: 11 | ```bash 12 | make --version 13 | ``` 14 | 15 | ## USAGE 16 | 17 | If you are on a Mac M chip build your image using : 18 | ```bash 19 | make build_m 20 | ``` 21 | 22 | If you have an intel CPU or windows or anything else you can use : 23 | ```bash 24 | make build_x86 25 | ``` 26 | 27 | Afterward you can run your image anywhere, in your system using (Note: The pwd where you are running this command defines the folder where the docker gonna be mounted): 28 | ```bash 29 | pwnbox 30 | ``` 31 | 32 | If you want to destroy your image your can use : 33 | ```bash 34 | make destroy 35 | ``` 36 | --------------------------------------------------------------------------------