Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should be the FTP response to PASV command

Tags:

ftp

ftp-server

i'm writing an FTP server, but i don't understand the PASV command, any server sends a response like this:

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

what does the numbers in brackets mean? And whats the difference between normal and passive mode?

like image 364
BackSlash Avatar asked Jan 24 '13 09:01

BackSlash


1 Answers

Yes, you've got (213,229,112,130,216,4) as a result. 213,229,112,130 is IP address. 216 is upper 8bits in decimal. 4 is lower 8bits in decimal. So port number is 216 * 256 + 4. You should parse them in bracket.

like image 140
inherithandle Avatar answered Sep 18 '22 13:09

inherithandle