tpotce/docker/adbhoney/Dockerfile

41 lines
1.2 KiB
Text
Raw Normal View History

2022-01-18 00:50:23 +00:00
FROM alpine:3.15
2019-08-28 12:46:19 +00:00
#
# Include dist
2022-03-05 00:50:47 +00:00
COPY dist/ /root/dist/
2019-08-28 12:46:19 +00:00
#
2018-12-05 16:59:08 +00:00
# Install packages
2022-03-05 00:50:47 +00:00
RUN apk --no-cache -U add \
2018-12-05 16:59:08 +00:00
git \
libcap \
py3-pip \
python3 \
python3-dev && \
2019-08-28 12:46:19 +00:00
#
2018-12-05 16:59:08 +00:00
# Install adbhoney from git
git clone https://github.com/huuck/ADBHoney /opt/adbhoney && \
cd /opt/adbhoney && \
2022-01-18 00:50:23 +00:00
# git checkout ad7c17e78d01f6860d58ba826a4b6a4e4f83acbd && \
git checkout 2417a7a982f4fd527b3a048048df9a23178767ad && \
2019-08-28 12:46:19 +00:00
cp /root/dist/adbhoney.cfg /opt/adbhoney && \
sed -i 's/dst_ip/dest_ip/' /opt/adbhoney/adbhoney/core.py && \
sed -i 's/dst_port/dest_port/' /opt/adbhoney/adbhoney/core.py && \
#
2018-12-05 16:59:08 +00:00
# Setup user, groups and configs
addgroup -g 2000 adbhoney && \
adduser -S -H -s /bin/ash -u 2000 -D -g 2000 adbhoney && \
chown -R adbhoney:adbhoney /opt/adbhoney && \
2021-09-20 09:15:28 +00:00
setcap cap_net_bind_service=+ep /usr/bin/python3.9 && \
2019-08-28 12:46:19 +00:00
#
2018-12-05 16:59:08 +00:00
# Clean up
apk del --purge git \
python3-dev && \
2018-12-05 16:59:08 +00:00
rm -rf /root/* && \
2022-03-05 00:50:47 +00:00
rm -rf /opt/adbhoney/.git && \
2018-12-05 16:59:08 +00:00
rm -rf /var/cache/apk/*
2019-08-28 12:46:19 +00:00
#
2018-12-05 16:59:08 +00:00
# Set workdir and start adbhoney
STOPSIGNAL SIGINT
USER adbhoney:adbhoney
WORKDIR /opt/adbhoney/
CMD nohup /usr/bin/python3 run.py