示例#1
0
 def makepasv(self):
     if self.af == socket.AF_INET:
         host, port = parse227(self.sendcmd('PASV'))
     else:
         host, port = parse229(self.sendcmd('EPSV'),
                               self.sock.getpeername())
     return self.host, port
 def makepasv(self):
     if self.af == socket.AF_INET:
         host, port = parse227(self.sendcmd('PASV'))
     else:
         host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername())
     # We tweak this so we don't use the internal ip returned by the remote server.
     # old: `return host, port`
     return self.host, port
示例#3
0
 def makepasv(self):
     if self.af == socket.AF_INET:
         host, port = parse227(self.sendcmd('PASV'))
     else:
         host, port = parse229(self.sendcmd('EPSV'),
                               self.sock.getpeername())
     if self.fix_host is not None:
         host = self.fix_host
     return host, port
示例#4
0
 def makepasv(self, family):
     '''Create a new connection and send a PASV/EPSV command for it.'''
     if family == socket.AF_INET:
         resp = self._request('PASV')
         host, port = ftplib.parse227(str(resp.raw))
     else:
         resp = self._request('EPSV')
         host, port = ftplib.parse229(str(resp.raw), self.sock.getpeername())
     conn = socket.create_connection((host, port), self.timeout)
     connMetadata = {"response": resp, "host": host, "port": port}
     return conn, connMetadata
示例#5
0
    def makepasv(self):
        if self.af == socket.AF_INET:
            host, port = ftplib.parse227(self.sendcmd('PASV'))
        else:
            host, port = ftplib.parse229(self.sendcmd('EPSV'),
                                         self.sock.getpeername())

        if '0.0.0.0' == host:
            """ this ip will be unroutable, we copy Filezilla and return the host instead """
            host = self.host
        return host, port
示例#6
0
 def update_event(self, inp=-1):
     self.set_output_val(0, ftplib.parse229(self.input(0), self.input(1)))