Hot answers tagged

3

I put this example together using this STEM Tutorial. It shows the use of controller.set_conf('__LeaveStreamsUnattached', '1') to make your own circuits, attach a stream, and make a request using the requesocks module (which is just the requests module with SOCKS5 support). Hope this helps. import StringIO import time import stem.control import ...


3

Nice timing, we just expanded our tutorials around this! For this you should use new_circuit() and attach_stream() rather than NEWNYM. For an example of doing this see... https://stem.torproject.org/tutorials/to_russia_with_love.html#custom-path-selection


3

Thanks for the catch! Fixed... https://gitweb.torproject.org/stem.git/commitdiff/f46974987106e3246482158e009491faa07bbae4


3

If your configured Tor socks port is 9150, then you can try this command: curl --socks5-hostname localhost:9150 http://ipecho.net/plain You also can configure it by editing your config file (usually named torrc) or pass an option named socksport as command-line argument when executing Tor.


3

What should I be reading? It depends on your platform but since your on a deb based distro it should be easy... https://www.torproject.org/docs/debian.html.en If I use the synaptic package manager to install Tor in, say, Linux Mint, will I get the most recent stable version of Tor? Not by default, but it will be if you get it from deb.torproject.org. See ...


2

I think you're confused a little. The Tor cloud instance is not about surfing at all, and there's not too much to interact with for a Tor relay. Exposing a Tor control port over the network is a bad idea, because the protocol is not secured and used only for local connections directly to it. To make use of it on your ec2 instance, install the controller ...


2

If you want to use event-based code (namely Twisted), there's https://github.com/habnabit/txsocksx for client-side stuff (i.e. socks proxy) and http://txtorcon.readthedocs.org/en/latest/ for speaking Tor's control protocol to Tor (and other things, like launching new Tor instances for hidden services, etc).


2

To force an application to use a particular circuit your best option is to handle attaching streams to circuits yourself. For an example of this see its tutorial. Usually you'll leave __LeaveStreamsUnattached set, and have all new stream events bind it to the circuit you're after.


2

Tor automatically builds the fastest circuits possible for you by attempting to see how much bandwidth is available for each node. It doesn't rely on the client supplied Bandwidth value but actually tries to test the node by building various circuits and timing the requests. Sometimes those tests are inconclusive, never get run, or just come up with bad ...


2

The tl;dr is that FTP and .onion do not go well together and never will, due to how the FTP protocol works. For more details, see below. FTP goes a little like this: Client connects to the "command" channel. Client logs in to the "command" channel. Client asks for some data over the "command" channel. If you're using Active Mode: Client opens up a ...


2

Not really. You can know it's observed bandwidth, and what it's throughput has been seen to be but not "available" bandwidth. That would require knowledge of, for example, the upperbounds of throughput in any given situation which would be infeasible to calculate and wouldn't be consistent as it would necessarily depend on factors outside of the control or ...


1

There is a project named: torflow and one of the plugins named OP-addon is a good solution for tor path generation and circuit handling with lots of measurements and analyzing goodies. from the documentation of OP-addon: By making use of the Tor control protocol, it replaces Tor's default path selection and circuit management by highly configurable ...


1

You have to construct the entire circuit yourself, you cannot just choose the middle node alone unfortunately. To do this, you need to use the extend_circuit command in Stem's controller API.


1

There is a tutorial on retrieving the number of bytes a relay has written and read here (run the code after installing stem): from stem.control import Controller with Controller.from_port(port = 9051) as controller: controller.authenticate() # provide the password here if you set one bytes_read = controller.get_info("traffic/read") bytes_written = ...


1

your site onion address could be captured by relays on the TOR network, if you want to make it confidential, you should consider making the hidden service "invitation only" or "password protected"


1

A Tor relay's descriptor is available at that relay as the resource '/tor/server/authority[.z]'. This is useful when you don't know the relay's fingerprint. Using IPredator as an example: http://197.231.221.211:9030/tor/server/authority Or, using stem: import stem.descriptor.remote dir_port = ('197.231.221.211', 9030) stem.descriptor.remote.Query(...


1

