Active vs. Passive
Active Versus Passive Ftp
Active - your client connects to FTP server on port 21. When you request data, it responds by it (FTP Server)connecting TO YOUR CLIENT on port 20.
Passive - your client connects on port 21. It issues the PASV command and the FTP server says "for data, connect to this IP Address on this port". Your client connects on the indicated IP/port. (that data port >1023)
So, if you are behind a not-too-bright firewall/router or a very secure one, active will not work. The FTP server tries to connect back to you; the firewall sees a random request to connect on port 20 and either has no idea what to do with it, or deliberately blocks it.
In Passive mode, you connect for the control (port21) and then you are told which port for the data (let's say, port 5000). You connect (I.E. Port 5000) and the FTP server's firewall knows to forward new connections on the passive FTP ports (let's say, 5000 - 5100) to the FTP Server. All the connections come from you TO the server. The only possible problem - your own ultra-secure firewall may not allow outgoing connections on port 5000-5100(or whatever). Then, you're toast. Against stupidity and paranoia the gods themselves labour in vain.
Because of the predominance of firewalls today, IE7 defaults to "use passive FTP" ("Tools - Internet Options - Advanced"). I think Firefox only allows Passive now? Does anyone know? Some FTP clients allow "if one fails, try the other". The DOS box FTP in Windows does NOT do passive.
One more gotcha - in IIS7, you can program the FTP site's IP address and port range for passive FTP - the address returned in response to the client's PASV command. Obviously, you would program the firewall IP (external address) of your network, so outside clients can ftp to your server. Therefore, passive ftp will not work from inside your network, because your FTP server will respond with the firewall IP instead of its internal IP (odds are your firewall won't allow internal-to-internal bounce).
And a last gotcha - on an older Sonicwall firewall, I found the response to the PASV command was being blocked as an FTP bounce attack, since the response contained the firewall's external address, not the FTP's internal address. The firewall automatically blocked a response that contained an IP address that did not match the source address (the FTP server's internal address). I had to go into the Sonicwall hidden advanced menu (diag.Html) and uncheck the option to protect against ftp bounce attacks.
Comment/Reply (w/o sign-up)