From 96eca66f6b3ba87364f43ec9fc836087e6e984ea Mon Sep 17 00:00:00 2001 From: ferb300 <59286548+ferb300@users.noreply.github.com> Date: Thu, 25 Mar 2021 21:29:59 +0100 Subject: [PATCH 1/9] Update Dockerfile --- ctf/Dockerfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ctf/Dockerfile b/ctf/Dockerfile index f9f7809..7fb2731 100644 --- a/ctf/Dockerfile +++ b/ctf/Dockerfile @@ -1,21 +1,19 @@ # docker build -t ctf:ubuntu19.10 . # If using Windows # docker run --rm -v %cd%:/pwd --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -d --name ctf -i ctf:ubuntu19.10 -# If using Linux +# If using Linux/macOS # docker run --rm -v $PWD:/pwd --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -d --name ctf -i ctf:ubuntu19.10 # docker exec -it ctf /bin/bash -FROM ubuntu:19.10 +FROM ubuntu:20.04 ENV LC_CTYPE C.UTF-8 ENV DEBIAN_FRONTEND=noninteractive RUN dpkg --add-architecture i386 && \ apt-get update && \ -apt-get install -y build-essential jq strace ltrace curl wget rubygems gcc dnsutils netcat gcc-multilib net-tools vim gdb gdb-multiarch python python3 python3-pip python3-dev libssl-dev libffi-dev wget git make procps libpcre3-dev libdb-dev libxt-dev libxaw7-dev python-pip libc6:i386 libncurses5:i386 libstdc++6:i386 && \ -pip install capstone requests pwntools r2pipe && \ +apt-get install -y build-essential jq strace ltrace curl wget rubygems gcc dnsutils netcat gcc-multilib net-tools vim gdb gdb-multiarch python python3 python3-pip python3-dev libssl-dev libffi-dev wget git make procps libpcre3-dev libdb-dev libxt-dev libxaw7-dev libc6:i386 libncurses5:i386 libstdc++6:i386 && \ +pip3 install capstone requests pwntools r2pipe && \ pip3 install pwntools keystone-engine unicorn capstone ropper && \ mkdir tools && cd tools && \ git clone https://github.com/JonathanSalwan/ROPgadget && \ git clone https://github.com/radare/radare2 && cd radare2 && sys/install.sh && \ -cd .. && git clone https://github.com/pwndbg/pwndbg && cd pwndbg && git checkout stable && ./setup.sh && \ -cd .. && git clone https://github.com/niklasb/libc-database && cd libc-database && ./get && \ gem install one_gadget From 1f435038751a515792ba67b31caf557b1e5769f8 Mon Sep 17 00:00:00 2001 From: ferb300 <59286548+ferb300@users.noreply.github.com> Date: Sat, 27 Mar 2021 02:21:26 +0100 Subject: [PATCH 2/9] Update Dockerfile --- ctf/Dockerfile | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/ctf/Dockerfile b/ctf/Dockerfile index 7fb2731..3eda801 100644 --- a/ctf/Dockerfile +++ b/ctf/Dockerfile @@ -1,19 +1,41 @@ # docker build -t ctf:ubuntu19.10 . # If using Windows # docker run --rm -v %cd%:/pwd --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -d --name ctf -i ctf:ubuntu19.10 -# If using Linux/macOS +# If using Linux # docker run --rm -v $PWD:/pwd --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -d --name ctf -i ctf:ubuntu19.10 # docker exec -it ctf /bin/bash -FROM ubuntu:20.04 +FROM ubuntu:19.10 ENV LC_CTYPE C.UTF-8 ENV DEBIAN_FRONTEND=noninteractive -RUN dpkg --add-architecture i386 && \ -apt-get update && \ -apt-get install -y build-essential jq strace ltrace curl wget rubygems gcc dnsutils netcat gcc-multilib net-tools vim gdb gdb-multiarch python python3 python3-pip python3-dev libssl-dev libffi-dev wget git make procps libpcre3-dev libdb-dev libxt-dev libxaw7-dev libc6:i386 libncurses5:i386 libstdc++6:i386 && \ -pip3 install capstone requests pwntools r2pipe && \ -pip3 install pwntools keystone-engine unicorn capstone ropper && \ -mkdir tools && cd tools && \ +RUN dpkg --add-architecture i386 + +# Configure apt-get with ubuntu archive repo +RUN rm /etc/apt/sources.list +COPY sources.list /etc/apt/ +RUN apt-get update + +# install sudo command (needed by pwndbg setup script :/) +RUN apt-get install -y sudo + +# Install basic pwning tools via apt-get +RUN apt-get install -y build-essential jq strace ltrace curl wget rubygems gcc dnsutils netcat gcc-multilib net-tools vim gdb gdb-multiarch python python3 python3-pip python3-dev libssl-dev libffi-dev wget git make procps libpcre3-dev libdb-dev libxt-dev libxaw7-dev python-pip libc6:i386 libncurses5:i386 libstdc++6:i386 + +# Install basic pwning tools via pipy +RUN pip install capstone requests pwntools r2pipe +RUN pip3 install pwntools keystone-engine unicorn capstone ropper + +# Install pwndbg +RUN git clone https://github.com/pwndbg/pwndbg +RUN cd pwndbg && git checkout stable && ./setup.sh + +# Install radare2 and ROPgadget into dedicated tools directory +RUN mkdir tools && \ +cd tools && \ git clone https://github.com/JonathanSalwan/ROPgadget && \ -git clone https://github.com/radare/radare2 && cd radare2 && sys/install.sh && \ -gem install one_gadget +git clone https://github.com/radare/radare2 && \ +cd radare2 && \ +sys/install.sh + +# Install one_gadget +RUN gem install one_gadget From cfd665b924bf4ce043db41704264672b68c1c964 Mon Sep 17 00:00:00 2001 From: ferb300 <59286548+ferb300@users.noreply.github.com> Date: Sat, 27 Mar 2021 02:21:53 +0100 Subject: [PATCH 3/9] Create sources.list --- ctf/sources.list | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 ctf/sources.list diff --git a/ctf/sources.list b/ctf/sources.list new file mode 100644 index 0000000..0f1a8a7 --- /dev/null +++ b/ctf/sources.list @@ -0,0 +1,51 @@ +# deb cdrom:[Ubuntu 19.10 _Eoan Ermine_ - Release amd64 (20191017)]/ eoan main restricted + +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb http://old-releases.ubuntu.com/ubuntu eoan main restricted +# deb-src http://id.archive.ubuntu.com/ubuntu/ eoan main restricted + +## Major bug fix updates produced after the final release of the +## distribution. +deb http://old-releases.ubuntu.com/ubuntu eoan-updates main restricted +# deb-src http://id.archive.ubuntu.com/ubuntu/ eoan-updates main restricted + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +deb http://old-releases.ubuntu.com/ubuntu eoan universe +# deb-src http://id.archive.ubuntu.com/ubuntu/ eoan universe +deb http://old-releases.ubuntu.com/ubuntu eoan-updates universe +# deb-src http://id.archive.ubuntu.com/ubuntu/ eoan-updates universe + +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://old-releases.ubuntu.com/ubuntu eoan multiverse +# deb-src http://id.archive.ubuntu.com/ubuntu/ eoan multiverse +deb http://old-releases.ubuntu.com/ubuntu eoan-updates multiverse +# deb-src http://id.archive.ubuntu.com/ubuntu/ eoan-updates multiverse + +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://old-releases.ubuntu.com/ubuntu eoan-backports main restricted universe multiverse +# deb-src http://id.archive.ubuntu.com/ubuntu/ eoan-backports main restricted universe multiverse + +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu eoan partner +# deb-src http://archive.canonical.com/ubuntu eoan partner + +deb http://old-releases.ubuntu.com/ubuntu eoan-security main restricted +# deb-src http://security.ubuntu.com/ubuntu eoan-security main restricted +deb http://old-releases.ubuntu.com/ubuntu eoan-security universe +# deb-src http://security.ubuntu.com/ubuntu eoan-security universe +deb http://old-releases.ubuntu.com/ubuntu eoan-security multiverse +# deb-src http://security.ubuntu.com/ubuntu eoan-security multiverse From ac0712ef2295592d407efa2db48fefef66036c59 Mon Sep 17 00:00:00 2001 From: ferb300 <59286548+ferb300@users.noreply.github.com> Date: Thu, 1 Apr 2021 14:30:14 +0200 Subject: [PATCH 4/9] Update Dockerfile --- ctf/Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ctf/Dockerfile b/ctf/Dockerfile index 3eda801..88d6f0b 100644 --- a/ctf/Dockerfile +++ b/ctf/Dockerfile @@ -18,8 +18,8 @@ RUN apt-get update # install sudo command (needed by pwndbg setup script :/) RUN apt-get install -y sudo -# Install basic pwning tools via apt-get -RUN apt-get install -y build-essential jq strace ltrace curl wget rubygems gcc dnsutils netcat gcc-multilib net-tools vim gdb gdb-multiarch python python3 python3-pip python3-dev libssl-dev libffi-dev wget git make procps libpcre3-dev libdb-dev libxt-dev libxaw7-dev python-pip libc6:i386 libncurses5:i386 libstdc++6:i386 +# Install basic tools and dependencies via apt-get +RUN apt-get install -y build-essential jq strace ltrace curl wget rubygems gcc dnsutils netcat gcc-multilib net-tools vim gdb gdb-multiarch python python3 python3-pip python3-dev libssl-dev libffi-dev wget git make procps libpcre3-dev libdb-dev libxt-dev libxaw7-dev python-pip libc6:i386 libncurses5:i386 libstdc++6:i386 make libreadline-dev libgc-dev gettext libjson-c-dev libtool flex bison pkg-config texinfo autopoint help2man gawk pwgen socat # Install basic pwning tools via pipy RUN pip install capstone requests pwntools r2pipe @@ -37,5 +37,15 @@ git clone https://github.com/radare/radare2 && \ cd radare2 && \ sys/install.sh +# Install map + cat +RUN sudo apt-get install -y nmap ncat + +# Install poke +RUN wget https://ftp.gnu.org/gnu/poke/poke-1.1.tar.gz && tar xf poke-1.1.tar.gz +WORKDIR /poke-1.1 +RUN sed -i 's#glob (fname,#/* disarm glob :^) */ 1 || glob (fname,#' poke/pk-cmd.c +RUN sed -i '61a return 1; /* disarm pk_cmd_doc :^) */' poke/pk-cmd-misc.c +RUN mkdir build && cd build && ../configure --prefix=/usr CFLAGS="-g -static" && make -j$(nproc) && make install + # Install one_gadget RUN gem install one_gadget From 6eb32071785249d06cd10f23fe9e1a6099407d8c Mon Sep 17 00:00:00 2001 From: ferb300 <59286548+ferb300@users.noreply.github.com> Date: Thu, 1 Apr 2021 22:47:18 +0200 Subject: [PATCH 5/9] Update Dockerfile --- ctf/Dockerfile | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/ctf/Dockerfile b/ctf/Dockerfile index 88d6f0b..3da1766 100644 --- a/ctf/Dockerfile +++ b/ctf/Dockerfile @@ -19,7 +19,7 @@ RUN apt-get update RUN apt-get install -y sudo # Install basic tools and dependencies via apt-get -RUN apt-get install -y build-essential jq strace ltrace curl wget rubygems gcc dnsutils netcat gcc-multilib net-tools vim gdb gdb-multiarch python python3 python3-pip python3-dev libssl-dev libffi-dev wget git make procps libpcre3-dev libdb-dev libxt-dev libxaw7-dev python-pip libc6:i386 libncurses5:i386 libstdc++6:i386 make libreadline-dev libgc-dev gettext libjson-c-dev libtool flex bison pkg-config texinfo autopoint help2man gawk pwgen socat +RUN apt-get install -y build-essential nmap ncat jq strace ltrace curl wget rubygems gcc dnsutils netcat gcc-multilib net-tools vim gdb gdb-multiarch python python3 python3-pip python3-dev libssl-dev libffi-dev wget git make procps libpcre3-dev libdb-dev libxt-dev libxaw7-dev python-pip libc6:i386 libncurses5:i386 libstdc++6:i386 make libreadline-dev libgc-dev gettext libjson-c-dev libtool flex bison pkg-config texinfo autopoint help2man gawk pwgen socat # Install basic pwning tools via pipy RUN pip install capstone requests pwntools r2pipe @@ -37,15 +37,5 @@ git clone https://github.com/radare/radare2 && \ cd radare2 && \ sys/install.sh -# Install map + cat -RUN sudo apt-get install -y nmap ncat - -# Install poke -RUN wget https://ftp.gnu.org/gnu/poke/poke-1.1.tar.gz && tar xf poke-1.1.tar.gz -WORKDIR /poke-1.1 -RUN sed -i 's#glob (fname,#/* disarm glob :^) */ 1 || glob (fname,#' poke/pk-cmd.c -RUN sed -i '61a return 1; /* disarm pk_cmd_doc :^) */' poke/pk-cmd-misc.c -RUN mkdir build && cd build && ../configure --prefix=/usr CFLAGS="-g -static" && make -j$(nproc) && make install - # Install one_gadget RUN gem install one_gadget From cb650ddd70d930674411ceea147c339cc64449ea Mon Sep 17 00:00:00 2001 From: Moritz <59286548+ferb300@users.noreply.github.com> Date: Tue, 8 Mar 2022 11:31:53 +0100 Subject: [PATCH 6/9] Create basic_setup.sh --- basic_setup.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 basic_setup.sh diff --git a/basic_setup.sh b/basic_setup.sh new file mode 100644 index 0000000..369338b --- /dev/null +++ b/basic_setup.sh @@ -0,0 +1,7 @@ +apt-get upgrade -y +apt-get install vim gdb -y +git clone https://github.com/pwndbg/pwndbg +cd pwndbg +./setup.sh +cd .. +apt-get install gem -y From 44399ad779c6736932b0a538038e2e3981d8ed26 Mon Sep 17 00:00:00 2001 From: Moritz <59286548+ferb300@users.noreply.github.com> Date: Tue, 8 Mar 2022 11:32:15 +0100 Subject: [PATCH 7/9] Update basic_setup.sh --- basic_setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/basic_setup.sh b/basic_setup.sh index 369338b..332453a 100644 --- a/basic_setup.sh +++ b/basic_setup.sh @@ -5,3 +5,4 @@ cd pwndbg ./setup.sh cd .. apt-get install gem -y +gem install one_gadget From c7b0f4921beed0bce90caff226103ed26127395b Mon Sep 17 00:00:00 2001 From: Moritz <59286548+ferb300@users.noreply.github.com> Date: Tue, 8 Mar 2022 12:51:26 +0100 Subject: [PATCH 8/9] Update basic_setup.sh --- basic_setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basic_setup.sh b/basic_setup.sh index 332453a..aaa0df5 100644 --- a/basic_setup.sh +++ b/basic_setup.sh @@ -4,5 +4,5 @@ git clone https://github.com/pwndbg/pwndbg cd pwndbg ./setup.sh cd .. -apt-get install gem -y +apt-get install rubygems -y gem install one_gadget From 9e911a372a84fc3e5bfe1884ad7666580c841f67 Mon Sep 17 00:00:00 2001 From: Moritz <59286548+ferb300@users.noreply.github.com> Date: Tue, 8 Mar 2022 16:01:03 +0100 Subject: [PATCH 9/9] Update basic_setup.sh --- basic_setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basic_setup.sh b/basic_setup.sh index aaa0df5..9704d8a 100644 --- a/basic_setup.sh +++ b/basic_setup.sh @@ -1,5 +1,5 @@ apt-get upgrade -y -apt-get install vim gdb -y +apt-get install vim gdb git -y git clone https://github.com/pwndbg/pwndbg cd pwndbg ./setup.sh