tweaking conpot

This commit is contained in:
listbot 2018-08-24 16:01:27 +00:00
parent ec1f6664b9
commit ea1bf604c8
2 changed files with 6 additions and 4 deletions

View file

@ -25,6 +25,8 @@ RUN apk -U --no-cache add \
# Setup ConPot # Setup ConPot
git clone --depth=1 https://github.com/mushorg/conpot /opt/conpot && \ git clone --depth=1 https://github.com/mushorg/conpot /opt/conpot && \
cd /opt/conpot/ && \ cd /opt/conpot/ && \
# Patch Conpot to PR#400
git pull origin pull/400/head && \
# Patch to accept ENV for MIB path # Patch to accept ENV for MIB path
cp /root/dist/snmp_server.py /opt/conpot/conpot/protocols/snmp/ && \ cp /root/dist/snmp_server.py /opt/conpot/conpot/protocols/snmp/ && \
# Increase logging for debug mushorg/conpot/issues/#399 # Increase logging for debug mushorg/conpot/issues/#399
@ -46,7 +48,7 @@ RUN apk -U --no-cache add \
cd / && \ cd / && \
rm -rf /opt/conpot /tmp/* /var/tmp/* && \ rm -rf /opt/conpot /tmp/* /var/tmp/* && \
setcap cap_net_bind_service=+ep /usr/bin/python3.6 && \ 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/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 && \ 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 # Start conpot
USER conpot: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 --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 -v --temp_dir $CONPOT_TMP --template $CONPOT_TEMPLATE --logfile $CONPOT_LOG --config $CONPOT_CONFIG

View file

@ -40,7 +40,7 @@ class HTTPServer(http.server.BaseHTTPRequestHandler):
def log(self, version, request_type, addr, request, response=None): 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, log_dict = {'remote': addr,
'timestamp': datetime.utcnow(), 'timestamp': datetime.utcnow(),