FTP client receives wrong port from server

Need help with FileZilla Server? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
mafufz
500 Command not understood
Posts: 4
Joined: 2016-12-07 14:17

FTP client receives wrong port from server

#1 Post by mafufz » 2018-07-19 15:28

I'm writing an FTP client from scratch and have trouble opening a PASV connection. The server seems to send the right port, but the client receives a different raw string and subsequently cannot connect.

This is the server log (Filezilla):

Code: Select all

2018.07.19 16:29:44 - (not logged in) (x.x.10.33)> Connected on port 21, sending welcome message...
2018.07.19 16:29:44 - (not logged in) (x.x.10.33)> 220 Hello from FileZilla Server 0.9.60 beta
2018.07.19 16:29:44 - (not logged in) (x.x.10.33)> USER test
2018.07.19 16:29:44 - (not logged in) (x.x.10.33)> 331 Password required for test
2018.07.19 16:29:45 - (not logged in) (x.x.10.33)> PASS test
2018.07.19 16:29:45 - test (x.x.10.33)> 230 Logged on
2018.07.19 16:29:45 - test (x.x.10.33)> PASV
2018.07.19 16:29:45 - test (x.x.10.33)> 227 Entering Passive Mode (y,y,105,118,93,232)
And this is the client log (my program):

Code: Select all

> USER test
2018.07.19 14.29.02 - 220 Hello from FileZilla Server 0.9.60 beta
2018.07.19 14.29.02 - 331 Password required for test
> PASS test
2018.07.19 14.29.02 - 230 Logged on
> PASV
2018.07.19 14.29.03 - 227 Entering Passive Mode (y,y,105,118,214,224)
The shown output is the raw data received from the socket. All server output arrives, but the 227 response has the wrong port numbers. I'm confused how this is even possible.

The connection is via VPN (OpenVPN) from Vietnam to Germany, the server is located in Germany, too. I have verified that Filezilla and my client work together when run on the same machine (no internet traffic). I've also verified that my client works with an independent server (both locally and over unsecured internet), so the problem seems to be with Filezilla?

Crossposted to https://stackoverflow.com/q/51425495/39590

User avatar
botg
Site Admin
Posts: 35566
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: FTP client receives wrong port from server

#2 Post by botg » 2018-07-19 19:41

Please read the section about malicious routers and firewalls in our Network Configuration guide.

mafufz
500 Command not understood
Posts: 4
Joined: 2016-12-07 14:17

Re: FTP client receives wrong port from server

#3 Post by mafufz » 2018-07-21 17:07

Thanks, but does this apply even to TLS connections?

User avatar
botg
Site Admin
Posts: 35566
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: FTP client receives wrong port from server

#4 Post by botg » 2018-07-21 20:24

No, but you're not using TLS according to the log.

Post Reply