No ControlPort is specified in the torrc that your copy of Tor is trying to read. ControlPort PORT|unix:path|auto [flags] ... (Default: 0) With the default of 0 meaning not to create one. Instead either specify one in the place that tor.exe looks for it's torrc by default or use launch_tor_with_config instead. For example: from stem.process ...


1

Open Finder Press Command, Shift, G Enter this command: ~/Library/Application Support/TorBrowser-Data/Tor You should be able to see the Torcc file


1

You need to query the client bootstrap status. It's done - as it's said in control protocol spec like this: telnet 127.0.0.1 9051 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. AUTHENTICATE "cleartextpassword" 250 OK GETINFO status/bootstrap-phase 250-status/bootstrap-phase=NOTICE BOOTSTRAP PROGRESS=100 TAG=done SUMMARY="Done" 250 OK ...


1

There's no log for this kind of information - and for a good reason: it can hurt the privacy and anonymity of Tor. You can - technically - poll Tor regulary through Stem and keep the log for yourself, but anyway - it's a bad idea IMHO. Can you please put some more details about what do you need it for? Maybe this task can be solved in another way?


1

Try removing this. Because once the Socket is set the controller cannot change it. from stem import Signal from stem.control import Controller with Controller.from_port(port = 9151) as controller: controller.authenticate() controller.signal(Signal.NEWNYM) Or if you want to use it for changing identity every time you run the python file use it at ...


1

Here are your pyCURL and a howto UPDATE: Copy-pasting by request - copyright to code to sources mentioned upstrings: amnesia@amnesia: ~$ cat checkTor.py #!/usr/bin/env python import pycurl curl = pycurl.Curl() curl.setopt( pycurl.URL, 'https://check.torproject.org/' ) curl.setopt( pycurl.PROXY, '127.0.0.1' ) curl.setopt( pycurl.PROXYPORT, 9050 ) curl....


1

https://gitweb.torproject.org/torspec.git/tree/tor-spec.txt#n1167 10 -- TIMEOUT (Circuit construction took too long) ... 11 -- DESTROYED (The circuit was destroyed w/o client TRUNCATE) My guess is that there's something wrong with how you're trying to build the circuits in the first place. Have a look at how ExitMap currently builds custom ...


1

Please file a ticket with code and the descriptor that reproduces this. You're right that the RouterStatusEntryV3 class has a measured attribute. First guess is that you might have a RouterStatusEntryV2 instance instead.


1

The Tor metrics portal has historic information about consensuses. You could download the archive and search through them. You don't need Stem for that unless you want to verify the consensuses. I'd suggest just using grep instead of Python to check if a relay was in the consensus at a specific time.


1

Answer to question 1 -- part 2 (but NOT question 2): OK, I finally found the ultimate tool for analyzing the tor circuit--arm. I'm really surprised and disappointed that no one here pointed to this useful tool. It would have saved a lot of time on my part and mirimir's. This tool shows exactly what I wanted to know. Tor actually creates multiple circuits ...


1

Answer to question 1, part 1 (NOT the final answer): I think I have the answer to the first half of my first question: is the address gotten by 'wget' or 'curl' the entry node? My script gives: Exit relays: 176.10.100.228 89.46.100.197 93.184.21.102 212.83.145.8 wget: 89.46.100.197 tor gives: Jul 29 06:37:47.000 [info] const node_t *...


1

The browser and bash are using different circuits, with different exits. The stem script shows exits for all active circuits. Also, try my tweaked exit_used.py script.


1

I have re-written the code, as it seems my code was just awful. I'm not sure what the problem was, however, here's the update for anyone trying to do the same: assert str is not bytes from lib_socks_proxy_2013_10_03 import monkey_patch as socks_proxy_monkey_patch socks_proxy_monkey_patch.monkey_patch() import io import re import time import stem....


1

I replied on irc but maybe you had left... If you're not getting an exception then what makes you think it isn't working? Tor limits the rate at which it accepts NEWNYMs to once every ten seconds, so if you're not finding that circuits are changing then that could be it. Please don't cycle circuits too rapidly though. That puts strain on the network.


Only top voted, non community-wiki answers of a minimum length are eligible