FTP Client has trouble running LIST behind SOCKS 4A proxy

Discussion of bugs and problems found in Altap Salamander. In your reports, please be as descriptive as possible, and report one incident per report. Do not post crash reports here, send us the generated bug report by email instead, please.
DavidAns
Posts: 13
Joined: 12 Jul 2006, 19:43

FTP Client has trouble running LIST behind SOCKS 4A proxy

Post by DavidAns »

The complete log is below. Note that it's able to get out through the proxy okay for login to the site, but when it comes time to do the PASV LIST command, it fails. Maybe the proxy doesn't like being given the IP address instead of an FQDN??

Code: Select all

FTP server address: www.AAAA.org, port: 21, user: DOMAIN\USER
Proxy server name: PROXY, type: SOCKS 4A
Proxy server address: PROXY, port: 1080, user: 
Connecting to "PROXY" (123.123.123.123) on port 1080.
Log UID is 0, time is 2/5/2007 - 10:38:48 AM.

220 Microsoft FTP Service
USER DOMAIN\USER
331 Password required for DOMAIN\USER.
PASS (hidden)
230 User DOMAIN\USER logged in.
(10:38:51): Logged in successfully, getting system information...
SYST
215 Windows_NT
PWD
257 "/" is current directory.
(10:38:51): Changing path to "/"...
(10:38:51): Listing path "/"...
PASV
227 Entering Passive Mode (1,2,3,4,16,142).
TYPE A
200 Type set to A.
LIST
(10:38:51): Data connection error: Proxy server is not able to open connection to FTP server "1.2.3.4" (port: 4238), error: Connection was rejected or failed.
(10:38:51): Reconnecting data connection...
(10:38:51): Data connection error: Proxy server is not able to open connection to FTP server "1.2.3.4" (port: 4238), error: Connection was rejected or failed.
425 Can't open data connection.
(10:39:05): Text listing was parsed by "IBM z/VM (CMS) 1" server type...
User avatar
SvA
Posts: 486
Joined: 29 Mar 2006, 02:41
Location: DE

Post by SvA »

What makes you think this is an issue with Servant Salamander. Is it working with which FTP client?
DavidAns
Posts: 13
Joined: 12 Jul 2006, 19:43

Post by DavidAns »

Sorry, I don't understand the question. I'm using the FTP Client plug-in that comes with Salamander 2.5 RC2. When no proxy is needed, it works fine with the site. When a SOCKS 4A proxy is used, it breaks. The fact that the login works with the proxy suggests to me that the LIST should, too, though I suppose it's possible that the proxy is configured to block LIST attempts. I'm posting here to make the Salamander team aware of the issue so they can try for themselves.
Petr Solin
ALTAP Staff
ALTAP Staff
Posts: 1112
Joined: 08 Dec 2005, 09:13
Location: Novy Bor, Czech Republic
Contact:

Post by Petr Solin »

I think that problem is on the server side because it returns IP address 1.2.3.4 for passive data connection (reply to the PASV command) which seems to be invalid. I tryied to get the server IP and it is: www.AAAA.org [160.79.222.132].

I suggest to try to use active data connection (PORT): clear the Use passive transfer mode box - see help for details: http://www.altap.cz/salam_en/help/ftp/d ... ectadv.htm

You can also try to use some other FTP client to check if it can handle this problem better than our FTP client.
DavidAns
Posts: 13
Joined: 12 Jul 2006, 19:43

Post by DavidAns »

Sorry - I guess I should have made it more obvious that I sanitized the machine names, IP addresses, and account information. The real IP returned is NOT 1.2.3.4, but IS in the "dotted 4" pattern for expressing numeric IP addresses. Switching from PASV to PORT will not work as the proxy will not allow incoming connections through. Since folks seem to think that Salamander supports this scenario, I'll try another FTP client to see if it works better. Thanks for the help.
Petr Solin
ALTAP Staff
ALTAP Staff
Posts: 1112
Joined: 08 Dec 2005, 09:13
Location: Novy Bor, Czech Republic
Contact:

