我在本地网络的一台服务器上安装了FileZilla FTP服务器。 我可以成功使用FTP命令列出用户user
的文件夹(实际上我是通过Microsoft商店在Windows 10上安装Ubuntu的)。
ftp -p 192.168.11.24 21
Connected to 192.168.11.24.
220-FileZilla Server 0.9.60 beta
220-written by Tim Kosse (tim.kosse@filezilla-project.org)
220 Please visit https://filezilla-project.org/
Name (192.168.11.24:ms): user
331 Password required for user
Password:
230 Logged on
Remote system type is UNIX.
ftp> nlist /
227 Entering Passive Mode (192,168,11,24,203,217)
150 Opening data channel for directory listing of "/"
/crm-offers-browse-2018-03-08.xlsx
/log_file.txt
/model.png
226 Successfully transferred "/"
如果我使用 telnet 尝试相同的操作(我使用 Wireshark 捕获了命令),则命令
nlist
无法正常工作。它会返回 425 Can't open data connection
。我错过了什么?
telnet -e _ 192.168.11.24 21
Telnet escape character is '_'.
Trying 192.168.11.24...
Connected to 192.168.11.24.
Escape character is '_'.
220-FileZilla Server 0.9.60 beta
220-written by Tim Kosse (tim.kosse@filezilla-project.org)
220 Please visit https://filezilla-project.org/
USER user
331 Password required for user
PASS user
230 Logged on
SYST
215 UNIX emulated by FileZilla
PASV
227 Entering Passive Mode (192,168,11,24,205,245)
NLST /
425 Can't open data connection for transfer of "/"
PORT(h1,h2,h3,h4,p1,p2)
,其中端口号由(p1 * 256) + p2
找到。这就是@Michal所说的,如果您已经了解高位字节和低位字节。 - joshfindit