FTP transfert failed over SOCKS 5

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
philx02
Junior Member
Junior Member
Posts: 3
Joined: 2009-07-27, 13:25 UTC

FTP transfert failed over SOCKS 5

Post by *philx02 »

The setup is the following:

Client computer running windows XP connected to an openssh server and using dynamic tunneling (SOCKS 5).

Server computer running ProFTPD on Ubuntu 9.04 server.

I am using the above-mentioned tunnel for a lot of services (HTTP, HTTPS, SSH, IMAP, IMAP over SSL, etc.) and everything works well, even with the Server computer.

The client machine is running TotalCommander 7.5b7 and there is a FTP connection to the Server computer, which looks like this:
(I will post the image later, forum restriction...)

It can connect to the Server computer and I can browse the files without problem. But when it comes to file transfer, something odd is happening. No matter the file size I want to transfer and no matter what is the data transfer mode (bin or ascii), it always go to 100% and declare a transfer failure like this:
(I will post the image later, forum restriction...)

Whatever the button I hit, the end result is always the same: the file is transferred to something around 75% and 99% of its size (but never 100%).

When I use a connection to the same Server computer using the same Client computer but without using the SSH tunnel, it works well.

There might be a problem with the SOCKS implementation you are using...

Philippe
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I have no problems to connect to a server with Socks5 with two different proxies (one of them Wingate). Can you post a log of the failed transfers, please?
Author of Total Commander
https://www.ghisler.com
philx02
Junior Member
Junior Member
Posts: 3
Joined: 2009-07-27, 13:25 UTC

Post by *philx02 »

The following is the log of the connection and the transaction. By the way, my SOCKS5 proxy is putty.

----------
Connect to: (2009-07-27 12:52:23 PM)
hostname=192.168.0.103
username=philx02
startdir=
Firewall=localhost:8080
localhost=127.0.0.1
SOCKS5 connect...
SOCKS5 connect...OK
220 ProFTPD 1.3.1 Server (Debian) [::ffff:192.168.0.103]
USER philx02
331 Password required for philx02
PASS ***********
230 User philx02 logged in
SYST
215 UNIX Type: L8
FEAT
211-Features:
LANG en
MDTM
UTF8
REST STREAM
SIZE
211 End
OPTS UTF8 ON
200 UTF8 set to on
Connect ok!
PWD
257 "/home/philx02" is the current directory
Get directory
TYPE A
200 Type set to A
PASV
227 Entering Passive Mode (192,168,0,103,178,118).
LIST
150 Opening ASCII mode data connection for file list
Download
Waiting for server...
226 Transfer complete
TYPE I
200 Type set to I
PASV
227 Entering Passive Mode (192,168,0,103,196,136).
STOR test.txt
150 Opening BINARY mode data connection for test.txt
Upload
226 Transfer complete
SIZE test.txt
213 81920
Upload size mismatch!
Copied (2009-07-27 12:52:30 PM): C:\Documents and Settings\cayouette\Desktop\temp\test.txt -> ftp://192.168.0.103/home/philx02/test.txt 104,550 bytes, 163 kbytes/s
Get directory
TYPE A
200 Type set to A
PASV
227 Entering Passive Mode (192,168,0,103,237,210).
LIST
150 Opening ASCII mode data connection for file list
Download
Waiting for server...
226 Transfer complete
QUIT
221 Goodbye.
philx02
Junior Member
Junior Member
Posts: 3
Joined: 2009-07-27, 13:25 UTC

Post by *philx02 »

I have tried another ftp client (Filezilla) and the result is the same, the corrupted uploaded file's size is the same with TC and Filezilla. Therefore, if the problem resides in the SOCKS implementation, the (almost) only way it can happen is that you are using the same implementation (3rd party?) as Filezilla. If you confirm me that it is not the case (i.e. you developed your own SOCKS implementation), then this is definitely not a TC bug.

Please reply.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, I'm not using any FileZilla code, my ftp code is 100% my own, written from scratch following the RFC documents.

As you can see in the above log, the server reports "transfer complete" although the subsequent test with the SIZE command reveals that not all data was transferred...

Known reasons for such partial uploads:
1. Out of disk quota on the server
2. Some virus scanners/firewalls with a content filter can stop a data transfer when they encounter certain "forbidden" strings
3. Some child protection software like NetNanny can also have this effect
Author of Total Commander
https://www.ghisler.com
Post Reply