What should be the FTP response to the PASV command

I am writing an FTP server, but I do not understand the PASV command, any server sends a response like this:

227 Entering Passive Mode (213,229,112,130,216,4)

What do the numbers in parentheses mean? And what is the difference between normal and passive modes?

+5
source share
1 answer

Yes you have (213,229,112,130,216,4). 213,229,112,130 - IP address. 216 is the upper 8 bits in the decimal system. 4 is less than 8 bits in decimal. Thus, the port number is 216 * 256 + 4. You must parse them in brackets.

+8
source

All Articles