masneyb / gftp

gFTP is a free multithreaded file transfer client for *NIX based machines. 56 language translations available.
http://www.gftp.org
MIT License
116 stars 21 forks source link

gFTP sends internal (LAN) IP in PORT command #139

Closed wdlkmpx closed 2 years ago

wdlkmpx commented 2 years ago

Here is a problem

PWD
257 "/nomadbsd" is your current location
Loading directory listing /nomadbsd from server (LC_TIME=en_US.UTF-8)
PORT 192,168,x,x,157,6
200 PORT command successful
MLSD
425 Could not open data connection to port 40198: Connection timed out

The way to fix is to make gftp query a web site that returns the public IP address... but https://mywiki.wooledge.org/FtpMustDie#The_Client_Shall_Listen_For_Connections_From_The_Server.21

I guess passive_transfer=1, should be renamed to active_transfer=0 with a small help text: Enable this if your IP is reachable from outside the LAN and the server is severely firewalled

ignore_pasv_address: perhaps this should be removed and gftp should just always use the server IP. This is the case when EPSV is used ( https://datatracker.ietf.org/doc/html/rfc2428#section-3 ), only the port is provided. However this may affect the PRET command, but writing a distributed FTP server in java should be punishable ...