-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
203 lines (177 loc) · 6.4 KB
/
Dockerfile
File metadata and controls
203 lines (177 loc) · 6.4 KB
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
# Zebbern Kali MCP Server - Docker Image
# Full-featured pentest image based on kalilinux/kali-rolling.
# Pre-built images are published to GHCR so users never need to build locally.
#
# Build:
# docker build -t zebbern-kali-mcp .
# docker build --build-arg INCLUDE_METASPLOIT=false -t zebbern-kali-mcp-light .
#
# Run:
# docker run -d -p 5000:5000 --name zebbern-kali zebbern-kali-mcp
FROM kalilinux/kali-rolling
# Metasploit opt-out: set to "false" to skip metasploit-framework install
ARG INCLUDE_METASPLOIT=true
# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
ENV HOME=/root
ENV GOPATH=/root/go
ENV PATH="/root/go/bin:/root/.local/bin:${PATH}"
# ── AI-agent optimised: suppress colors, banners, progress bars ──
# Locale — clean UTF-8, English messages
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
LANGUAGE=en
# Universal output control
ENV NO_COLOR=1 \
TERM=dumb \
FORCE_COLOR=0 \
CI=true \
COLUMNS=200 \
LINES=50
# Python runtime
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONWARNINGS=ignore \
PYTHONIOENCODING=utf-8 \
PIP_NO_COLOR=1
# Pwntools — disable terminal features and log spam
ENV PWNLIB_NOTERM=1
WORKDIR /app
# ---------- Layer 1: System & build dependencies ----------
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3-pip \
python3-dev \
build-essential \
git \
curl \
wget \
jq \
pipx \
golang-go \
nodejs \
npm \
ca-certificates \
libssl-dev \
libffi-dev \
libgmp-dev \
libmpfr-dev \
libmpc-dev \
&& rm -rf /var/lib/apt/lists/*
# ---------- Layer 2: All runtime APT packages (single update) ----------
# Pentest, wordlists, network/pivot, forensics/CTF, headless browser
RUN apt-get update && \
apt-get install -y --no-install-recommends \
nmap \
gobuster \
nikto \
sqlmap \
hydra \
john \
wpscan \
enum4linux \
fierce \
wafw00f \
tcpdump \
responder \
smbclient \
ldap-utils \
crackmapexec \
impacket-scripts \
amass \
masscan \
sslscan \
exploitdb \
wordlists \
seclists \
openvpn \
wireguard-tools \
openresolv \
openssh-client \
iputils-ping \
iproute2 \
proxychains4 \
socat \
netcat-traditional \
dnsutils \
binwalk \
steghide \
libimage-exiftool-perl \
foremost \
strace \
ltrace \
gdb \
massdns \
whatweb \
chromium \
chromium-driver \
&& rm -rf /var/lib/apt/lists/* \
&& gunzip -f /usr/share/wordlists/rockyou.txt.gz 2>/dev/null || true
# ---------- Layer 2b: Conditional Metasploit install ----------
RUN if [ "$INCLUDE_METASPLOIT" = "true" ]; then \
apt-get update && \
apt-get install -y --no-install-recommends metasploit-framework && \
rm -rf /var/lib/apt/lists/*; \
fi
# ---------- Layer 2d2: microsocks SOCKS5 proxy (VPN bridge) ----------
RUN cd /tmp && \
git clone --depth 1 https://github.com/rofl0r/microsocks.git && \
cd microsocks && \
make && \
cp microsocks /usr/local/bin/microsocks && \
chmod +x /usr/local/bin/microsocks && \
rm -rf /tmp/microsocks
# ---------- Layer 3: Go tools ----------
RUN go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest || true && \
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest || true && \
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest || true && \
go install -v github.com/ffuf/ffuf/v2@latest || true && \
go install -v github.com/tomnomnom/assetfinder@latest || true && \
go install -v github.com/tomnomnom/waybackurls@latest || true && \
go install -v github.com/lc/gau/v2/cmd/gau@latest || true && \
go install -v github.com/hahwul/dalfox/v2@latest || true && \
go install -v github.com/lobuhi/byp4xx@latest || true && \
go install -v github.com/PentestPad/subzy@latest || true && \
go install -v github.com/sensepost/gowitness@latest || true && \
go install -v github.com/jpillora/chisel@latest || true && \
go clean -cache -modcache 2>/dev/null || true
# ---------- Layer 3a: Pre-built binaries (katana, ligolo-ng, kiterunner) ----------
RUN cd /tmp && \
KATANA_VER="1.1.0" && \
wget -q "https://github.com/projectdiscovery/katana/releases/download/v${KATANA_VER}/katana_${KATANA_VER}_linux_amd64.zip" -O katana.zip && \
unzip -o katana.zip katana -d /usr/local/bin/ && \
chmod +x /usr/local/bin/katana && \
rm -f katana.zip && \
LIGOLO_VER="0.7.5" && \
wget -q "https://github.com/nicocha30/ligolo-ng/releases/download/v${LIGOLO_VER}/ligolo-ng_proxy_${LIGOLO_VER}_linux_amd64.tar.gz" -O ligolo-proxy.tar.gz && \
tar -xzf ligolo-proxy.tar.gz && \
mv proxy /usr/local/bin/ligolo-proxy && \
chmod +x /usr/local/bin/ligolo-proxy && \
rm -f ligolo-proxy.tar.gz LICENSE README.md && \
wget -q "https://github.com/assetnote/kiterunner/releases/download/v1.0.2/kiterunner_1.0.2_linux_amd64.tar.gz" -O kiterunner.tar.gz && \
tar -xzf kiterunner.tar.gz && \
mv kr /usr/local/bin/kr && \
chmod +x /usr/local/bin/kr && \
rm -f kiterunner.tar.gz || true
# ---------- Layer 5: pipx tools ----------
RUN pipx ensurepath && \
pipx install ssh-audit || true && \
pipx install arjun || true
# ---------- Layer 6: npm tools ----------
RUN npm install -g newman
# ---------- Layer 7: Python dependencies ----------
COPY requirements.txt /app/requirements.txt
RUN pip3 install --break-system-packages --no-cache-dir -r requirements.txt
# ---------- Layer 7b: Install Playwright browsers ----------
RUN playwright install chromium --with-deps
# Provide 'python' and 'pip' aliases (Kali only ships python3/pip3)
RUN ln -sf /usr/bin/python3 /usr/local/bin/python && \
ln -sf /usr/bin/pip3 /usr/local/bin/pip
# ---------- Layer 8: Application code ----------
COPY zebbern-kali/ /app/zebbern-kali/
# Create writable tmp directory for the application
RUN mkdir -p /app/tmp && chmod 777 /app/tmp
EXPOSE 5000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:5000/health || exit 1
ENTRYPOINT ["python3", "zebbern-kali/kali_server.py"]