Client not listening on port in active mode

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

Moderator: Project members

Post Reply
Message
Author
crizo
500 Command not understood
Posts: 4
Joined: 2012-03-19 19:04

Client not listening on port in active mode

#1 Post by crizo » 2012-03-19 19:09

I believe my case is simple. Filezilla sends my server a PORT command, which tells my server what port to connect back to(on the client). After the PORT command, I do not see a process listening on the port specified. For example, if the PORT command specifies port 12345, I would think that I could do a "netstat -an | grep 12345" (using cygwin) and see a process listening for port 12345. Am I correct in this assumption? The result is that any following LIST or STOR command fails because the server cannot connect back on port 12345.

I'm testing this on windows 7. I have disabled any firewall to ensure that it is not blocking the opening of port "12345".

Thanks for any help.

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

Re: Client not listening on port in active mode

#2 Post by botg » 2012-03-20 07:05

The port is only left open as long as needed. If the transfer has completed, either successfully or in error, the port is closed again. Are you sure you do netstat in that brief period of time the port is open?

crizo
500 Command not understood
Posts: 4
Joined: 2012-03-19 19:04

Re: Client not listening on port in active mode

#3 Post by crizo » 2012-03-20 15:32

I'm running netstat between when the PORT command and STOR commands are sent. The port should be open in this window, correct? Either way, when my server tries to connect back on port 12345, the connection fails. I'm running the Filezilla client and FTP server (homegrown) locally.

If I try to send the same file using either the Windows build-in ftp or a standard unix ftp client, the PORT command is sent, which opens a port, followed by the STOR command. My FTP server can connect back to either of these clients. I can also see the process listening in netstat after the PORT command is sent.

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

Re: Client not listening on port in active mode

#4 Post by botg » 2012-03-21 07:07

Seems weird. Can you please post a log from FileZilla?

crizo
500 Command not understood
Posts: 4
Joined: 2012-03-19 19:04

Re: Client not listening on port in active mode

#5 Post by crizo » 2012-04-13 21:47

Sorry for the late reply. Here is my log. Filezilla sends a USR, PASS, PORT, LIST (in that order). When the PORT command is sent, my server tries to connect to it, but as I said above, the port is not open, as confirmed by netstat

2012-04-13 14:41:35 3760 3 Status: Connecting to 10.6.33.103:2121...
2012-04-13 14:41:35 3760 3 Status: Connection established, waiting for welcome message...
2012-04-13 14:41:35 3760 3 Response: 220 TransCore FTP server v1.0
2012-04-13 14:41:35 3760 3 Command: USER netuser1
2012-04-13 14:41:35 3760 3 Response: 331 Password required for netuser1.
2012-04-13 14:41:35 3760 3 Command: PASS ********
2012-04-13 14:41:35 3760 3 Response: 230 User logged in.
2012-04-13 14:41:35 3760 3 Status: Connected
2012-04-13 14:41:35 3760 3 Status: Retrieving directory listing...
2012-04-13 14:41:35 3760 3 Command: PWD
2012-04-13 14:41:38 3760 3 Response: 257 "/" is current directory.
2012-04-13 14:41:38 3760 3 Command: TYPE I
2012-04-13 14:41:38 3760 3 Response: 200 Type set to I.
2012-04-13 14:41:38 3760 3 Command: PORT 10,6,33,103,202,246
2012-04-13 14:41:38 3760 3 Response: 331
2012-04-13 14:41:38 3760 3 Command: LIST
2012-04-13 14:41:38 3760 3 Response: 200 PORT command successful.
2012-04-13 14:41:38 3760 3 Error: Failed to retrieve directory listing
2012-04-13 14:41:38 3760 3 Response: 150 Opening ASCII mode data connection.
2012-04-13 14:41:38 3760 3 Response: 226 Transfer complete.

crizo
500 Command not understood
Posts: 4
Joined: 2012-03-19 19:04

Re: Client not listening on port in active mode

#6 Post by crizo » 2012-04-13 23:03

It looks like Filezillia sends multiple PORT commands, but doesn't really intend to listen on them. For example, during login, I'm seeing Filezilla send the USR/PASS, followed by a PORT and a LIST. Filezilla isn't listening on the port specified in PORT, so the LIST fails. When I try a transfer file, I see the same PORT/LIST behavior. Towards the end of the activity, the PORT/STOR finally succeeds as Filezilla is actually listening on the port. Ultimately, file transfer is working. I was just concerned about all the failed connections.

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

Re: Client not listening on port in active mode

#7 Post by botg » 2012-04-15 12:01

2012-04-13 14:41:38 3760 3 Command: PORT 10,6,33,103,202,246
2012-04-13 14:41:38 3760 3 Response: 331
2012-04-13 14:41:38 3760 3 Command: LIST
2012-04-13 14:41:38 3760 3 Response: 200 PORT command successful.
Either a horribly broken server or some firewall and/or NAT router is injecting additional replies into the connection.

Post Reply