Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

Python is a programming language. For Tor there is the Stem library.

0
votes
0answers
6 views

implementing tor stream isolation

I want to implement tor stream isolation using stem library. what approach is suitable for distinguishing between vast variety of streams that come to tor, by a socks user/pass basis. i need to be ...
0
votes
0answers
8 views

Wait until connection/ip changes

I found the following script to renew the IP of the tor deamon. from stem import Signal from stem.control import Controller with Controller.from_port(port = 9051) as controller: controller....
0
votes
1answer
24 views

Fetching JSON via Tor

Hi I am trying to make a code that monitors cryptocurrency prices, so I am fetching JSON data from public sources and then processing it. I am using this python code by @Anurag Uniyal: import urllib....
0
votes
0answers
28 views

Tor not starting w/ selenium drivers

my program that uses selenium driver to automate web tasks is not runnin, when i took the Tor default.profile and binary and overrided the firfox driver initialization, tor starts but gives me an ...
0
votes
0answers
35 views

actually hit the url with anonymous ip or is transparent to my real ip

i am using torrequest module from python. following is my code: from torrequest import TorRequest as tr t=tr() l=[] for i in range (100): t.reset_identity() t.get('https://url',headers=...
0
votes
0answers
88 views

Python implementation of Tor client

Are there any python implementation of Tor client ? I coded my python script and I would like to interact with hidden services (.onion) I'm not looking for something like that : socks....
0
votes
1answer
30 views

cert type 4, 5, 7 in cert cell

I'm working on a piece of code that will allow to me connect and pass tcp traffic through socket by implementing the TOR protocol. I'm currently working on certs cells, and there's a node that gives ...
0
votes
0answers
115 views

Safe way to access Internet on Tails with a python script?

I'm looking for a safe way to write a python script on Tails and make it access the Internet. Of course, Tails is supposed to block any outgoing Internet connection that doesn't go through Tor, so the ...
0
votes
1answer
602 views

Using Tor in a python script in Windows

I'm using the TorRequest library (https://github.com/erdiaker/torrequest) on Linux and it works fine, but I also need to run this script on Windows as well. In my distro, I installed only the tor ...
1
vote
1answer
212 views

I want upload a file to a ftp server using Tor proxy to comunicate with a Hidden Service [Python 3]

I have seen several ways using stem and socks but I could not connect to an FTP yet. #!/usr/bin/python3.5 import ftplib import os def upload(ftp, file): ext = os.path.splitext(file)[1] if ...
1
vote
0answers
128 views

Python JSON fetching via Socks5 proxy on Tails

I am trying to fetch JSON data, via a Python3 script, on Tails. I would like to know that this code is secure and doesn't leak IP or any other stuff. I know that Tails is configured to block any ...
0
votes
1answer
3k views

WinError 10061 No connection could be made because the target machine actively refused it

I started with TOR's STEM library and I am trying to make the following code work but can't figure out the reason for the error. Here's my code: import stem from stem.process import launch_tor from ...
3
votes
1answer
768 views

How many local concurrent Tor connections can I run?

I'm currently experimenting with Tor via the Stem python lib and using process.launch_tor_with_config() with a pool of processes, each using a different Control Port. However as I increase pool size ...
1
vote
1answer
343 views

Which python script allow me to know if tor is operational or not as a client?

Which stem python code would you suggest to determine whether tor is operational (bootstrapped at 100%) or not?
0
votes
0answers
36 views

How to sustitue tor browser functions “create a new tor circuit for this site” with a stem script [duplicate]

How can I substitue the functions create a new tor circuit for this site used in tor browser by a stem script (or controller commands) Thank you for your valuable answer.
0
votes
1answer
308 views

Selecting a middle node in Tor using Stem [closed]

I'm trying to learn my way around Tor and the Stem library for a class. My understanding is that the middle node is selected by tor and is unaccessible through Stem, however as part of the class I ...
2
votes
1answer
289 views

Cannot use get_ports() with stem modules

I am unable to use the function get_ports() with stem. It says # python get_ports.py OR [...] File "/usr/local/lib/python2.7/dist-packages/stem/socket.py", line 126, in send raise stem.SocketClosed(...
2
votes
1answer
350 views

Iterate through List of Exitnodes

I am working on some kind of Exitnode Scanner (Like SoaT from Mike Perry). I have downloaded the list of all running Exitnode-IPs and I want to use each IP to build a 3-hop-circuit (or connect ...
2
votes
0answers
238 views

Using Circuits in Parallel

Is there some easy method to use circuits in parallel in TOR using the STEM API. I wanted to use Website A for Circuit A and Website B for Circuit B. The problem is using threading the event listener ...
5
votes
2answers
329 views

How to reuse same .onion address with Tor ephemeral hidden services (python)?

I'm establishing an ephemeral hidden service via Tor, but I wish to reuse the same .onion address. I know to do this I must presist the same private-key every time I run the hidden service, but how do ...
4
votes
1answer
2k views

Using Tor to make HTTPS requests in Python

I have the following code: with Controller.from_port(port = 9151) as controller: controller.authenticate() socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127....
0
votes
0answers
221 views

Connecting to Tor via python stuck at 5%

I have a big problem, I am trying to connect to Tor using Python, but when it does it remains still at 5% that would be really great if you could help me. Here is my output Mar 20 23:24:04.000 [...
0
votes
0answers
425 views

Get TOR Status with python

is there a simple way to check if I am using TOR without opening the Browser and to the manual check on the tor website. I would need a solution in Python which is just able to return active or ...
0
votes
1answer
187 views

Tor Path Selection using Stem to choose middle node

Has anyone had luck selecting the middle node used within the path selection of tor using Stem? I am trying to set a specific set of routers (non public, so will have a different directory server, ...
1
vote
1answer
71 views

Version Mismatch Error with Onion-Py Library

I've been hunting around trying to figure out why Onion-Py is throwing this error. I had a fresh install and running python 2.7 onion_py.manager.MajorVersionMismatchError: Received OnionOO document ...
0
votes
1answer
221 views

How to get the number of HS descriptor requests using Stem?

I'm running a Tor relay on Linux which has the HSDir flag, meaning that it can host hidden service descriptors. I've been wondering, just out of curiosity whether it is possible to get some info about ...
2
votes
1answer
751 views

On Tails, using python urllib2

I want to support Tails users. My program is written in python, and I need to download something over Tor using python. When running python as the amnesia user, the following code does not work: ...
3
votes
1answer
147 views

Why is browser exit node different from Privoxy exit node?

I have Tor (bundle) browser and when I open this URL : http://ipecho.net/plain I get : 89.105.194.71 I set Privoxy in my Ubuntu to use Tor programmatically, but when I run my python code: ...
1
vote
1answer
907 views

Are there any effective traffic generation tools

One of the tactics discussed as a measure to defend against traffic correlation/timing attacks, is to have your Tor client sending traffic on a consistent basis. For example: If a client was always ...
3
votes
1answer
531 views

How to assign a stream to a circuit?

I have a Python script that is configured to connect to 4 different onion services (call them a, b, c, d), and return a value on a page. I'd like to ensure that I create separate circuits to connect ...
2
votes
1answer
180 views

Interacting with Tor cloud via python/stem

I'm new to Tor. I'm interested in setting up a Tor cloud (https://cloud.torproject.org/#get_started) on ec2, which looks straight forward. However besides surfing I want to use python, likely the stem ...
2
votes
1answer
154 views

Can the Tor network be used as a VPN?

Could you setup a VPN, but instead of using VPN servers, use the Tor network. That is, could you create a client that intercepts all your online packets and data (similarily to a VPN client) and ...
1
vote
1answer
356 views

scripting Tor browser with marionette

Does anybody know whether it is possible to script Tor Browser with Marionette (https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette)? If I pass the -marionette argument to start-tor-...
2
votes
2answers
1k views

(Stem) Multiple Exit Nodes - Changing ID not working?

I'm coding something in Python (Stem.) And I've hit a wall. I'm trying to get 2 relays working simultaneously, being able to change the identity independently for each one too. And I don't think the ...
1
vote
2answers
1k views

Communicating through Tor using Python

Are there any libraries that make it easier to do networking in Python using Tor? I'd like to be able to write IRC bots/clients and possibly use other networks, so none of the HTTP libraries which ...
1
vote
0answers
1k views

How to deal with RuntimeError: maximum recursion depth exceeded while calling a Python object?

This could be a very silly question, but I'm new to this topic and I couldn't figure out the problem after searching for a long time. It seems like I do have a Tor process listening. I tested it by ...
2
votes
1answer
309 views

How do I trap “circuit ID = None” errors in the Stem script “exit_used.py”?

Although the Stem script "exit_used.py" runs for a while, eventually it hits "Exception in thread Event Notifier" and stops. Traceback reports that the failing call is: File "/usr/local/lib/python2....
2
votes
1answer
137 views

Should TorBrowser 3.6 (aka Tor Browser Bundle) on OS X open an instance of Python?

I keep a terminal window open with nettop running in it. Yesterday I upgraded to TorBrowser 3.6 and today I just noticed in nettop that an instace of Python runs along side TorBrowser with active ...
3
votes
1answer
313 views

Tor doesn't work with urllib2

I am trying to use tor for anonymous access through privoxy as a proxy through urllib2. System info: Ubuntu 14.04, recently upgraded from 13.10 through dist-upgrade. This is a piece of code I am ...
1
vote
1answer
813 views

Circuit Creation Failed: “CHANNEL_CLOSED”

I'm trying to create circuits using the Stem library and I keep getting the following error ... controller.new_circuit(['711e9e5711a6e28e2a27de23b7c70c91d39908d0','...
2
votes
3answers
2k views

Is it possible to create a Tor Hidden Service in Python (Django) or Ruby (Rails)?

All the Tor Hidden Services seem to be written in PHP or just plain HTML. If this is possible, is there any reason not to do it? How would one go about doing it?
0
votes
0answers
2k views

Tried for 120 seconds to get a connection to [scrubbed]:6667 (waiting for controller)

I'm running some experiments using the stem library where I change circuit paths fairly frequently. Every so often, I get a stream detached event and a Socks5Error: 'TTL Expired' in my Python script, ...
6
votes
2answers
8k views

How to connect to a remote socket through Tor in Python?

Using normal sockets I can stream a list of numbers (updated every second) from a server to a client. This works perfectly fine. Now I want to do the same using Tor. Using Socksipy I am able to make ...