Skip to content

Instantly share code, notes, and snippets.

@toufik-airane
Created October 6, 2015 21:37
Show Gist options
  • Save toufik-airane/459df58f6ccee7bf40e2 to your computer and use it in GitHub Desktop.
Save toufik-airane/459df58f6ccee7bf40e2 to your computer and use it in GitHub Desktop.
from twisted.internet import protocol, reactor
from twisted.manhole.telnet import Shell, ShellFactory
from twisted.protocols.telnet import Telnet
class HoneyProtocol(Shell):
def __init__(self):
None
def welcomeMessage(self):
return ('\r\nNetGear v4.1\r\n')
def doCommand(self, cmd):
print cmd
self.write ('\r\nNetGear v4.1\r\n')
return
class HoneyFactory(ShellFactory):
def __init__(self):
self.username = "admin"
self.password = "foo"
self.protocol=HoneyProtocol
if __name__ == "__main__":
reactor.listenTCP(1234, HoneyFactory())
reactor.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment