2020-06-25 16:14:37 +00:00
|
|
|
FROM alpine:3.11
|
2019-12-27 20:09:15 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Include dist
|
|
|
|
ADD dist/ /root/dist/
|
2019-12-27 20:09:15 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Get and install dependencies & packages
|
2019-12-27 20:09:15 +00:00
|
|
|
RUN sed -i 's/dl-cdn/dl-2/g' /etc/apk/repositories && \
|
|
|
|
apk -U add \
|
2018-03-29 16:21:00 +00:00
|
|
|
build-base \
|
|
|
|
git \
|
|
|
|
libffi-dev \
|
|
|
|
openssl \
|
|
|
|
openssl-dev \
|
|
|
|
python \
|
|
|
|
python-dev \
|
|
|
|
py-pip \
|
|
|
|
py-setuptools && \
|
2019-12-27 20:09:15 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Setup user
|
|
|
|
addgroup -g 2000 rdpy && \
|
2018-05-19 21:35:24 +00:00
|
|
|
adduser -S -s /bin/ash -u 2000 -D -g 2000 rdpy && \
|
2019-12-27 20:09:15 +00:00
|
|
|
#
|
2018-05-25 16:18:05 +00:00
|
|
|
# Install deps
|
2017-10-13 18:58:14 +00:00
|
|
|
pip install --no-cache-dir --upgrade cffi && \
|
2018-05-19 21:35:24 +00:00
|
|
|
pip install --no-cache-dir \
|
2018-05-25 16:18:05 +00:00
|
|
|
hpfeeds \
|
2018-05-19 21:35:24 +00:00
|
|
|
twisted \
|
2018-03-29 16:21:00 +00:00
|
|
|
pyopenssl \
|
|
|
|
qt4reactor \
|
|
|
|
service_identity \
|
2018-05-25 16:18:05 +00:00
|
|
|
rsa \
|
|
|
|
pyasn1 && \
|
2019-12-27 20:09:15 +00:00
|
|
|
#
|
2018-05-25 16:18:05 +00:00
|
|
|
# Install rdpy from git
|
2019-02-25 15:12:48 +00:00
|
|
|
mkdir -p /opt && \
|
2018-05-25 16:18:05 +00:00
|
|
|
cd /opt && \
|
|
|
|
git clone --depth=1 https://github.com/t3chn0m4g3/rdpy && \
|
2017-10-13 18:58:14 +00:00
|
|
|
cd rdpy && \
|
|
|
|
python setup.py install && \
|
2019-12-27 20:09:15 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Setup user, groups and configs
|
2018-05-25 16:18:05 +00:00
|
|
|
cp /root/dist/* /opt/rdpy/ && \
|
|
|
|
chown rdpy:rdpy -R /opt/rdpy/* && \
|
2017-10-13 18:58:14 +00:00
|
|
|
mkdir -p /var/log/rdpy && \
|
2019-12-27 20:09:15 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Clean up
|
|
|
|
rm -rf /root/* && \
|
2018-03-29 16:21:00 +00:00
|
|
|
apk del --purge build-base \
|
2018-03-29 20:56:11 +00:00
|
|
|
git \
|
2018-03-29 16:21:00 +00:00
|
|
|
libffi-dev \
|
|
|
|
openssl-dev \
|
|
|
|
python-dev \
|
2019-05-25 17:35:03 +00:00
|
|
|
py-pip && \
|
2017-10-13 18:58:14 +00:00
|
|
|
rm -rf /var/cache/apk/*
|
2019-12-27 20:09:15 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Start rdpy
|
2018-03-29 20:56:11 +00:00
|
|
|
USER rdpy:rdpy
|
2018-05-25 16:18:05 +00:00
|
|
|
CMD exec /usr/bin/python2 -i /usr/bin/rdpy-rdphoneypot.py /opt/rdpy/$(shuf -i 1-3 -n 1) >> /var/log/rdpy/rdpy.log
|