diff --git a/16.04/Dockerfile b/16.04/Dockerfile index 29fc9dd..f9a1ff8 100644 --- a/16.04/Dockerfile +++ b/16.04/Dockerfile @@ -9,9 +9,12 @@ RUN apt update -y RUN apt install software-properties-common -y RUN apt-add-repository ppa:brightbox/ruby-ng RUN apt update -y -RUN apt install python python-dev python-setuptools python3 python3-pip python3-dev python3-setuptools python-capstone libssl-dev libffi-dev build-essential libc6:i386 libc6-dbg gcc-multilib make gcc netcat git curl wget gdb vim nano zsh ruby2.4 ruby2.4-dev -y -RUN curl -O https://bootstrap.pypa.io/2.7/get-pip.py && python get-pip.py && rm get-pip.py +RUN apt-get update -y +RUN apt-get install glibc-source +RUN apt install python python-dev python-setuptools python3 python3-pip python3-dev python3-setuptools python-capstone libssl-dev libffi-dev build-essential libc6:i386 libc6-dbg gcc-multilib make gcc netcat git curl wget gdb vim nano zsh ruby2.4 ruby2.4-dev tmux -y +RUN curl -O https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py && rm get-pip.py RUN python -m pip install --upgrade pip && python3 -m pip install pip==20.0.1 +RUN python3 -m pip install --upgrade pip RUN python -m pip install --ignore-installed pwntools && python3 -m pip install --ignore-installed pwntools RUN gem install one_gadget seccomp-tools @@ -31,6 +34,9 @@ RUN git clone https://github.com/sindresorhus/pure .zsh/pure RUN git clone https://github.com/zdharma/fast-syntax-highlighting .zsh/fast-syntax-highlighting RUN echo "ZSH_THEME=""\\nsource /root/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh\\nfpath+=/root/.zsh/pure\\nautoload -U promptinit; promptinit\\nprompt pure" > .zshrc +RUN echo set -g mouse on > ~/.tmux.conf + + RUN mkdir /pwn WORKDIR /pwn CMD [ "/bin/zsh" ] diff --git a/18.04/Dockerfile b/18.04/Dockerfile index 9b5b9ca..ef29cce 100644 --- a/18.04/Dockerfile +++ b/18.04/Dockerfile @@ -6,7 +6,7 @@ ARG DEBIAN_FRONTEND=noninteractive RUN dpkg --add-architecture i386 RUN apt update -y -RUN apt install python python-dev python-setuptools python3 python3-pip python3-dev python3-setuptools python-capstone libssl-dev libffi-dev build-essential libc6-dbg gcc-multilib make gcc netcat git curl wget gdb vim nano zsh ruby-full -y +RUN apt install python python-dev python-setuptools python3 python3-pip python3-dev python3-setuptools python-capstone libssl-dev libffi-dev build-essential libc6-dbg gcc-multilib make gcc netcat git curl wget gdb vim nano zsh ruby-full tmux -y RUN wget http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/libc-bin_2.27-3ubuntu1.2_amd64.deb RUN wget http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/libc-dev-bin_2.27-3ubuntu1.2_amd64.deb @@ -22,9 +22,9 @@ RUN dpkg -i libc6-dev_2.27-3ubuntu1.2_amd64.deb RUN dpkg -i libc6-i386_2.27-3ubuntu1.2_amd64.deb RUN dpkg -i libc6-dbg_2.27-3ubuntu1.2_amd64.deb -RUN curl -O https://bootstrap.pypa.io/2.7/get-pip.py && python get-pip.py && rm get-pip.py +RUN curl -O https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py && rm get-pip.py RUN python -m pip install --upgrade pip && python3 -m pip install --upgrade pip -RUN python -m pip install --ignore-installed pwntools +RUN python -m pip install --ignore-installed pwntools && python3 -m pip install --ignore-installed pwntools RUN gem install one_gadget seccomp-tools RUN git clone https://github.com/pwndbg/pwndbg .pwndbg @@ -43,6 +43,8 @@ RUN git clone https://github.com/sindresorhus/pure .zsh/pure RUN git clone https://github.com/zdharma/fast-syntax-highlighting .zsh/fast-syntax-highlighting RUN echo "ZSH_THEME=""\\nsource /root/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh\\nfpath+=/root/.zsh/pure\\nautoload -U promptinit; promptinit\\nprompt pure" > .zshrc +RUN echo set -g mouse on > ~/.tmux.conf + RUN mkdir /pwn WORKDIR /pwn CMD [ "/bin/zsh" ] diff --git a/19.04/Dockerfile b/19.04/Dockerfile index ee570b3..d2a93c0 100644 --- a/19.04/Dockerfile +++ b/19.04/Dockerfile @@ -7,10 +7,10 @@ RUN dpkg --add-architecture i386 RUN sed -i -re 's/([a-z]{2}.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list RUN apt update -y -RUN apt install python python-dev python-setuptools python3 python3-pip python3-dev python3-setuptools python-capstone libssl-dev libffi-dev build-essential libc6:i386 libc6-dbg gcc-multilib make gcc netcat git curl wget gdb vim nano zsh ruby-full -y -RUN curl -O https://bootstrap.pypa.io/2.7/get-pip.py && python get-pip.py && rm get-pip.py +RUN apt install python python-dev python-setuptools python3 python3-pip python3-dev python3-setuptools python-capstone libssl-dev libffi-dev build-essential libc6:i386 libc6-dbg gcc-multilib make gcc netcat git curl wget gdb vim nano zsh ruby-full tmux -y +RUN curl -O https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py && rm get-pip.py RUN python -m pip install --upgrade pip && python3 -m pip install --upgrade pip -RUN python -m pip install --ignore-installed pwntools +RUN python -m pip install --ignore-installed pwntools && python3 -m pip install --ignore-installed pwntools RUN gem install one_gadget seccomp-tools RUN git clone https://github.com/pwndbg/pwndbg .pwndbg @@ -29,6 +29,8 @@ RUN git clone https://github.com/sindresorhus/pure .zsh/pure RUN git clone https://github.com/zdharma/fast-syntax-highlighting .zsh/fast-syntax-highlighting RUN echo "ZSH_THEME=""\\nsource /root/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh\\nfpath+=/root/.zsh/pure\\nautoload -U promptinit; promptinit\\nprompt pure" > .zshrc +RUN echo set -g mouse on > ~/.tmux.conf + RUN mkdir /pwn WORKDIR /pwn CMD [ "/bin/zsh" ] diff --git a/20.04/Dockerfile b/20.04/Dockerfile index 20e8234..1820ec4 100644 --- a/20.04/Dockerfile +++ b/20.04/Dockerfile @@ -6,10 +6,10 @@ ARG DEBIAN_FRONTEND=noninteractive RUN dpkg --add-architecture i386 RUN apt update -y -RUN apt install python python-dev python-setuptools python3 python3-pip python3-dev python3-setuptools python-capstone libssl-dev libffi-dev build-essential libc6-i386 libc6-dbg gcc-multilib make gcc netcat git curl wget gdb vim nano zsh ruby-full -y -RUN curl -O https://bootstrap.pypa.io/2.7/get-pip.py && python get-pip.py && rm get-pip.py +RUN apt install python python-dev python-setuptools python3 python3-pip python3-dev python3-setuptools python-capstone libssl-dev libffi-dev build-essential libc6-i386 libc6-dbg gcc-multilib make gcc netcat git curl wget gdb vim nano zsh ruby-full tmux -y +RUN curl -O https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py && rm get-pip.py RUN python -m pip install --upgrade pip && python3 -m pip install --upgrade pip -RUN python -m pip install --ignore-installed pwntools +RUN python -m pip install --ignore-installed pwntools && python3 -m pip install --ignore-installed pwntools RUN gem install one_gadget seccomp-tools RUN git clone https://github.com/pwndbg/pwndbg .pwndbg @@ -28,6 +28,8 @@ RUN git clone https://github.com/sindresorhus/pure .zsh/pure RUN git clone https://github.com/zdharma/fast-syntax-highlighting .zsh/fast-syntax-highlighting RUN echo "ZSH_THEME=""\\nsource /root/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh\\nfpath+=/root/.zsh/pure\\nautoload -U promptinit; promptinit\\nprompt pure" > .zshrc +RUN echo set -g mouse on > ~/.tmux.conf + RUN mkdir /pwn WORKDIR /pwn CMD [ "/bin/zsh" ] diff --git a/21.04/Dockerfile b/21.04/Dockerfile index cb8fe10..9c4e4e7 100644 --- a/21.04/Dockerfile +++ b/21.04/Dockerfile @@ -6,10 +6,12 @@ ARG DEBIAN_FRONTEND=noninteractive RUN dpkg --add-architecture i386 RUN apt update -y -RUN apt install python python-dev python-setuptools python3 python3-pip python3-dev python3-setuptools libssl-dev libffi-dev build-essential libc6-i386 libc6-dbg gcc-multilib make gcc netcat git curl wget gdb vim nano zsh ruby-full -y -RUN curl -O https://bootstrap.pypa.io/2.7/get-pip.py && python get-pip.py && rm get-pip.py +RUN apt-get update -y +RUN apt-get install glibc-source +RUN apt install python python-dev python-setuptools python3 python3-pip python3-dev python3-setuptools libssl-dev libffi-dev build-essential libc6-i386 libc6-dbg gcc-multilib make gcc netcat git curl wget gdb vim nano zsh ruby-full tmux -y +RUN curl -O https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py && rm get-pip.py RUN python -m pip install --upgrade pip && python3 -m pip install --upgrade pip -RUN python -m pip install --ignore-installed pwntools +RUN python -m pip install --ignore-installed pwntools && python3 -m pip install --ignore-installed pwntools RUN gem install one_gadget seccomp-tools RUN git clone https://github.com/pwndbg/pwndbg .pwndbg @@ -28,6 +30,8 @@ RUN git clone https://github.com/sindresorhus/pure .zsh/pure RUN git clone https://github.com/zdharma/fast-syntax-highlighting .zsh/fast-syntax-highlighting RUN echo "ZSH_THEME=""\\nsource /root/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh\\nfpath+=/root/.zsh/pure\\nautoload -U promptinit; promptinit\\nprompt pure" > .zshrc +RUN echo set -g mouse on > ~/.tmux.conf + RUN mkdir /pwn WORKDIR /pwn CMD [ "/bin/zsh" ] diff --git a/README.md b/README.md index b70f653..f0b477e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,41 @@ # pwn-docker + +### docker build image command + +```sh +cd pwn-docker/16.04 +docker build --tag pwn-docker:16.04 . + +cd pwn-docker/18.04 +docker build --tag pwn-docker:18.04 . + +cd pwn-docker/19.04 +docker build --tag pwn-docker:19.04 . + +cd pwn-docker/20.04 +docker build --tag pwn-docker:20.04 . + +cd pwn-docker/21.04 +docker build --tag pwn-docker:21.04 . +``` + +### docker run contianer command + +```sh + +docker run --rm -it -v $(pwd):/root/pwn --name ubuntu_16 pwn-docker:16.04 /bin/zsh + +``` + + +### docker alias in ~/.zshrc or ~/.bashrc + +```sh +export somewhere="/path/to/somewhere" +alias pwn16="docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --rm -it -v $somewhere:/pwn --name ubuntu_16 pwn-docker:16.04 /bin/zsh" +alias pwn18="docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --rm -it -v $somewhere:/pwn --name ubuntu_18 pwn-docker:18.04 /bin/zsh" +alias pwn19="docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --rm -it -v $somewhere:/pwn --name ubuntu_19 pwn-docker:19.04 /bin/zsh" +alias pwn20="docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --rm -it -v $somewhere:/pwn --name ubuntu_20 pwn-docker:20.04 /bin/zsh" +alias pwn21="docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --rm -it -v $somewhere:/pwn --name ubuntu_21 pwn-docker:21.04 /bin/zsh" +``` \ No newline at end of file