-
Notifications
You must be signed in to change notification settings - Fork 259
/
Copy pathDockerfile
44 lines (34 loc) · 946 Bytes
/
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
FROM python:3.9-alpine as builder
# Install python3 and development files
RUN set -eux \
&& apk add --no-cache \
alpine-sdk \
libffi-dev \
linux-headers \
openssl-dev \
musl-dev \
cargo \
libstdc++
# Copy pwncat source
COPY . /opt/pwncat
# Setup virtual environment
RUN set -eux \
&& python -m pip install -U pip setuptools wheel setuptools_rust
# Setup pwncat
RUN set -eux \
&& cd /opt/pwncat \
&& pip install .
FROM python:3.9-alpine as final
# Add libstdc++ and create the working directory
RUN set -eux \
&& apk add --no-cache libstdc++ \
&& mkdir /work
# Copy installed packages from builder image
COPY --from=builder /usr/local/lib/python3.9 /usr/local/lib/python3.9
COPY --from=builder /usr/local/bin/pwncat-cs /usr/local/bin/pwncat-cs
# Ensure we have the pwncat plugins downloaded
RUN pwncat-cs --download-plugins
# Set working directory
WORKDIR /work
# Entrypoint is pwncat itself
ENTRYPOINT ["pwncat-cs"]