Hot answers tagged

4

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

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


3

No, this is not possible. TOR works on higher layer than VPNs and is only able to substitute your TCP stack. It is not possible to relay raw IP packets via TOR, like you can do over VPNs. I know this might sound very limiting (and it is), but there's some privacy advantages here. TOR is designed to limit possibilities of traffic analysis by reducing the ...


3

Tor does not use the same exit node for everything. The Tor Browser actually uses a security feature that makes sure it does not share the same circuits with any other program that uses the Tor client.


3

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


3

You're almost there, you're replacing socket.socket with socks.socket, so far so good. However upon assignment of variable s, you're not properly instantiating the replacement class, and therefore later during the connect call, your code results in the unbound method type error. In your original code, s gets assigned a class instance, and in your updated ...


3

This works for me: import socket import socks socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050, True) s = socks.socksocket() s.connect(('anguilla.debian.or.at', 1234)) s.sendall('Hello world') print(s.recv(1024)) So, that's just initializing s differently, via s = socks.socksocket(). With socks, connect() also takes a hostname. This ...


2

You can use any programming language for a hidden service. The reason why most of the hidden services using PHP might be the same why many services in the web use PHP. ;) Your hidden service basically needs to listen on some TCP port. This can be for instance a webserver. Your application takes the request from that webserver and does something with it. You ...


2

Yes, you can use any tools you want to run hidden services. On the Tor Project's Hidden Service setup page for Step 1 you can use any webserver stack that suits your needs.


2

You're using 127.0.0.1:8118 as a proxy URL (in a nutshell) with http as your protocol. You should use https instead. Related: Tor doesn't work with urllib2 Python urllib2 > HTTP Proxy > HTTPS request


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

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

The Tails firewall will prevent you from doing this. Only applications that have been explicitly whitelisted are allowed to communicate with the outside world. This is by design. Have a read of the Network Filter page on the Tails site. You'll have to whitelist your application/script to allow it to connect to a foreign IP address. To do this you'll need ...


2

This already exists as ExitMap. It's approach is to launch it's own copy of Tor which is configured not to automatically attach streams to existing circuits through use of the __LeaveStreamsUnattached option, then use stem to build custom circuits, one to each of the suitable exits and attach the streams to the circuits. I'm not sure where you're getting ...


2

All certificates types are listed here, see section "A.1. List of certificate types" [04] - Ed25519 signing key with an identity key (see prop220 section 4.2) [05] - TLS link certificate signed with ed25519 signing key (see prop220 section 4.2) **[07] - Reserved for RSA identity cross-certification; (see section 2.3 ...


1

This looks like it should work fine, as long as you give it the right Control and SOCKS ports when you create the TorRequests instance, I.E. request = TorRequest(proxy_port = 9150, ctrl_port=9151) Since it's using stem and you can specify alternative ports, this should work fine using Tor Browser without requiring a stand-alone tor.exe for it to launch.


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

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

Why not take a look here at the official docs ? It explicitly says, that key can be provided on creation. Of course, if you've already created an ephemeral hidden service, then no key or other stuff can be fetched, because it's the very meaning of it's ephemerical nature. Create your RSA1024 key and use it, why not?


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

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

You need to figure out a way to ensure you are running Python 2.7 and try again. Most likely you aren't using python 2.7 like you think you are. Check python from command line by typing python --version. Then to make sure login to Python command line by typing python and see what version it spits out in the welcome message and type exit() to exit. ...


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

Has anybody had any success using Tor Browser with Marionette? It was possible up to (at least) 52.3.0. start the browser: cd tor-browser_en-US/Browser ./start-tor-browser -marionette connect from marionette_driver.marionette import Marionette client = Marionette('localhost', port=2828) client.start_session() client.navigate("http://torproject.org")


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.


1

For client usage controller libraries like Stem and Txtorcon aren't necessary. Tor is a local socks proxy and any socket library (SocksiPy, PycURL, etc) will do the trick. See the tutorial for this... Tutorial: To Russia With Love The trick is making sure your application doesn't leak. DNS queries and other edge cases might still expose your real IP so ...


1

In case anyone else runs into this same issue at some point... it turns out my network suddenly began blocking Tor, which is why the channel was being closed immediately during the circuit extension process.


1

The latest txtorcon supports endpoint-strings, so you can use Twisted built-in Web server to host any WSGI Web application (and twistd comes with SystemD support too). See here: http://txtorcon.readthedocs.org/en/latest/howtos.html#endpoints-enable-tor-with-any-twisted-service The command-line would look something like: twistd web --port onion:...


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