-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.c2
130 lines (106 loc) · 4.58 KB
/
Dockerfile.c2
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
#FROM alxchk/pupy:unstable as pupy
FROM brimstone/kali:latest
RUN apt update \
&& apt install -y --no-install-recommends \
postgresql xtightvncviewer unzip impacket-scripts \
&& apt clean \
&& rm -rf /var/lib/apt/lists \
&& mkdir /export
# Empire
RUN apt update \
&& apt install -y --no-install-recommends \
powershell-empire powershell python3-tk \
&& apt clean \
&& rm -rf /var/lib/apt/lists
# pupy
#RUN apt update \
# && apt install -y --no-install-recommends \
# python-dev python-setuptools swig unzip \
# && apt clean \
# && rm -rf /var/lib/apt/lists \
# && git clone --recursive https://github.com/n1nj4sec/pupy /pentest/pupy \
# && rm -rf /pentest/pupy/.git \
# && cd /pentest/pupy/pupy \
# && python2 -m easy_install pip \
# && pip install wheel \
# && pip install -r requirements.txt \
# && sed -i 's/ssl = 443/ssl = 8443/' /pentest/pupy/pupy/pupy.conf.default \
# && sed -i '/aliases/agenb = gen -O linux -A x64 -f client -o /pentest/share/p connect -t ssl --host' /pentest/pupy/pupy/pupy.conf.default \
# && sed -i '/aliases/agenso = gen -O linux -A x64 -f client -o /pentest/share/p.so -S connect -t ssl --host' /pentest/pupy/pupy/pupy.conf.default \
# && mkdir -p /root/.config/pupy/crypto && ln -s /export/credentials.py /root/.config/pupy/crypto
## && wget https://github.com/n1nj4sec/pupy/releases/download/latest/payload_templates.txz \
## && tar xvf payload_templates.txz \
## && rm payload_templates.txz
#COPY --from=pupy /opt/pupy/payload_templates/ /pentest/pupy/pupy/payload_templates/
RUN mkdir /usr/share/mimikatz \
&& cd /usr/share/mimikatz \
&& wget https://github.com/gentilkiwi/mimikatz/releases/latest/download/mimikatz_trunk.zip \
&& unzip mimikatz_trunk.zip \
&& rm mimikatz_trunk.zip
RUN wget https://github.com/evilsocket/shellz/releases/download/v1.5.0/shellz_1.5.0_linux_amd64.tar.gz \
-O shellz.tar.gz \
&& tar -xvf shellz.tar.gz shellz \
&& mv shellz /usr/local/bin/ \
&& rm shellz.tar.gz
# PEzor, adds 3GB to image, not worth it right now
#RUN git clone https://github.com/phra/PEzor.git /pentest/PEzor \
# && cd /pentest/PEzor \
# && bash install.sh \
# && apt clean \
# && rm -rf /var/lib/apt/lists
#ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:~/go/bin/:/pentest/PEzor:/pentest/PEzor/deps/donut_v0.9.3/:/pentest/PEzor/deps/wclang/_prefix_PEzor_/bin/
# msf python
RUN apt update \
&& apt install -y --no-install-recommends \
python3-pip python3-setuptools \
&& apt clean \
&& rm -rf /var/lib/apt/lists \
&& pip3 install --break-system-packages pymetasploit3
RUN git clone https://github.com/FireFart/msfpayloadgenerator /pentest/msfpayloadgenerator --depth 1 \
&& rm -rf /pentest/msfpayloadgenerator/.git
# Metasploit Install
RUN gem install wirble sqlite3 \
&& gem install bundler -v 1.16.1
RUN sed -i 's/scram-sha-256$/trust/g' /etc/postgresql/*/main/pg_hba.conf \
&& /etc/init.d/postgresql start \
&& su -c "createuser msf -S -R -D \
&& createdb -O msf msf" postgres
ENV LHOST= \
MSF_DATABASE_CONFIG=/pentest/metasploit-framework/config/database.yml
# Update metasploit the hard way, using git master
# Stolen from https://github.com/hackerhouse-opensource/hacklab/blob/master/Dockerfile
RUN git clone https://github.com/rapid7/metasploit-framework \
&& gem install xmlrpc \
&& cd metasploit-framework \
&& bundle install
RUN echo "127.0.0.1:5432:msf:msf:msf" > /root/.pgpass \
&& chmod 600 /root/.pgpass \
&& echo "production:" > $MSF_DATABASE_CONFIG \
&& echo " adapter: postgresql" >> $MSF_DATABASE_CONFIG \
&& echo " database: msf" >> $MSF_DATABASE_CONFIG \
&& echo " username: msf" >> $MSF_DATABASE_CONFIG \
&& echo " password: msf" >> $MSF_DATABASE_CONFIG \
&& echo " host: 127.0.0.1" >> $MSF_DATABASE_CONFIG \
&& echo " port: 5432" >> $MSF_DATABASE_CONFIG \
&& echo " pool: 75" >> $MSF_DATABASE_CONFIG \
&& echo " timeout: 5" >> $MSF_DATABASE_CONFIG
# Rest in RIP
#RUN curl http://fastandeasyhacking.com/download/armitage150813.tgz \
# | tar -zxC /pentest/
RUN ln -s /pentest/metasploit-framework/msfconsole /usr/bin \
&& ln -s /pentest/metasploit-framework/msfvenom /usr/bin
COPY msf/bin/* /usr/local/bin/
#RUN msfcache build
RUN rm -rf /root/.msf4 \
&& git clone https://github.com/brimstone/metasploit-modules /root/.msf4
RUN apt update \
&& apt install -y --no-install-recommends \
mitmproxy sqlmap nikto beef-xss bettercap ffuf wpscan \
default-mysql-client \
&& apt clean \
&& rm -rf /var/lib/apt/lists
RUN curl https://github.com/brimstone/gobuster/releases/download/1.3-opt/gobuster \
-Lo /usr/bin/gobuster \
&& chmod 755 /usr/bin/gobuster
# TODO /usr/share/beef-xss /usr/share/beef-xss/beef
EXPOSE 80 443 4444