Questions tagged [python]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
29 views

Cannot connect to my tcp tor hidden service in Python

I have a fully functional tor hidden service with his v3 url, created with stem and the controller class. The server is redirecting the traffic into a local tcp server running on port 5000 created ...
0
votes
1answer
32 views

Using stem with multithreading Python

I am trying to use two circuits in parallel with stem. In tor browser, two different websites use two different circuits. I am trying to get similar functionality in my python code. Here is what I am ...
0
votes
0answers
30 views

Integrating Tor Browser and Python to get the same circute

This is a cross post from my StackOverFlow question(also I little edited). Ok, my question is quite straightforward: I want to use Python to make automated requests with stem (or any other library ...
0
votes
0answers
11 views

Is there a way to republish tor descriptors?

How can I republish Tor hidden service's descriptors without re-running Tor. I did come across this link https://stem.torproject.org/tutorials/mirror_mirror_on_the_wall.html and used create(). But I ...
2
votes
1answer
62 views

how to make tor functions on Heroku

How can I make Tor functions on Heroku? I'm using tor as a proxy rotator along with my python project for web crawling. Everything works fine on localhost but I don't find how to make tor functions ...
0
votes
0answers
146 views

how to get ip address from onion url using python

I am trying to get ip address from darknet onion url. import subprocess import ipaddress for ip in ipaddress.IPv4Network('5.0.0.0/24'): subprocess.call(["tor-resolve", "-x", ip]) I am not getting ...
0
votes
1answer
297 views

Trying to pass TTL expired error: socks.SOCKS5Error: 0x06: TTL expired

Im trying to pass this error im getting while checking if sites are up with python: socks.SOCKS5Error: 0x06: TTL expired proxies = { 'http': 'socks5h://127.0.0.1:9050', 'https': 'socks5h://...
0
votes
0answers
151 views

WinError 10061 No Connection could be made because the target machine actively refused it - trying to switch IP

I'm trying to use STEM to rotate IPs and running into this error every time. Here's the code I'sm using: from stem import Signal from stem.control import Controller from selenium import webdriver ...
0
votes
1answer
989 views

How to check if Tor socks proxy is working programatically python?

I have installed Tor on a command-line only environment without the browser, Tor Socks Proxy is running on 9050. To check if the proxy code is running correctly i used: % curl --socks5 localhost:...
0
votes
1answer
155 views

The problem about stem's new_circuit and extend_circuit?

I have read the document of Stem. I notice that new_circuit() and extend_circuit() can create new circuit.However,I have two problems: I can't make sure when I create a new circuit, will the old ...
0
votes
2answers
130 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
1answer
59 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
1answer
2k 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
507 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
271 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
9k 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
2k 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
560 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
1answer
626 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
526 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
703 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
407 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 ...
4
votes
2answers
572 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
3k 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
1answer
251 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
109 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
277 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
1k 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
211 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: ...
2
votes
1answer
1k 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
948 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
255 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
186 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
528 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
2k 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
2k 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
2k 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
544 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
149 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
403 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
2k 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
3k 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
3k 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
11k 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 ...