Post by Petr Solin »

OK, please let me know if you find some FTP client working in this situation, maybe we need to fix something.

BTW, you can send real (unmodified) log to my email address (if you believe me ;-)). Analyzing of modified log is just wasting of time. You can also try to connect to some public FTP server if it is FTP client's problem, it's likely to occur on all FTP servers.
User avatar
SvA
Posts: 486
Joined: 29 Mar 2006, 02:41
Location: DE

Post by SvA »

DavidAns wrote:Switching from PASV to PORT will not work as the proxy will not allow incoming connections through.
In passive mode, the client (or maybe the proxy) needs to open an outgoing connection to the address and port returned by the Server in response to the PASV command.

Is your firewall and proxy server properly set up to do this? (You still did not answer my previous question. Did you try successfully with a different client?)
DavidAns
Posts: 13
Joined: 12 Jul 2006, 19:43

Post by DavidAns »

Here's a log of Core FTP Lite (http://www.coreftp.com/) successfully making a connection from the same machine on which Salamander fails. I've sanitized the logs again (using the same conventions as before) because I don't want to give out IP addresses/configuration of the location I'm trying from. Please note how it resolves the IP address that comes back from the PASV command so that it can access that address through the proxy. Please let me know if I can be of any more help!

Code: Select all

Welcome to Core FTP, release ver 1.3c, build 1447.6 (U) -- © 2003-2006
WinSock 2.0
Mem -- 1,047,532 KB, Virt -- 2,097,024 KB
Started on Wednesday February 07, 2007 at 12:56:PM
Resolving www.AAAA.org, via proxy (PROXY)...  
Connect socket #460 to 123.123.123.123, port 1080 (to 21)...
220 Microsoft FTP Service  
USER DOMAIN\USER  
331 Password required for DOMAIN\USER.  
PASS **********  
230 User DOMAIN\USER logged in.  
SYST  
215 Windows_NT  
Keep alive off...
PWD  
257 "/" is current directory.  
PASV  
227 Entering Passive Mode (1,2,3,4,14,254).  
LIST  
Resolving 1.2.3.4, via proxy (PROXY)...  
Connect socket #524 to 123.123.123.123, port 1080 (to 3838)...
125 Data connection already open; Transfer starting.  
226 Transfer complete.  
Transferred 55 bytes in 0.008 seconds  
Petr Solin
ALTAP Staff
ALTAP Staff
Posts: 1112
Joined: 08 Dec 2005, 09:13
Location: Novy Bor, Czech Republic
Contact:

Post by Petr Solin »

Thanks for testing! I have an idea what can be wrong, please try to connect to FTP server using its IP address (not name address). It it fails too, I will try to fix this problem and send you this version for testing.
DavidAns
Posts: 13
Joined: 12 Jul 2006, 19:43

Post by DavidAns »

As you probably expected, the attempt to connect by IP fails immediately. I'm happy to test a proposed fix!

Code: Select all

FTP server address: 1.2.3.4, port: 21, user: DOMAIN\USER
Proxy server name: PROXY, type: SOCKS 4A
Proxy server address: PROXY, port: 1080, user: 
Connecting to "PROXY" (123.123.123.123) on port 1080.
Log UID is 4, time is 2/8/2007 - 5:33:56 PM.

(17:33:56): Connection was rejected or failed.
Petr Solin
ALTAP Staff
ALTAP Staff
Posts: 1112
Joined: 08 Dec 2005, 09:13
Location: Novy Bor, Czech Republic
Contact:

Post by Petr Solin »

I hope that I have fixed the problem (your proxy server does not translate IP address from text representation to numerical). I have sent you patched version in email. Please let me know if it works well with patched version. Thanks!
DavidAns
Posts: 13
Joined: 12 Jul 2006, 19:43

Post by DavidAns »

Yes, you have fixed the problem - thank you! I'm glad you were able to correct this so easily. :) For what it's worth, the proxy server I'm behind is most likely Microsoft's ISA Server, so I think you've probably just improved FTP Client for a whole bunch of users. Thank you again!
Post Reply