Ejemplo n.º 1
0
 def __init__(self):
     TCPApplication.__init__(self)
     _ConsumerMixin.__init__(self)
     self.app = Site(
         static.File(os.path.abspath("./stegano/sitetest"))).buildProtocol(
             "test")  #Serve the given folder
     self.app.transport = self  #Because we define self as transport we have to implement function normally called by twisted for a transport class
Ejemplo n.º 2
0
 def __init__(self):
     TCPApplication.__init__(self)
     _ConsumerMixin.__init__(self)
     self.app = Site(static.File(os.path.abspath("./stegano/sitetest"))).buildProtocol(
         "test"
     )  # Serve the given folder
     self.app.transport = (
         self
     )  # Because we define self as transport we have to implement function normally called by twisted for a transport class
Ejemplo n.º 3
0
    def __init__(self):
        TCPApplication.__init__(self)
        _ConsumerMixin.__init__(self)

        #t = factory.OpenSSHFactory()
        t = MyFactory() #Use my factory instead of the original one
        t.portal = portal.Portal(unix.UnixSSHRealm()) #Instanciate all the needed stuff to create to protocol
        t.portal.registerChecker(checkers.UNIXPasswordDatabase())
        t.portal.registerChecker(checkers.SSHPublicKeyDatabase())
        if checkers.pamauth:
            t.portal.registerChecker(chk.PluggableAuthenticationModulesChecker())
        t.dataRoot = '/etc/ssh'
        t.moduliRoot = '/etc/ssh'

        t.startFactory()
        self.app = t.buildProtocol("lala")
        self.app.transport = self
Ejemplo n.º 4
0
    def __init__(self):
        TCPApplication.__init__(self)
        _ConsumerMixin.__init__(self)

        #t = factory.OpenSSHFactory()
        t = MyFactory()  #Use my factory instead of the original one
        t.portal = portal.Portal(unix.UnixSSHRealm(
        ))  #Instanciate all the needed stuff to create to protocol
        t.portal.registerChecker(checkers.UNIXPasswordDatabase())
        t.portal.registerChecker(checkers.SSHPublicKeyDatabase())
        if checkers.pamauth:
            t.portal.registerChecker(
                chk.PluggableAuthenticationModulesChecker())
        t.dataRoot = '/etc/ssh'
        t.moduliRoot = '/etc/ssh'

        t.startFactory()
        self.app = t.buildProtocol("lala")
        self.app.transport = self
Ejemplo n.º 5
0
 def __init__(self, tcpapp, path):
     _ConsumerMixin.__init__(self)
     self.app = Site(static.File(
         os.path.abspath(path))).buildProtocol("test")
     self.app.transport = self  #Because we define self as transport we have to implement function normally called by twisted for a transport class
     self.tcpapp = tcpapp  #tcpapp contain the TCPApplication !
Ejemplo n.º 6
0
 def __init__(self,tcpapp, path):
     _ConsumerMixin.__init__(self)
     self.app = Site(static.File(os.path.abspath(path))).buildProtocol("test")
     self.app.transport = self #Because we define self as transport we have to implement function normally called by twisted for a transport class
     self.tcpapp = tcpapp #tcpapp contain the TCPApplication !