[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-relays] How do I get the *current* Tor exit node IP address over the control port?
- To: tor-relays@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [tor-relays] How do I get the *current* Tor exit node IP address over the control port?
- From: Matt Traudt <pastly@xxxxxxxxxxxxxx>
- Date: Mon, 27 Jan 2020 08:56:32 -0500
- Autocrypt: addr=pastly@xxxxxxxxxxxxxx; prefer-encrypt=mutual; keydata= mQINBFYSsCYBEACtCAyNCpmHR4A3L4AWF9UbhZDu76D3LxZHSuPkCWOI++7Lm1SZ0QTuDsd0 ncp6qmzx56wbL9rmRwgNHFCPxlEv1zHmGDoGS/h1CVLsOXpEKqmyyCysYygp+Fc6N5aXIlCm lBj4xEnjz3aSdA0T6RAUOJRLDvmH0hs3guPsJ5Ic12+WekkgqXrNPKoI8PEa1MVFB8RT/49+ SZp28zTk951LXFy2Gte+r/FmNIoKCgMvyBJ5y+vRDIERZhA3S/U9w66zflpBhSRco9VG2fZX Pe2Y5OiC9sLJoHHce7QLIsMbepzGDWIDyIkveMDHPByJL2i3+ajQvv4mRl/WFOUXQJ+HgtA4 o7ul8KSPghmkXJBPTc1nb4U6yPE+cJgx1PhAkc6pcHOo3bf9tnozr4IdkiG/1bvInLqTqm30 nJOloNLVLt6WhhWEt9tUJrcXMSZwhuABgxzz+HvvE19XFzvCCm9xU0dh2kgQ2PAnmK8QsH4b h2M9bkH+WEgMZdh4tNcJdj4UtH/OL8R22+E198lq4C9SMj5DEocllshIVpXRJb2wz91rgP+t dYfjGV/nlnQDKCK1S/+rjSnu4Li3dzTrcNS2rewlVuyUeM5gCnmp6vVZh9xiF/HvYPhKr68J heuo7mq9EJeeuMOcedf5d/zC5fNcdmalYbM8Ow5BT0ZLveIzuQARAQABtCNNYXR0IFRyYXVk dCA8cGFzdGx5QHRvcnByb2plY3Qub3JnPokCVAQTAQgAPhYhBLfhBfxObZN3+Jy6TIO8qVKU +7sKBQJaNsqdAhsDBQk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I xGB5mjkyqzrgez8ZRgidcaduTIwqPDWw4BX0IXEc
- Delivered-to: archiver@xxxxxxxx
- Delivery-date: Mon, 27 Jan 2020 08:56:59 -0500
- In-reply-to: <20200127124730.5b1d6bfa@localhost>
- List-archive: <http://lists.torproject.org/pipermail/tor-relays/>
- List-help: <mailto:tor-relays-request@lists.torproject.org?subject=help>
- List-id: "support and questions about running Tor relays \(exit, non-exit, bridge\)" <tor-relays.lists.torproject.org>
- List-post: <mailto:tor-relays@lists.torproject.org>
- List-subscribe: <https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays>, <mailto:tor-relays-request@lists.torproject.org?subject=subscribe>
- List-unsubscribe: <https://lists.torproject.org/cgi-bin/mailman/options/tor-relays>, <mailto:tor-relays-request@lists.torproject.org?subject=unsubscribe>
- References: <20200127124730.5b1d6bfa@localhost>
- Reply-to: tor-relays@xxxxxxxxxxxxxxxxxxxx
- Sender: "tor-relays" <tor-relays-bounces@xxxxxxxxxxxxxxxxxxxx>
On 1/27/20 05:47, Mike wrote:
> Hello,
>
> How do I get the external IP address of the current Tor exit node (the
> one which is in use) without using external services/websites (through
> curl or otherwise) but only through the Tor control port functionality
> (using bash or python3).
>
> *I have also asked on https://stackoverflow.com/q/59923289
stem's get_circuits() function on a controller.
https://stem.torproject.org/api/control.html#stem.control.Controller.get_circuits
You'll get a list of circuit objects, which each have a path. For each
circuit that is built for the purpose of carrying your traffic to a
non-onion destination, the last item in the path is an exit node.
It's all in the stem documentation. I would familiarize yourself with
it. Also, this is a mailing list for Tor relay operators to talk about
relay operation stuff. tor-talk@ might have been a better place for this.
Note your misconception that there is only **one** circuit or **one**
exit at a time. Not true. Tor may choose to open new circuits for a wide
variety of reasons. The remainder of this email is a copy/paste response
I use on Reddit when people seem to have this misconception.
The mental model of "Tor gives you a new IP address every 10 minutes" is
very inaccurate. There's a tiny grain of truth, but there's a pile of
reasons it isn't really true.
What you're thinking of is the `MaxCircuitDirtiness` torrc option, which
indeed defaults to 10 minutes. Once you start using circuit A, Tor will
no longer attach new streams to it automatically after 10 minutes.
That's what it means more or less.
But there are so many reasons why you might have more than one circuit
for user traffic, each with a different exit node (or none at all, for
onion service circuits).
- Each unique onion service you visit needs its own circuit.
- Maybe you have some very long lived connections (SSH, IRC, etc.) that
are still hanging around on older circuits while your active browsing is
using a newer one.
- Maybe for whatever reason, Tor doesn't think a connection will work
over the "current" circuit (e.g. the exit's `ExitPolicy` or something
dumb and impossible to explain about Tor's internal logic). If this is
the case, it isn't afraid to build a new one.
And that's just talking about Tor. What about Tor Browser?
Tor Browser intelligently separates both the state you receive from
various websites and the connections you make to websites.
If I have https://facebook.com open in tab 1, 2, and 3, all its state
*regardless of the domain it comes from* goes into a single bucket and
all the connections use one (or more) circuits reserved for this
bucket's traffic. If I have https://amazon.com open in tabs 4, 5, and 6,
all its state goes into a different single bucket and all the
connections use a different circuit(s) for their traffic.
So just by browsing multiple websites at the same time, I have more than
one circuit open, and therefore more than one IP.
--
Matt
_______________________________________________
tor-relays mailing list
tor-relays@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-relays