diff --git a/README.md b/README.md index 9efb702..ef3e015 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ Ancypwn is now plugin based, choose your own plugin or write a new plugin if you You will need at least 4 parts to have a working environment (apart from docker). -0. A ancypwn docker image, and is properly tagged as ancypwn:VERSION, VERSION is one of "16.04", "18.04" or "18.10", each represent a corresponding ubuntu version. -1. ancypwn launcher (`pip install ancypwn`) +0. A ancypwn docker image, and is properly tagged as ancypwn:VERSION, VERSION is one of "16.04", "18.04", "20.04" or "18.10", each represent a corresponding ubuntu version. +1. ancypwn launcher (`pip3 install ancypwn`) 2. a backend: backend provides ability to listen incoming request to pop up a terminal window, then asks terminal plugin to do it and does different docker container launching strategy (like remote support). 3. a terminal plugin: this one handles terminal poping up @@ -36,13 +36,11 @@ Backends have the name pattern: `ancypwn-backend-*`, while terminal plugin has t So you need: ``` -# download images, and tag them properly -docker pull auxy233/ancypwn:16.04 -docker pull auxy233/ancypwn:18.04 -docker pull auxy233/ancypwn:18.10 -docker image tag auxy233/ancypwn:16.04 ancypwn:16.04 -docker image tag auxy233/ancypwn:18.04 ancypwn:18.04 -docker image tag auxy233/ancypwn:18.10 ancypwn:18.10 +# build images +docker build -t ancypwn:20.04 . +docker build -t ancypwn:18.04 . +docker build -t ancypwn:18.10 . +docker build -t ancypwn:16.04 . pip3 install ancypwn # pip3 install ancypwn-backend-* (choose your backend, and install it) @@ -156,3 +154,4 @@ Current supported ubuntu version: * 18.10 * 18.04 * 16.04 +* 20.04 diff --git a/ancypwn-backend-unix b/ancypwn-backend-unix new file mode 160000 index 0000000..f0a7ad5 --- /dev/null +++ b/ancypwn-backend-unix @@ -0,0 +1 @@ +Subproject commit f0a7ad5f0c6af66500dbcbad2593a3028fa36382 diff --git a/ancypwn-docker/16.04/Dockerfile b/ancypwn-docker/16.04/Dockerfile index 5228725..700f4c0 100644 --- a/ancypwn-docker/16.04/Dockerfile +++ b/ancypwn-docker/16.04/Dockerfile @@ -1,49 +1,67 @@ -FROM ubuntu:16.04 - -MAINTAINER Anciety - -# Apt packages -RUN dpkg --add-architecture i386 && apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -qy \ - git nasm python \ - build-essential \ - python-dev python-pip python-setuptools \ - libc6-dbg \ - libc6-dbg:i386 \ - gcc-multilib \ - gdb-multiarch \ - gcc \ - wget \ - curl \ - glibc-source \ - cmake \ - python-capstone \ - socat \ - netcat \ - ruby \ - ruby-dev \ - lxterminal && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ - cd ~ && tar -xvf /usr/src/glibc/glibc-2.23.tar.xz - -# python/ruby packages & gdb-plugin -RUN pip install --no-cache-dir pwntools ropper ancypatch && \ - gem install one_gadget seccomp-tools && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# git installaing package -RUN cd ~/ && \ - git clone https://github.com/pwndbg/pwndbg.git && \ - cd ~/pwndbg/ && ./setup.sh && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -ENV LANG C.UTF-8 - -COPY ./ancyterm.py /usr/local/bin/ancyterm -RUN chmod +x /usr/local/bin/ancyterm - -VOLUME ["/pwn"] -WORKDIR /pwn - -CMD ["/bin/bash"] +FROM ubuntu:16.04 + +MAINTAINER Anciety + +# Apt packages +RUN dpkg --add-architecture i386 && \ + apt-get update && \ + apt-get -y install python-software-properties \ + software-properties-common && \ + add-apt-repository ppa:brightbox/ruby-ng && \ + apt-get update && \ + apt-get purge --auto-remove ruby && \ + DEBIAN_FRONTEND=noninteractive apt-get install -qy \ + git nasm python3 \ + build-essential \ + python3-dev python3-pip python3-setuptools\ + libc6-dbg \ + libc6-dbg:i386 \ + gcc-multilib \ + gdb-multiarch \ + gcc \ + sudo \ + wget \ + curl \ + glibc-source \ + cmake \ + socat \ + netcat \ + ruby2.6 \ + ruby2.6-dev \ + lxterminal && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ + cd ~ && tar -xvf /usr/src/glibc/glibc-2.23.tar.xz + +# python/ruby packages & gdb-plugin +#RUN wget https://files.pythonhosted.org/packages/cd/82/04e9aaf603fdbaecb4323b9e723f13c92c245f6ab2902195c53987848c78/pip-21.1.2-py3-none-any.whl && \ +#RUN pip3 install pip-21.1.2-py3-none-any.whl && \ +RUN wget https://bootstrap.pypa.io/pip/3.5/get-pip.py && \ + python3 get-pip.py && \ +# pip3 install --upgrade pip && \ + pip3 install --no-cache-dir pwntools ropper ancypatch LibcSearcher&& \ + gem install one_gadget seccomp-tools && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# git installaing package +RUN cd ~/ && \ + git clone https://github.com/pwndbg/pwndbg.git && \ + cd ~/pwndbg/ && ./setup.sh && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN cd ~/ && \ + git clone https://github.com/scwuaptx/Pwngdb.git && \ + cp ~/Pwngdb/.gdbinit ~/ && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ + sed -i '1d' ~/.gdbinit && \ + sed -i '1c source ~/pwndbg/gdbinit.py' ~/.gdbinit + +ENV LANG C.UTF-8 + +COPY ./ancyterm.py /usr/local/bin/ancyterm +RUN chmod +x /usr/local/bin/ancyterm + +VOLUME ["/pwn"] +WORKDIR /pwn + +CMD ["/bin/bash"] diff --git a/ancypwn-docker/18.04/Dockerfile b/ancypwn-docker/18.04/Dockerfile index 072c315..1221cd0 100644 --- a/ancypwn-docker/18.04/Dockerfile +++ b/ancypwn-docker/18.04/Dockerfile @@ -1,50 +1,61 @@ -FROM ubuntu:18.04 - -MAINTAINER Anciety - - -# Apt packages -RUN dpkg --add-architecture i386 && apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -qy \ - git nasm python \ - build-essential \ - python-dev python-pip python-setuptools \ - libc6-dbg \ - libc6-dbg:i386 \ - gcc-multilib \ - gdb-multiarch \ - gcc \ - wget \ - curl \ - glibc-source \ - cmake \ - python-capstone \ - socat \ - netcat \ - ruby \ - ruby-dev \ - lxterminal && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ - cd ~ && tar -xvf /usr/src/glibc/glib*.tar.xz - -# python/ruby packages & gdb-plugin -RUN pip install --no-cache-dir pwntools ropper ancypatch && \ - gem install one_gadget seccomp-tools && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# git installaing package -RUN cd ~/ && \ - git clone https://github.com/pwndbg/pwndbg.git && \ - cd ~/pwndbg/ && ./setup.sh && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -ENV LANG C.UTF-8 - -COPY ./ancyterm.py /usr/local/bin/ancyterm -RUN chmod +x /usr/local/bin/ancyterm - -VOLUME ["/pwn"] -WORKDIR /pwn - -CMD ["/bin/bash"] +FROM ubuntu:18.04 + +MAINTAINER Anciety + + +# Apt packages +RUN dpkg --add-architecture i386 && \ + apt-get update && \ + apt-get -y install sudo wget cmake curl gcc socat\ + software-properties-common && \ + wget http://archive.ubuntu.com/ubuntu/pool/main/k/keyutils/libkeyutils1_1.5.9-9.2ubuntu2_amd64.deb && \ + dpkg -i libkeyutils1_1.5.9-9.2ubuntu2_amd64.deb && \ + add-apt-repository ppa:brightbox/ruby-ng && \ + apt-get update && \ + apt-get purge --auto-remove ruby && \ + DEBIAN_FRONTEND=noninteractive apt-get install -qy \ + git nasm python3 \ + build-essential \ + python3-dev python3-pip python3-setuptools \ + libc6-dbg \ + libc6-dbg:i386 \ + gcc-multilib \ + gdb-multiarch \ + glibc-source \ + netcat \ + ruby2.6 \ + ruby2.6-dev \ + lxterminal && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ + cd ~ && tar -xvf /usr/src/glibc/glib*.tar.xz + +# python/ruby packages & gdb-plugin +RUN wget https://bootstrap.pypa.io/pip/3.5/get-pip.py && \ + python3 get-pip.py && \ + pip install --no-cache-dir LibcSearcher pwntools ropper ancypatch && \ + gem install one_gadget seccomp-tools && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# git installaing package +RUN cd ~/ && \ + git clone https://github.com/pwndbg/pwndbg.git && \ + cd ~/pwndbg/ && ./setup.sh && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN cd ~/ && \ + git clone https://github.com/scwuaptx/Pwngdb.git && \ + cp ~/Pwngdb/.gdbinit ~/ && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ + sed -i '1d' ~/.gdbinit && \ + sed -i '1c source ~/pwndbg/gdbinit.py' ~/.gdbinit* + +ENV LANG C.UTF-8 + +COPY ./ancyterm.py /usr/local/bin/ancyterm +RUN chmod +x /usr/local/bin/ancyterm + +VOLUME ["/pwn"] +WORKDIR /pwn + +CMD ["/bin/bash"] diff --git a/ancypwn-docker/18.10/Dockerfile b/ancypwn-docker/18.10/Dockerfile index 6af97e6..1e5d3e9 100644 --- a/ancypwn-docker/18.10/Dockerfile +++ b/ancypwn-docker/18.10/Dockerfile @@ -1,49 +1,49 @@ -FROM ubuntu:18.10 - -MAINTAINER Anciety - -# Apt packages -RUN dpkg --add-architecture i386 && apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install -qy \ - git nasm python \ - build-essential \ - python-dev python-pip python-setuptools \ - libc6-dbg \ - libc6-dbg:i386 \ - gcc-multilib \ - gdb-multiarch \ - gcc \ - wget \ - curl \ - glibc-source \ - cmake \ - python-capstone \ - socat \ - netcat \ - ruby \ - ruby-dev \ - lxterminal && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ - cd ~ && tar -xvf /usr/src/glibc/glibc-*.tar.xz - -# python/ruby packages & gdb-plugin -RUN pip install --no-cache-dir pwntools ropper ancypatch && \ - gem install one_gadget seccomp-tools && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# git installaing package -RUN cd ~/ && \ - git clone https://github.com/pwndbg/pwndbg.git && \ - cd ~/pwndbg/ && ./setup.sh && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -ENV LANG C.UTF-8 - -COPY ./ancyterm.py /usr/local/bin/ancyterm -RUN chmod +x /usr/local/bin/ancyterm - -VOLUME ["/pwn"] -WORKDIR /pwn - -CMD ["/bin/bash"] +FROM ubuntu:18.10 + +MAINTAINER Anciety + +# Apt packages +RUN dpkg --add-architecture i386 && apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -qy \ + git nasm python \ + build-essential \ + python-dev python-pip python-setuptools \ + libc6-dbg \ + libc6-dbg:i386 \ + gcc-multilib \ + gdb-multiarch \ + gcc \ + wget \ + curl \ + glibc-source \ + cmake \ + python-capstone \ + socat \ + netcat \ + ruby \ + ruby-dev \ + lxterminal && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ + cd ~ && tar -xvf /usr/src/glibc/glibc-*.tar.xz + +# python/ruby packages & gdb-plugin +RUN pip install --no-cache-dir pwntools ropper ancypatch && \ + gem install one_gadget seccomp-tools && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# git installaing package +RUN cd ~/ && \ + git clone https://github.com/pwndbg/pwndbg.git && \ + cd ~/pwndbg/ && ./setup.sh && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +ENV LANG C.UTF-8 + +COPY ./ancyterm.py /usr/local/bin/ancyterm +RUN chmod +x /usr/local/bin/ancyterm + +VOLUME ["/pwn"] +WORKDIR /pwn + +CMD ["/bin/bash"] diff --git a/ancypwn-docker/20.04/Dockerfile b/ancypwn-docker/20.04/Dockerfile new file mode 100644 index 0000000..05a613e --- /dev/null +++ b/ancypwn-docker/20.04/Dockerfile @@ -0,0 +1,63 @@ +FROM ubuntu:20.04 + +MAINTAINER xibai + +# Apt packages +RUN dpkg --add-architecture i386 && apt-get update && \ + apt-get -y install software-properties-common && \ + add-apt-repository ppa:brightbox/ruby-ng && \ + add-apt-repository ppa:deadsnakes/ppa && \ + apt-get update && \ + apt-get purge --auto-remove ruby && \ + DEBIAN_FRONTEND=noninteractive apt-get install -qy \ + git nasm python3 \ + build-essential fakeroot dpkg-dev libcurl4-openssl-dev\ + python3-dev python3-pip python3-setuptools \ + libc6-dbg \ + libc6-dbg:i386 \ + gcc-multilib \ + gdb-multiarch \ + gcc \ + wget \ + curl \ + glibc-source \ + cmake \ + socat \ + sudo \ + netcat \ + ruby2.6 \ + ruby2.6-dev \ + lxterminal && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ + cd ~ && tar -xvf /usr/src/glibc/glib*.tar.xz + +# python/ruby packages & gdb-plugin +RUN wget https://bootstrap.pypa.io/pip/get-pip.py && \ + python3 get-pip.py && \ + pip3 install --no-cache-dir pwntools ropper ancypatch && \ + gem install one_gadget seccomp-tools && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# git installaing package +RUN cd ~/ && \ + git clone https://github.com/pwndbg/pwndbg.git && \ + cd ~/pwndbg/ && ./setup.sh && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN cd ~/ && \ + git clone https://github.com/scwuaptx/Pwngdb.git && \ + cp ~/Pwngdb/.gdbinit ~/ && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ + sed -i '1d' ~/.gdbinit && \ + sed -i '1c source ~/pwndbg/gdbinit.py' ~/.gdbinit + +ENV LANG C.UTF-8 + +COPY ./ancyterm.py /usr/local/bin/ancyterm +RUN chmod +x /usr/local/bin/ancyterm + +VOLUME ["/pwn"] +WORKDIR /pwn + +CMD ["/bin/bash"] diff --git a/ancypwn-terminal-iterm2 b/ancypwn-terminal-iterm2 new file mode 160000 index 0000000..0b14058 --- /dev/null +++ b/ancypwn-terminal-iterm2 @@ -0,0 +1 @@ +Subproject commit 0b14058199862705e850e71007eb7be0f59e9655 diff --git a/ancypwn-terminal/ancyterm.py b/ancypwn-terminal/ancyterm.py index 99b06e8..168e22d 100755 --- a/ancypwn-terminal/ancyterm.py +++ b/ancypwn-terminal/ancyterm.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# -*- coding: UTF-8 -*- import argparse import json @@ -10,32 +11,28 @@ def pack(num): return struct.pack('