tpotce/docker/rdpy/Dockerfile

62 lines
1.7 KiB
Text
Raw Normal View History

2021-09-23 20:15:33 +00:00
FROM debian:buster-slim
2019-12-27 20:09:15 +00:00
#
# Include dist
ADD dist/ /root/dist/
2019-12-27 20:09:15 +00:00
#
# Get and install dependencies & packages
2021-09-23 20:15:33 +00:00
RUN apt-get update -y && \
apt-get install -y \
build-essential \
2018-03-29 16:21:00 +00:00
git \
libffi-dev \
openssl \
2021-09-23 20:15:33 +00:00
libssl-dev \
python2 \
python2-dev \
python-pip \
python-setuptools && \
2019-12-27 20:09:15 +00:00
#
# Setup user
2021-09-23 20:15:33 +00:00
addgroup -gid 2000 rdpy && \
adduser --system --no-create-home --shell /bin/bash --uid 2000 --disabled-password --disabled-login --gid 2000 rdpy && \
2019-12-27 20:09:15 +00:00
#
# Install deps
pip install --no-cache-dir --upgrade cffi && \
2018-05-19 21:35:24 +00:00
pip install --no-cache-dir \
hpfeeds \
2018-05-19 21:35:24 +00:00
twisted \
2018-03-29 16:21:00 +00:00
pyopenssl \
qt4reactor \
2021-09-23 20:15:33 +00:00
rsa==4.5 \
2018-03-29 16:21:00 +00:00
service_identity \
pyasn1 && \
2019-12-27 20:09:15 +00:00
#
# Install rdpy from git
2019-02-25 15:12:48 +00:00
mkdir -p /opt && \
cd /opt && \
2020-09-04 12:37:28 +00:00
git clone https://github.com/t3chn0m4g3/rdpy && \
cd rdpy && \
2020-09-04 12:37:28 +00:00
git checkout 1d2a4132aefe0637d09cac1a6ab83ec5391f40ca && \
python setup.py install && \
2019-12-27 20:09:15 +00:00
#
# Setup user, groups and configs
cp /root/dist/* /opt/rdpy/ && \
chown rdpy:rdpy -R /opt/rdpy/* && \
mkdir -p /var/log/rdpy && \
2019-12-27 20:09:15 +00:00
#
# Clean up
2021-09-23 20:15:33 +00:00
apt-get purge -y build-essential \
2018-03-29 20:56:11 +00:00
git \
2018-03-29 16:21:00 +00:00
libffi-dev \
2021-09-23 20:15:33 +00:00
libssl-dev \
python2-dev \
python-pip && \
apt-get clean -y && \
apt-get autoremove --purge -y && \
apt-get install python-enum34 python-ipaddress python-six -y && \
rm -rf /root/* /var/lib/apt/lists/* /tmp/* /var/tmp/*
2019-12-27 20:09:15 +00:00
#
# Start rdpy
2018-03-29 20:56:11 +00:00
USER rdpy:rdpy
2021-09-23 20:15:33 +00:00
CMD exec /usr/bin/python2 -i /usr/local/bin/rdpy-rdphoneypot.py /opt/rdpy/$(shuf -i 1-3 -n 1) >> /var/log/rdpy/rdpy.log