curl / Mailing Lists / curl-users / Single Mail


FTP via Tor

From: Gisle Vanem <>
Date: Thu, 5 Jul 2018 15:55:26 +0200

I'm experimenting with using curl via Tor and I'm
a bit confused. Obviously curl doesn't know it's WAN-side
address when going via Tor; attempting that, gives a:
   501 PORT address does not match originator.

from the FTP-server. So I need to use "active mode" with
'--ftp-skip-pasv-ip'. Is that correct?

So trying with a command like:
   curl ftp://<host> -v --ftp-skip-pasv-ip --socks5-hostname localhost:9050

results in:
   * SOCKS5 communication to <host>:21
   * SOCKS5 request granted.
   * Connected to localhost ( port 9050 (#0)
   * Connect data stream passively
   < 227 Entering Passive Mode (46,30,211,164,233,239).
   * Skip for data connection, re-use <host> instead
   * Hostname localhost was found in DNS cache
   * Trying ::1...
   * Connecting to <host> (::1) port 9050
   * connect to ::1 port 9050 failed: Connection refused
   * Failed to connect to localhost port 9050: Connection refused

Why is curl attempting to connect to '::1' when it used IPv4 initially?
The "Skip" is IMHO a big hint it should be IPv4 only.
Hence my confusion.

So just adding a '-4', it works!
   curl ftp://<host> -4v --ftp-skip-pasv-ip --disable-epsv --disable-eprt --socks5-hostname

(giving me a file-listing).

BTW, the page at:

mentions 'torsocks' which seems unavailable for Windows.
Any other options?

Received on 2018-07-05