From 755cbb77dba01adc1fa547abb59d48d74d7fc19b Mon Sep 17 00:00:00 2001
From: t3chn0m4g3 <t3chn0m4g3@gmail.com>
Date: Wed, 15 Jan 2020 10:37:48 +0000
Subject: [PATCH] prepare for citrixhoneypot

---
 docker/citrixhoneypot/Dockerfile         | 46 ++++++++++++++++++++++++
 docker/citrixhoneypot/docker-compose.yml | 21 +++++++++++
 2 files changed, 67 insertions(+)
 create mode 100644 docker/citrixhoneypot/Dockerfile
 create mode 100644 docker/citrixhoneypot/docker-compose.yml

diff --git a/docker/citrixhoneypot/Dockerfile b/docker/citrixhoneypot/Dockerfile
new file mode 100644
index 00000000..e025389a
--- /dev/null
+++ b/docker/citrixhoneypot/Dockerfile
@@ -0,0 +1,46 @@
+FROM alpine 
+#
+# Include dist
+#ADD dist/ /root/dist/
+#
+# Install packages
+RUN apk -U add \
+            git \
+            libcap \
+	    openssl \
+            python3 \
+            python3-dev && \
+#
+# Install Citrix Honeypot from GitHub
+    git clone --depth=1 https://github.com/malwaretech/citrixhoneypot /opt/citrixhoneypot && \
+#    sed -i 's/dst_ip/dest_ip/' /opt/adbhoney/adbhoney/core.py && \
+#    sed -i 's/dst_port/dest_port/' /opt/adbhoney/adbhoney/core.py && \
+#
+# Setup user, groups and configs
+    mkdir -p /opt/citrixhoneypot/logs /opt/citrixhoneypot/ssl && \
+    openssl req \
+          -nodes \
+          -x509 \
+          -sha512 \
+          -newkey rsa:2048 \
+          -keyout "/opt/citrixhoneypot/ssl/key.pem" \
+          -out "/opt/citrixhoneypot/ssl/cert.pem" \
+          -days 365 \
+          -subj '/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd' && \
+    addgroup -g 2000 citrixhoneypot && \
+    adduser -S -H -s /bin/ash -u 2000 -D -g 2000 citrixhoneypot && \
+    chown -R citrixhoneypot:citrixhoneypot /opt/citrixhoneypot && \
+    setcap cap_net_bind_service=+ep /usr/bin/python3.8 && \
+#
+# Clean up
+    apk del --purge git \
+                    openssl \
+                    python3-dev && \
+    rm -rf /root/* && \
+    rm -rf /var/cache/apk/*
+#
+# Set workdir and start citrixhoneypot
+STOPSIGNAL SIGINT
+USER citrixhoneypot:citrixhoneypot
+WORKDIR /opt/citrixhoneypot/
+CMD nohup /usr/bin/python3 CitrixHoneypot.py
diff --git a/docker/citrixhoneypot/docker-compose.yml b/docker/citrixhoneypot/docker-compose.yml
new file mode 100644
index 00000000..3e0f31a5
--- /dev/null
+++ b/docker/citrixhoneypot/docker-compose.yml
@@ -0,0 +1,21 @@
+version: '2.3'
+
+networks:
+  citrixhoneypot_local:
+
+services:
+
+# CitrixHoneypot service
+  citrixhoneypot:
+    build: .
+    container_name: citrixhoneypot
+    restart: always
+    networks:
+     - citrixhoneypot_local
+    ports:
+     - "443:443"
+    image: "dtagdevsec/citrixhoneypot:1903"
+#    read_only: true
+#    volumes:
+#     - /data/adbhoney/log:/opt/adbhoney/log
+#     - /data/adbhoney/downloads:/opt/adbhoney/dl