Exception on direct-tcpip channel request
This is what I see occasionally in the logs:
2018-01-11T13:50:29+0100 [SSHService b'ssh-connection' on SSHServerTransport,25,193.201.224.206] got channel b'direct-tcpip' request
2018-01-11T13:50:29+0100 [SSHService b'ssh-connection' on SSHServerTransport,25,193.201.224.206] channel open failed
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
File "/usr/lib/python3/dist-packages/twisted/conch/ssh/service.py", line 45, in packetReceived
return f(packet)
File "/usr/lib/python3/dist-packages/twisted/conch/ssh/connection.py", line 151, in ssh_CHANNEL_OPEN
log.err(e, 'channel open failed')
--- <exception caught here> ---
File "/usr/lib/python3/dist-packages/twisted/conch/ssh/connection.py", line 138, in ssh_CHANNEL_OPEN
packet)
File "/usr/lib/python3/dist-packages/twisted/conch/ssh/connection.py", line 546, in getChannel
data)
File "/usr/lib/python3/dist-packages/twisted/conch/avatar.py", line 24, in lookupChannel
raise ConchError(OPEN_UNKNOWN_CHANNEL_TYPE, "unknown channel")
twisted.conch.error.ConchError: (3, 'unknown channel')
How to reproduce:
# ssh to the honeypot proxy with port forwarding
ssh -L 12345:localhost:22 honeypot
# once the ssh is connected try to open the forwarded port (from the host running ssh)
telnet localhost 12345
These requests probably should fail (unless you want to forward them to the honeypot servers), only such errors probably should be handled gracefully than throwing exception to the log.