mirror of
https://github.com/cowrie/cowrie.git
synced 2025-07-01 18:07:27 -04:00
Use string.decode("utf-8", error='backslashreplace') for ssh version (#1585)
This commit is contained in:
@ -112,7 +112,7 @@ class HoneyPotSSHTransport(transport.SSHServerTransport, TimeoutMixin):
|
||||
self.otherVersionString = self.buf.split(b"\n")[0].strip()
|
||||
log.msg(
|
||||
eventid="cowrie.client.version",
|
||||
version=repr(self.otherVersionString),
|
||||
version=self.otherVersionString.decode("utf-8", errors="backslashreplace"),
|
||||
format="Remote SSH version: %(version)s",
|
||||
)
|
||||
m = re.match(br"SSH-(\d+.\d+)-(.*)", self.otherVersionString)
|
||||
|
||||
@ -209,7 +209,7 @@ class FrontendSSHTransport(transport.SSHServerTransport, TimeoutMixin):
|
||||
self.otherVersionString = self.buf.split(b"\n")[0].strip()
|
||||
log.msg(
|
||||
eventid="cowrie.client.version",
|
||||
version=repr(self.otherVersionString),
|
||||
version=self.otherVersionString.decode("utf-8", errors="backslashreplace"),
|
||||
format="Remote SSH version: %(version)s",
|
||||
)
|
||||
m = re.match(br"SSH-(\d+.\d+)-(.*)", self.otherVersionString)
|
||||
|
||||
Reference in New Issue
Block a user