move encoding to transport

This commit is contained in:
Michel Oosterhof
2018-07-07 08:03:19 +00:00
parent 28b6f6e7a7
commit d410971e52
2 changed files with 3 additions and 3 deletions

View File

@ -93,9 +93,9 @@ class CowrieSSHFactory(factory.SSHFactory):
t = transport.HoneyPotSSHTransport() t = transport.HoneyPotSSHTransport()
try: try:
t.ourVersionString = CONFIG.get('ssh', 'version').encode('ascii') t.ourVersionString = CONFIG.get('ssh', 'version')
except: except:
t.ourVersionString = b"SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2" t.ourVersionString = "SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2"
t.supportedPublicKeys = list(self.privateKeys.keys()) t.supportedPublicKeys = list(self.privateKeys.keys())

View File

@ -64,7 +64,7 @@ class HoneyPotSSHTransport(transport.SSHServerTransport, TimeoutMixin):
protocol='ssh' protocol='ssh'
) )
self.transport.write(b'{0}\r\n'.format(self.ourVersionString)) self.transport.write('{0}\r\n'.format(self.ourVersionString).encode('ascii'))
self.currentEncryptions = transport.SSHCiphers(b'none', b'none', b'none', b'none') self.currentEncryptions = transport.SSHCiphers(b'none', b'none', b'none', b'none')
self.currentEncryptions.setKeys(b'', b'', b'', b'', b'', b'') self.currentEncryptions.setKeys(b'', b'', b'', b'', b'', b'')
self.setTimeout(120) self.setTimeout(120)