-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
215 lines (191 loc) · 5.7 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
FROM ubuntu:latest
MAINTAINER boogy <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
RUN dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get -yq install \
build-essential \
python2.7 \
python2.7-dev \
python-dbg \
python-imaging \
python-pycryptopp \
python-pyside \
python-dev \
python-dev \
python-pip \
python-virtualenv \
virtualenvwrapper \
python3 \
python3-pip \
python3-dev \
libqt4-dev \
libxml2-dev \
libxslt1-dev \
libgraphviz-dev \
libjpeg8 \
libjpeg62-dev \
libfreetype6 \
libfreetype6-dev \
apt-utils \
default-jre \
libboost-all-dev \
git \
sudo \
p7zip \
autoconf \
libssl-dev \
libpcap-dev \
libffi-dev \
libqt4-dev \
graphviz-dev \
cmake \
clang \
llvm \
nasm \
tmux \
gdb \
gdb-multiarch \
gdbserver \
foremost \
ipython \
stow \
virtualenvwrapper \
ltrace \
strace \
socat \
tcpdump \
john \
hydra \
vim \
curl \
wget \
nmap \
gcc-multilib \
g++-multilib \
netcat \
openssh-server \
openssh-client \
lsof \
libc6:i386 \
libncurses5:i386 \
libstdc++6:i386 \
libc6-dev-i386 \
squashfs-tools \
apktool \
libimage-exiftool-perl \
qemu \
qemu-user \
qemu-user-static
## super root password
RUN /bin/echo -e "toor\ntoor"|passwd root
## setup a user
RUN useradd -m -s /bin/bash ctf \
&& usermod -aG sudo ctf \
&& /bin/echo -e "ctf\nctf"|passwd ctf \
&& chmod 4750 /home/ctf \
&& mkdir -p /home/ctf/tools \
&& chown -R ctf: /home/ctf \
&& mkdir -p /etc/sudoers.d \
&& echo "ctf ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ctf \
&& echo "kernel.yama.ptrace_scope = 0" > /etc/sysctl.d/10-ptrace.conf, \
&& sysctl -p
## clone my dotfiles
RUN git clone https://github.com/boogy/dotfiles.git /home/ctf/dotfiles
## Other python cool pip modules
RUN pip2 install --upgrade pip \
&& pip2 install --upgrade r2pipe \
&& pip2 install --upgrade Pillow \
&& pip2 install --upgrade distorm3 \
&& pip2 install --upgrade pycrypto \
&& pip2 install --upgrade git+https://github.com/hellman/xortool.git
## Install Binjitsu
RUN pip install --upgrade git+https://github.com/Gallopsled/pwntools.git
## Install peda
RUN git clone https://github.com/longld/peda.git /home/ctf/tools/peda \
&& echo -en "define load_peda\n source /home/ctf/tools/peda/peda.py\nend\n" >> /home/ctf/.gdbinit
## Install pwndbg
RUN git clone https://github.com/zachriggle/pwndbg /home/ctf/tools/pwndbg \
&& echo -en "\ndefine load_pwndbg\n source /home/ctf/tools/pwndbg/gdbinit.py\nend\n" >> /home/ctf/.gdbinit \
&& pip3 install pycparser
## Install capstone
RUN git clone https://github.com/aquynh/capstone /home/ctf/tools/capstone \
&& cd /home/ctf/tools/capstone \
&& ./make.sh \
&& ./make.sh install \
&& cd /home/ctf/tools/capstone/bindings/python \
&& python3 setup.py install \
&& python2 setup.py install
## Install radare2
RUN git clone https://github.com/radare/radare2 /home/ctf/tools/radare2 \
&& cd /home/ctf/tools/radare2 \
&& ./sys/install.sh
## Install binwalk
RUN git clone https://github.com/devttys0/binwalk /home/ctf/tools/binwalk \
&& cd /home/ctf/tools/binwalk \
&& python setup.py install
## Uninstall capstone for python2
#RUN pip2 uninstall capstone -y \
# && cd /home/ctf/tools/capstone/bindings/python \
# && python3 setup.py install
## Install american-fuzzy-lop
RUN wget --quiet http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz -O /home/ctf/tools/afl-latest.tgz \
&& cd /home/ctf/tools/ \
&& tar -xzvf afl-latest.tgz \
&& rm afl-latest.tgz \
&& (cd afl-*;make;(cd llvm_mode;make);make install)
## Install angr
#RUN git clone https://github.com/angr/angr-dev /home/ctf/tools/angr-dev \
# && cd /home/ctf/tools/angr-dev \
# && ./setup.sh -i -e angr
RUN pip2 install angr
# RUN git clone https://github.com/angr/angr-dev /home/ctf/tools/angr-dev \
# && cd /home/ctf/tools/angr-dev \
# && . /usr/local/bin/virtualenvwrapper.sh \
# && mkvirtualenv angr \
# && echo "I know this is a bad idea."|./setup.sh -i \
# && deactivate
# # && ./setup.sh -i -e angr
## Install rp++
RUN apt-get install -yq clang-3.5 \
&& export CC=/usr/bin/clang-3.5 \
&& export CXX=/usr/bin/clang++-3.5 \
&& cd /home/ctf/tools \
&& git clone https://github.com/0vercl0k/rp.git \
&& cd rp \
&& git checkout next \
&& git submodule update --init --recursive \
&& sed -i 's/find_package(Boost 1.59.0 COMPONENTS flyweight)/find_package(Boost)/g' CMakeLists.txt \
&& mkdir build \
&& cd build \
&& cmake ../ \
&& make \
&& cp ../bin/rp-lin-x64 /usr/local/bin/
## Install ROPGadget
RUN git clone https://github.com/JonathanSalwan/ROPgadget /home/ctf/tools/ROPgadget \
&& cd /home/ctf/tools/ROPgadget \
&& python setup.py install
## Install Z3 Prover
RUN git clone https://github.com/Z3Prover/z3.git /home/ctf/tools/z3 \
&& cd /home/ctf/tools/z3 \
&& python scripts/mk_make.py --python \
&& cd build \
&& make install
## Install keystone engine
RUN git clone https://github.com/keystone-engine/keystone.git /home/ctf/tools/keystone \
&& cd /home/ctf/tools/keystone \
&& mkdir build \
&& cd build \
&& ../make-share.sh \
&& make install \
&& ldconfig \
&& cd /home/ctf/tools/keystone/bindings/python \
&& make install
## Install manticore
#RUN git clone --depth 1 https://github.com/trailofbits/manticore.git \
# && cd manticore \
# && pip install --no-binary capstone .
EXPOSE 22 1337 3002 3003 4000
USER ctf
WORKDIR /home/ctf
CMD ["/bin/bash", "-i"]