2017-10-13 18:58:14 +00:00
|
|
|
FROM alpine
|
|
|
|
|
|
|
|
# Include dist
|
|
|
|
ADD dist/ /root/dist/
|
|
|
|
|
|
|
|
# Get and install dependencies & packages
|
2018-05-19 21:35:24 +00:00
|
|
|
RUN apk -U --no-cache add \
|
2018-03-29 16:21:00 +00:00
|
|
|
build-base \
|
|
|
|
git \
|
|
|
|
libffi-dev \
|
|
|
|
openssl \
|
|
|
|
openssl-dev \
|
|
|
|
python \
|
|
|
|
python-dev \
|
|
|
|
py-pip \
|
|
|
|
py-setuptools && \
|
2018-05-19 21:35:24 +00:00
|
|
|
apk -U --no-cache add --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
|
2017-10-13 18:58:14 +00:00
|
|
|
py-qt && \
|
|
|
|
|
|
|
|
# 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 && \
|
2017-10-13 18:58:14 +00:00
|
|
|
|
2018-05-25 16:18:05 +00:00
|
|
|
# Install deps
|
2018-05-19 21:35:24 +00:00
|
|
|
pip install --no-cache-dir --upgrade pip && \
|
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 && \
|
|
|
|
|
|
|
|
# Install rdpy from git
|
|
|
|
mkdir /opt && \
|
|
|
|
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 && \
|
|
|
|
|
|
|
|
# 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 && \
|
|
|
|
|
|
|
|
# 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 \
|
|
|
|
py-pip \
|
|
|
|
py-qt && \
|
2017-10-13 18:58:14 +00:00
|
|
|
rm -rf /var/cache/apk/*
|
|
|
|
|
|
|
|
# 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
|