Disconnects after sending PASV command, Error listing directory '/'

Advertisement

amweiss
Joined:
Posts:
4

Disconnects after sending PASV command, Error listing directory '/'

I’m trying to connect to an FTP site, and it gives me error listing directory.
It works in FileZilla client, but not in WinSCP.

It seems that when sending the PASV command, incorrect data is returned from the server, which is causing WinSCP to disconnect. But FileZilla handles it correctly.

Below is the log from WinSCP, followed with FileZilla log. I deleted the personal info.
. 2021-10-05 16:19:45.059 --------------------------------------------------------------------------
. 2021-10-05 16:19:45.060 WinSCP Version 5.19.2 (Build 11614) (OS 10.0.19041 - Windows 10 Enterprise)
. 2021-10-05 16:19:45.060 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2021-10-05 16:19:45.060 Log level: Normal, Rotating after: 1M, Keeping at most 5 logs
. 2021-10-05 16:19:45.060 Working directory: C:\Program Files (x86)\WinSCP
. 2021-10-05 16:19:45.060 Process ID: 9740
. 2021-10-05 16:19:45.070 Ancestor processes: explorer, ...
. 2021-10-05 16:19:45.070 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" 
. 2021-10-05 16:19:45.070 Time zone: Current: GMT-4, Standard: GMT-5 (Eastern Standard Time), DST: GMT-4 (Eastern Daylight Time), DST Start: 3/14/2021, DST End: 11/7/2021
. 2021-10-05 16:19:45.070 Login time: Tuesday, October 5, 2021 4:19:45 PM
. 2021-10-05 16:19:45.070 --------------------------------------------------------------------------
. 2021-10-05 16:19:45.070 Session name: xxx (Ad-Hoc site)
. 2021-10-05 16:19:45.070 Host name: xxx (Port: 21)
. 2021-10-05 16:19:45.070 User name: xxx (Password: Yes, Key file: No, Passphrase: No)
. 2021-10-05 16:19:45.071 Transfer Protocol: FTP
. 2021-10-05 16:19:45.071 Ping type: Dummy, Ping interval: 30 sec; Timeout: 15 sec
. 2021-10-05 16:19:45.071 Disable Nagle: No
. 2021-10-05 16:19:45.071 Proxy: None
. 2021-10-05 16:19:45.071 Send buffer: 262144
. 2021-10-05 16:19:45.071 UTF: Auto
. 2021-10-05 16:19:45.071 FTPS: None [Client certificate: No]
. 2021-10-05 16:19:45.071 FTP: Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]; HOST: Auto
. 2021-10-05 16:19:45.071 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2021-10-05 16:19:45.071 Cache directory changes: Yes, Permanent: Yes
. 2021-10-05 16:19:45.071 Recycle bin: Delete to: No, Overwritten to: No, Bin path: 
. 2021-10-05 16:19:45.071 Timezone offset: 0h 0m
. 2021-10-05 16:19:45.071 --------------------------------------------------------------------------
. 2021-10-05 16:19:45.117 Connecting to xxx ...
. 2021-10-05 16:19:45.506 Connected with xxx. Waiting for welcome message...
< 2021-10-05 16:19:45.579 220-FileZilla Server 0.9.60 beta
< 2021-10-05 16:19:45.579 220-xxx
< 2021-10-05 16:19:45.579 220 xxx
> 2021-10-05 16:19:45.579 USER xxx
< 2021-10-05 16:19:45.652 331 Password required for xxx
> 2021-10-05 16:19:45.652 PASS ****************
< 2021-10-05 16:19:45.719 230 Logged on
> 2021-10-05 16:19:45.719 SYST
< 2021-10-05 16:19:45.789 215 UNIX emulated by FileZilla
> 2021-10-05 16:19:45.789 FEAT
< 2021-10-05 16:19:45.861 211-Features:
< 2021-10-05 16:19:45.861  MDTM
< 2021-10-05 16:19:45.861  REST STREAM
< 2021-10-05 16:19:45.861  SIZE
< 2021-10-05 16:19:45.861  MLST type*;size*;modify*;
< 2021-10-05 16:19:45.861  MLSD
< 2021-10-05 16:19:45.861  AUTH SSL
< 2021-10-05 16:19:45.861  AUTH TLS
< 2021-10-05 16:19:45.861  PROT
< 2021-10-05 16:19:45.861  PBSZ
< 2021-10-05 16:19:45.861  UTF8
< 2021-10-05 16:19:45.861  CLNT
< 2021-10-05 16:19:45.861  MFMT
< 2021-10-05 16:19:45.861  EPSV
< 2021-10-05 16:19:45.861  EPRT
< 2021-10-05 16:19:45.861 211 End
> 2021-10-05 16:19:45.861 CLNT WinSCP-release-5.19.2
< 2021-10-05 16:19:45.928 200 Don't care
> 2021-10-05 16:19:45.928 OPTS UTF8 ON
< 2021-10-05 16:19:46.007 202 UTF8 mode is always enabled. No need to send this command.
. 2021-10-05 16:19:46.016 Connected
. 2021-10-05 16:19:46.016 --------------------------------------------------------------------------
. 2021-10-05 16:19:46.016 Using FTP protocol.
. 2021-10-05 16:19:46.016 Doing startup conversation with host.
> 2021-10-05 16:19:46.047 PWD
< 2021-10-05 16:19:46.115 257 "/" is current directory.
. 2021-10-05 16:19:46.115 Getting current directory name.
. 2021-10-05 16:19:46.182 Retrieving directory listing...
> 2021-10-05 16:19:46.182 TYPE A
< 2021-10-05 16:19:46.263 200 Type set to A
> 2021-10-05 16:19:46.263 PASV
. 2021-10-05 16:19:46.333 Disconnected from server
. 2021-10-05 16:19:46.333 Could not retrieve directory listing
* 2021-10-05 16:19:46.430 (EFatal) **Lost connection.**
* 2021-10-05 16:19:46.430 Disconnected from server
* 2021-10-05 16:19:46.430 Could not retrieve directory listing
* 2021-10-05 16:19:46.430 Error listing directory '/'.
---FileZilla log----
Status:   Resolving address of xxx
Status:   Connecting to xxx:21...
Status:   Connection established, waiting for welcome message...
Response:   220-FileZilla Server 0.9.60 beta
Response:   220-xxx
Response:   220 xxx
Command:   AUTH TLS
Response:   234 Using authentication type TLS
Status:   Initializing TLS...
Status:   Verifying certificate...
Status:   TLS connection established.
Command:   USER xxx
Response:   331 Password required for xxx
Command:   PASS ****************
Response:   230 Logged on
Command:   PBSZ 0
Response:   200 PBSZ=0
Command:   PROT P
Response:   200 Protection level set to P
Status:   Logged in
Status:   Retrieving directory listing of "/"...
Command:   CWD /
Response:   250 CWD successful. "/" is current directory.
Command:   PWD
Response:   257 "/" is current directory.
Command:   TYPE I
Response:   200 Type set to I
Command:   PASV
Response:   227 Entering Passive Mode (192,168,0,245,214,216)
Status:   Server sent passive reply with unroutable address. Using server address instead.
Command:   MLSD
Response:   150 Opening data channel for directory listing of "/"
Response:   226 Successfully transferred "/"
Status:   Directory listing of "/" successful
Response:   421 Connection timed out.
Status:   Connection closed by server

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Disconnects after sending PASV command, Error listing directory '/'

It's likely your firewall that terminates the plain FTP connection after receiving the invalid PASV command response.
It won't do that to FileZilla, because with FileZilla you are using an encrypted connection.
Try enabling encrypted connecting in WinSCP too.

Reply with quote

Advertisement

You can post new topics in this forum