From ea1bf604c880fdc26c6232b6f8de9f25c584eb29 Mon Sep 17 00:00:00 2001 From: listbot Date: Fri, 24 Aug 2018 16:01:27 +0000 Subject: [PATCH] tweaking conpot --- docker/conpot/Dockerfile | 8 +++++--- docker/conpot/dist/command_responder.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docker/conpot/Dockerfile b/docker/conpot/Dockerfile index 7c298afd..c14a2567 100644 --- a/docker/conpot/Dockerfile +++ b/docker/conpot/Dockerfile @@ -25,6 +25,8 @@ RUN apk -U --no-cache add \ # Setup ConPot git clone --depth=1 https://github.com/mushorg/conpot /opt/conpot && \ cd /opt/conpot/ && \ + # Patch Conpot to PR#400 + git pull origin pull/400/head && \ # Patch to accept ENV for MIB path cp /root/dist/snmp_server.py /opt/conpot/conpot/protocols/snmp/ && \ # Increase logging for debug mushorg/conpot/issues/#399 @@ -46,7 +48,7 @@ RUN apk -U --no-cache add \ cd / && \ rm -rf /opt/conpot /tmp/* /var/tmp/* && \ setcap cap_net_bind_service=+ep /usr/bin/python3.6 && \ - # Fix kamstrup not starting error + # Fix kamstrup not starting error / #398 Workaround ln -s /usr/lib/python3.6/site-packages/conpot/protocols/kamstrup/meter_protocol /usr/lib/python3.6/site-packages/conpot/protocols/kamstrup_meter && \ ln -s /usr/lib/python3.6/site-packages/conpot/protocols/kamstrup/management_protocol /usr/lib/python3.6/site-packages/conpot/protocols/kamstrup_management && \ @@ -77,5 +79,5 @@ RUN apk -U --no-cache add \ # Start conpot USER conpot:conpot -CMD exec /usr/bin/conpot --temp_dir $CONPOT_TMP --template $CONPOT_TEMPLATE --logfile $CONPOT_LOG --config $CONPOT_CONFIG -#CMD exec /usr/bin/conpot -v --temp_dir $CONPOT_TMP --template $CONPOT_TEMPLATE --logfile $CONPOT_LOG --config $CONPOT_CONFIG +#CMD exec /usr/bin/conpot --temp_dir $CONPOT_TMP --template $CONPOT_TEMPLATE --logfile $CONPOT_LOG --config $CONPOT_CONFIG +CMD exec /usr/bin/conpot -v --temp_dir $CONPOT_TMP --template $CONPOT_TEMPLATE --logfile $CONPOT_LOG --config $CONPOT_CONFIG diff --git a/docker/conpot/dist/command_responder.py b/docker/conpot/dist/command_responder.py index f96f7c5d..74cabca2 100644 --- a/docker/conpot/dist/command_responder.py +++ b/docker/conpot/dist/command_responder.py @@ -40,7 +40,7 @@ class HTTPServer(http.server.BaseHTTPRequestHandler): def log(self, version, request_type, addr, request, response=None): - session = conpot_core.get_session('http', addr[0], addr[1]) + session = conpot_core.get_session('http', addr[0], addr[1], self.connection._sock.getsockname()[0], self.connection._sock.getsockname()[1]) log_dict = {'remote': addr, 'timestamp': datetime.utcnow(),