Skip to content

Commit

Permalink
Fixed issues identified by black
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkst-francois committed Oct 30, 2023
1 parent b7579b7 commit 1fecebc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions opencanary/modules/telnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@
from twisted.conch.telnet import TelnetTransport
from twisted.conch.telnet import ECHO


@implementer(portal.IRealm)
class Realm:
def requestAvatar(self, avatarId, mind, *interfaces):
if ITelnetProtocol in interfaces:
av = MyTelnet()
av.state = 'Command'
return ITelnetProtocol, av, lambda:None
av.state = "Command"
return ITelnetProtocol, av, lambda: None
raise NotImplementedError("Not supported by this realm")


class CanaryTelnetTransport(TelnetTransport):
def dataReceived(self, data):
try:
Expand All @@ -34,6 +36,7 @@ def connectionLost(self, reason):
return
TelnetTransport.connectionLost(self, reason)


class AlertAuthTelnetProtocol(AuthenticatingTelnetProtocol):
def connectionMade(self):
# p/Cisco telnetd/ d/router/ o/IOS/ cpe:/a:cisco:telnet/ cpe:/o:cisco:ios/a
Expand Down

0 comments on commit 1fecebc

Please sign in to comment.