mirror of
https://github.com/aljazceru/cowrie.git
synced 2026-02-10 17:04:26 +01:00
New tasks for better customization of Telnet experience
This commit is contained in:
committed by
Michel Oosterhof
parent
97b6cd1bbd
commit
61318e3c21
@@ -120,6 +120,7 @@ class HoneyPotTelnetAuthProtocol(AuthenticatingTelnetProtocol, TimeoutMixin):
|
||||
# I need to doubly escape here since my underlying
|
||||
# StripCrTelnetTransport hack would remove it and leave just \n
|
||||
self.transport.write(self.factory.banner.replace('\n', '\r\r\n'))
|
||||
# FIXME: this should be configurable or provided via filesystem
|
||||
self.transport.write("User Access Verification\n\nUsername: ".replace('\n', '\r\r\n'))
|
||||
|
||||
self.setTimeout(120)
|
||||
@@ -146,6 +147,7 @@ class HoneyPotTelnetAuthProtocol(AuthenticatingTelnetProtocol, TimeoutMixin):
|
||||
# only send ECHO option if we are chatting with a real Telnet client
|
||||
if self.transport.options:
|
||||
self.transport.will(ECHO)
|
||||
# FIXME: this should be configurable or provided via filesystem
|
||||
self.transport.write("Password: ")
|
||||
return 'Password'
|
||||
|
||||
@@ -188,6 +190,8 @@ class HoneyPotTelnetAuthProtocol(AuthenticatingTelnetProtocol, TimeoutMixin):
|
||||
protocol.makeConnection(self.transport)
|
||||
self.transport.protocol = protocol
|
||||
|
||||
# TODO: provide a way to have user configurable strings for wrong password
|
||||
|
||||
|
||||
class StripCrTelnetTransport(TelnetTransport):
|
||||
"""Sole purpose is to override write() and fix a CRLF nesting bug"""
|
||||
|
||||
Reference in New Issue
Block a user