4
votes
Accepted
How to assign a stream to a circuit?
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/...
3
votes
How to check if Tor socks proxy is working programatically python?
I personally wouldn't do this by getting a web page. It might depend on your use case but if you want to get status info about Tor you probably should get this info from the Tor control port (9051). ...
3
votes
I want upload a file to a ftp server using Tor proxy to comunicate with a Hidden Service [Python 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" ...
3
votes
Why is browser exit node different from Privoxy exit node?
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
votes
Accepted
Can the Tor network be used as a VPN?
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 ...
3
votes
Accepted
How do I trap "circuit ID = None" errors in the Stem script "exit_used.py"?
Thanks for the catch! Fixed...
https://gitweb.torproject.org/stem.git/commitdiff/f46974987106e3246482158e009491faa07bbae4
2
votes
Interacting with Tor cloud via python/stem
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 ...
2
votes
Accepted
Tor doesn't work with urllib2
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 ...
2
votes
Accepted
Iterate through List of Exitnodes
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 ...
2
votes
Communicating through Tor using Python
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 ...
2
votes
Accepted
cert type 4, 5, 7 in cert cell
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 ...
2
votes
Accepted
Determining circuit tor client is using
Tor clients keep a pool of circuits and may use several circuits simultaneously for streams depending on factors such as exit policies, stream isolation, etc. So there is generally not a single "...
2
votes
On Tails, using python urllib2
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 ...
1
vote
Accepted
Sending data to hidden service without browser
I would have your python script call torsocks curl and let curl do the hard work of connecting to the onion service rather than trying to code the same thing in python.
For example:
torsocks curl ...
1
vote
Accepted
how to make tor functions on Heroku
@lmen is probably talking about Tor Proxy Buildpack for Heroku, it can setup Tor on a heroku node with socks5 and control port available (They can be configured in the environment values).
All you ...
1
vote
Trying to pass TTL expired error: socks.SOCKS5Error: 0x06: TTL expired
proxies = {
'http': 'socks5h://127.0.0.1:9050',
'https': 'socks5h://127.0.0.1:9050'
socks proxies are not the same as http/https proxies. You can't interchange the two. you will need to use a ...
1
vote
The problem about stem's new_circuit and extend_circuit?
Yes, you will then have two circuits, and it will take some time for the previous circuit to be automatically cleaned up. A Stem controller does have a close_circuit(id) function you can use to close ...
1
vote
Fetching JSON via Tor
If you have VM setup with all network traffic routed through tor then you do not need to run torsocks.
1
vote
Using Tor in a python script in Windows
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)
...
1
vote
WinError 10061 No connection could be made because the target machine actively refused it
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 ...
1
vote
Accepted
Which python script allow me to know if tor is operational or not as a client?
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 '^]'.
...
1
vote
How to reuse same .onion address with Tor ephemeral hidden services (python)?
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 ...
1
vote
Using Tor to make HTTPS requests in Python
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 = ...
1
vote
Tor Path Selection using Stem to choose middle node
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
vote
Accepted
Version Mismatch Error with Onion-Py Library
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 --...
1
vote
How to get the number of HS descriptor requests using Stem?
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 = ...
1
vote
Is it possible to create a Tor Hidden Service in Python (Django) or Ruby (Rails)?
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....
1
vote
scripting Tor browser with marionette
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
...
1
vote
Accepted
(Stem) Multiple Exit Nodes - Changing ID not working?
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 ...
1
vote
(Stem) Multiple Exit Nodes - Changing ID not working?
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
python × 52stem × 22
circuit × 7
tor-browser-bundle × 6
torsocks × 6
socks × 6
configuration × 4
onion-services × 4
anonymity × 3
https × 3
stream-isolation × 3
relays × 2
tails × 2
exit-relays × 2
onion-routing × 2
linux × 2
tor-install × 2
connection × 2
client × 2
url × 2
security × 1
windows × 1
mac × 1
proxy × 1
vpn × 1