curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: FTP via Tor

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 5 Jul 2018 23:26:21 +0200 (CEST)

On Thu, 5 Jul 2018, Gisle Vanem wrote:

> 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.

I figured maybe the second connection through Tor would end up coming over
another exit and then the FTP server doesn't like that...

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

That will make curl ignore the IP the server tells it to use and instead
connect to the original IP again, yes. I suppose that makes Tor use the some
route again since it targets the same IP?

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

> * Connected to localhost (127.0.0.1) port 9050 (#0)
>
> Why is curl attempting to connect to '::1' when it used IPv4 initially?
> The "Skip 46.30.211.164" is IMHO a big hint it should be IPv4 only.

It's a bug. It's a actually two bugs, because not only should the second
connection be limited to the same IP family of the original connection but the
second connection should also try the other addresses it got and not only try
a single one. The second one is mentioned in KNOWN_BUGS:
https://curl.haxx.se/docs/knownbugs.html#Passive_transfer_tries_only_one

-- 
  / daniel.haxx.se
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-07-05