From d9f120a4b90fc48e9a66b2b69cf94b27069e97e6 Mon Sep 17 00:00:00 2001 From: Michel Oosterhof Date: Mon, 13 Jan 2020 09:37:51 +0000 Subject: [PATCH] Telnet logging (#1288) * fix SSH version comment * better logging for output modules for telnet commands --- etc/cowrie.cfg.dist | 2 +- src/cowrie/telnet_proxy/handler.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/cowrie.cfg.dist b/etc/cowrie.cfg.dist index c615e5cf..504cfafa 100644 --- a/etc/cowrie.cfg.dist +++ b/etc/cowrie.cfg.dist @@ -522,7 +522,7 @@ dsa_private_key = ${honeypot:state_path}/ssh_host_dsa_key # SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2 # SSH-2.0-OpenSSH_5.9 # -# (default: "SSH-2.0-SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2") +# (default: "SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2") version = SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2 # Cipher encryption algorithms to be used. diff --git a/src/cowrie/telnet_proxy/handler.py b/src/cowrie/telnet_proxy/handler.py index 157b4f5c..1ee7c628 100644 --- a/src/cowrie/telnet_proxy/handler.py +++ b/src/cowrie/telnet_proxy/handler.py @@ -179,7 +179,7 @@ class TelnetHandler: # check if a command has terminated if b'\r' in data: if len(self.currentCommand) > 0: - log.msg('CMD: {0}'.format(self.currentCommand)) + log.msg(eventid='cowrie.command.input', input=self.currentCommand, format='CMD: %(input)s') self.currentCommand = b'' # send data after processing (also check if processing did not reduce it to an empty string)