FTP passive mode behaviour doesnt make sense to me

I have a hard time understanding the behavior ftp has when it is on passive mode, this has happened some times in HTB academy and now on the LAME machine is it happening again and i cant find any explanation online on how to deal with this.
I tried login into ftp using the anonymous user and using the ‘ls’ command, i get the following output

ftp> ls
229 Entering Extended Passive Mode (|||62826|).
150 Here comes the directory listing.
226 Directory send OK.

and no information about the files or directories is return. I tried turn off passive mode, turning off epsv, using the -A flag to try to force active mode on the ftp command and nothing works. I know the command wget -m --passive-mode ftp://login:pass@ip downloads some files, but i want to actually understand what is happening and how to do it manually on FTP. If anyone could explain it to me I would greatly appreciate it.

Ps. Even if this does not help solve the machine I still want to understand it.

Passive mode is when you the client initiate the connection vs Active is when the server initiates the connection.

Passive you are coming in on an unprivileged port, while active the server can dictate privileged or unprivileged.

Passive vs Active also helps out with firewalls in place among other things.

Here’s a good resource Active vs. Passive FTP Simplified: Understanding FTP Ports | JSCAPE

There are many others.

2 Likes

I would also like to try ‘some other client’ to connect to that FTP.
It looks like you’re using ‘ftp’ command. Try ‘nc’ (netcat) or Windows Commander (or ‘mc’ in *nix).

Good luck!