Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit Dockerfile && Add content to README.md #2

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions 16.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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" ]
8 changes: 5 additions & 3 deletions 18.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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" ]
8 changes: 5 additions & 3 deletions 19.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" ]
8 changes: 5 additions & 3 deletions 20.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" ]
10 changes: 7 additions & 3 deletions 21.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" ]
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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"
```