forked from brannondorsey/mitm-router
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
63 lines (53 loc) · 1.62 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
FROM debian:buster
LABEL maintainer="[email protected]"
LABEL license="MIT"
# Build time ARGs
ARG MITM_VERSION=5.1.1
ARG LOGO=logo.ans
# ENV vars
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update --fix-missing && apt-get install -y \
hostapd \
dbus \
net-tools \
iptables \
dnsmasq \
net-tools \
macchanger \
wget \
unzip \
libssl-dev \
libffi-dev \
python3 \
python3-pip \
python3-dev \
python3-venv \
locales \
procps \
git \
tshark
WORKDIR /root
# Set locals per https://stackoverflow.com/a/38553499
# Required by some of the mitm tools
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
# Build mitmproxy from source -- best way to get working on x86(-64) and ARM
RUN wget https://github.com/mitmproxy/mitmproxy/archive/v${MITM_VERSION}.zip \
&& unzip v${MITM_VERSION}.zip \
&& rm v${MITM_VERSION}.zip \
&& ln -s mitmproxy-${MITM_VERSION} mitmproxy-src
RUN cd mitmproxy-src && ./dev.sh && rm -rf ~/.cache/pip
# Copy over the pre-made CA files
# This ensures the certificates are always the same
COPY fake_ca /root/.mitmproxy
# Copy in some config files
COPY templates/hostapd.conf /etc/hostapd/hostapd.conf
COPY templates/hostapd /etc/default/hostapd
COPY templates/dnsmasq.conf /etc/dnsmasq.conf
COPY templates/mitm-config.yml /root/.mitmproxy/config.yml
# Copy in and set the entrypoint script
COPY entrypoint.sh /root/entrypoint.sh
COPY ${LOGO} /root/.logo.ans
ENTRYPOINT ["/root/entrypoint.sh"]