示例#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
示例#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
示例#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
示例#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
示例#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 !
示例#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 !