├── Dockerfile ├── README.md ├── build ├── connect ├── start └── stop /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.16-buster AS golang 2 | FROM ubuntu:20.04 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | 6 | RUN apt update \ 7 | && apt -y install locales 8 | RUN locale-gen en_US.UTF-8 9 | ENV LANG en_US.UTF-8 10 | ENV LANGUAGE en_US:en 11 | ENV LC_ALL en_US.UTF-8 12 | 13 | # create tools directory 14 | RUN mkdir ~/tools 15 | 16 | # base tools 17 | RUN apt update \ 18 | && apt -y install --no-install-recommends lsof strace ltrace neovim vim \ 19 | patchelf netcat socat file unzip curl wget git gdb g++ man sudo \ 20 | inetutils-ping less jq \ 21 | && apt clean 22 | 23 | # Install python3.8 24 | RUN apt -y install --no-install-recommends software-properties-common \ 25 | && add-apt-repository -y ppa:deadsnakes/ppa \ 26 | && apt update \ 27 | && apt -y install python3.8-dev python3.8-venv python3-pip 28 | RUN python3.8 -m venv /root/py38 29 | ENV PATH="/root/py38/bin:${PATH}" 30 | 31 | RUN python3 -m pip install --upgrade pip \ 32 | && python3 -m pip install setuptools 33 | 34 | RUN apt update \ 35 | && apt -y install --no-install-recommends gcc-multilib g++-multilib \ 36 | && apt clean 37 | 38 | # libc6-dbg & 32-bit libs 39 | RUN dpkg --add-architecture i386 \ 40 | && apt update \ 41 | && apt -y install --no-install-recommends xz-utils libc6-dbg libc6-dbg:i386 glibc-source \ 42 | && apt clean \ 43 | && tar -C /usr/src/glibc/ -xf /usr/src/glibc/glibc-*.tar.xz 44 | 45 | # Z3 46 | RUN cd ~/tools \ 47 | && git clone --depth 1 https://github.com/Z3Prover/z3.git && cd z3 \ 48 | && python3 scripts/mk_make.py --python \ 49 | && cd build; make && make install 50 | 51 | # Angr 52 | RUN python3 -m pip install angr 53 | 54 | # pwntools 55 | RUN python3 -m pip install --upgrade pwntools 56 | 57 | # one_gadget 58 | RUN apt update \ 59 | && apt -y install --no-install-recommends ruby-full \ 60 | && apt clean 61 | RUN gem install one_gadget 62 | 63 | RUN apt update \ 64 | && apt -y install --no-install-recommends e2tools qemu \ 65 | && apt clean 66 | 67 | # ARM cross compilers 68 | RUN apt update \ 69 | && apt -y install --no-install-recommends gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabihf g++-arm-linux-gnueabihf \ 70 | && apt clean 71 | 72 | # ropper 73 | RUN python3 -m pip install ropper 74 | 75 | # Ripgrep 76 | RUN RIPGREP_VERSION=$(curl -s https://api.github.com/repos/BurntSushi/ripgrep/releases/latest | jq -r .tag_name) \ 77 | && curl -LO https://github.com/BurntSushi/ripgrep/releases/download/${RIPGREP_VERSION}/ripgrep_${RIPGREP_VERSION}_amd64.deb \ 78 | && dpkg -i ripgrep_${RIPGREP_VERSION}_amd64.deb \ 79 | && rm ripgrep_${RIPGREP_VERSION}_amd64.deb 80 | 81 | # Binwalk 82 | RUN cd ~/tools \ 83 | && git clone --depth 1 https://github.com/devttys0/binwalk && cd binwalk \ 84 | && python3 setup.py install 85 | 86 | # Radare2 87 | RUN cd ~/tools \ 88 | && git clone --depth 1 https://github.com/radare/radare2 && cd radare2 \ 89 | && ./sys/install.sh 90 | 91 | # Install tmux from source 92 | RUN apt update \ 93 | && apt -y install --no-install-recommends libevent-dev libncurses-dev \ 94 | && apt clean 95 | 96 | RUN TMUX_VERSION=$(curl -s https://api.github.com/repos/tmux/tmux/releases/latest | jq -r .tag_name) \ 97 | && wget https://github.com/tmux/tmux/releases/download/$TMUX_VERSION/tmux-$TMUX_VERSION.tar.gz \ 98 | && tar zxf tmux-$TMUX_VERSION.tar.gz \ 99 | && cd tmux-$TMUX_VERSION \ 100 | && ./configure && make && make install \ 101 | && cd .. \ 102 | && rm -rf tmux-$TMUX_VERSION* \ 103 | && echo "tmux hold" | dpkg --set-selections # disable tmux update from apt 104 | 105 | # Install Go 106 | COPY --from=golang /usr/local/go /usr/local/go 107 | ENV GOPATH /go 108 | ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH 109 | 110 | # Install babashka (clojure) 111 | RUN curl -s https://raw.githubusercontent.com/babashka/babashka/master/install | bash 112 | 113 | RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" 114 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PwnDock 2 | 3 | This is an attempt at a faster, easier-to-setup version of [pwnvm](https://github.com/OpenToAllCTF/pwnvm). You should not clone this repo! Use `grazfather/pwndock:latest` in your Dockerfile to grab the latest (and avoid building). 4 | 5 | ## Setup 6 | 1. Install Docker: `brew cask install docker` on OSX. You can figure it out on Linux. 7 | 2. Clone [this OTHER repo](https://github.com/Grazfather/mypwndock). 8 | 3. Add your customizations to the _Dockerfile_, and the other scripts if you desire, for example, to use a different name. 9 | 4. Build: `./build` 10 | 11 | ## Running it 12 | Management: `start`, `stop`, `connect` 13 | -------------------------------------------------------------------------------- /build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build . -t pwndock 4 | -------------------------------------------------------------------------------- /connect: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$#" -ge 1 ]; then 4 | docker exec -it pwndock $@ 5 | else 6 | docker exec -it pwndock tmux 7 | fi 8 | -------------------------------------------------------------------------------- /start: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker run --rm --detach --privileged -it \ 4 | --net=host \ 5 | --hostname pwn \ 6 | --name pwndock \ 7 | pwndock \ 8 | bash \ 9 | && echo "[+] Started" 10 | -------------------------------------------------------------------------------- /stop: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker kill pwndock >/dev/null && echo "[+] Stopped" 4 | --------------------------------------------------------------------------------