Questions tagged [python]

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

Filter by
Sorted by
Tagged with
1 vote
2 answers
69 views

Sending data to hidden service without browser

So I have currently setup a hidden service to give me an onion address and the port it runs off is port 80 or 443. For some cybersecurity research I'm doing, I was initially going to setup an exit ...
user avatar
  • 113
0 votes
0 answers
34 views

Obfuscation to Interfere With Traffic Analysis

In contemplating traffic analysis, it occurred to me that having something generating extra legitimate (but irrelevant) traffic might help. To that end, I wrote a short Python script that: Takes one ...
user avatar
0 votes
2 answers
36 views

Tor "stem.connection.UnreadableCookieFile" error on scheduling python script on Airflow

I am using Apache Airflow to schedule my script. If I try to run the script from the terminal. stem is able to pickup the cookie file easily but If I try to run it via Airflow, it throws this error. ...
user avatar
  • 101
0 votes
1 answer
122 views

How to host TOR in remote server to use as proxy

I am doing web scraping, and I am using tor as my proxy service. I am using ubuntu 20.4.x and python 3.9. As I have installed tor in my local system, I am using: proxies = { 'http': 'socks5://127....
user avatar
0 votes
0 answers
599 views

Python Selenium with Tor Socks5 proxy

I am trying to use Selenium with Firefox to scarpe a Cloudflare protect web page. I am having issue when using with TOR, although i get a new ip address but it throws an error when I am trying to ...
user avatar
1 vote
0 answers
181 views

Python3 + Tor's stem library => Permission denied when creating new hidden service

I am trying to deploy a new hidden service using Tor's stem library for Python3, but I am always receiving errors that the service can not be created due to '[Errno 13] Permission denied' issue. I am ...
user avatar
  • 11
0 votes
1 answer
166 views

Can't connect to Tor with python 3.9

I'm trying to access my tor server with python with the module torpy, but it didn'y worked. It continue sayying that the server is not reachable, but with tor I can connect with it. I've tryied this ...
user avatar
1 vote
1 answer
46 views

Determining circuit tor client is using

One can get a list of circuits available for the tor client to use via the ControlPort. Here is the link to a python script someone wrote to get the list of circuits enter link description here Is it ...
user avatar
0 votes
1 answer
141 views

How do I reuse the onion address of a hidden service

I first want to generate a service and save the private key for reuse if one hasn't already been generated and saved, and if one has been generated and saved I want to be able to load it again if ...
user avatar
  • 1
1 vote
1 answer
740 views

Tor Browser failed to start under Selenium

Trying to connect to tor via selenium for the first time. Using Windows 7 64 ...Getting this error code.. selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with ...
user avatar
0 votes
1 answer
689 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 ...
user avatar
  • 1
0 votes
1 answer
228 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 ...
user avatar
0 votes
0 answers
79 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 ...
user avatar
  • 1
2 votes
2 answers
319 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 ...
user avatar
  • 23
0 votes
0 answers
408 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 ...
user avatar
0 votes
1 answer
1k 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://...
user avatar
2 votes
1 answer
2k 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:...
user avatar
  • 121
0 votes
1 answer
288 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 ...
user avatar
  • 1
0 votes
2 answers
202 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....
user avatar
0 votes
1 answer
67 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 ...
user avatar
0 votes
1 answer
3k 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 ...
user avatar
  • 1
1 vote
1 answer
664 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 ...
user avatar
1 vote
0 answers
304 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 ...
user avatar
0 votes
1 answer
11k 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 ...
user avatar
3 votes
1 answer
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 ...
user avatar
1 vote
1 answer
623 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?
user avatar
0 votes
1 answer
771 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 ...
user avatar
  • 33
3 votes
2 answers
600 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(...
user avatar
2 votes
1 answer
1k 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 ...
user avatar
2 votes
0 answers
471 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 ...
user avatar
4 votes
2 answers
742 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 ...
user avatar
4 votes
1 answer
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....
user avatar
0 votes
1 answer
286 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, ...
user avatar
1 vote
1 answer
124 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 ...
user avatar
  • 183
0 votes
1 answer
320 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 ...
user avatar
  • 11
2 votes
1 answer
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: ...
user avatar
3 votes
1 answer
240 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: ...
user avatar
  • 31
2 votes
1 answer
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 ...
user avatar
  • 1,274
3 votes
1 answer
1k 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 ...
user avatar
  • 1,274
2 votes
1 answer
268 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 ...
user avatar
2 votes
1 answer
224 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 ...
user avatar
  • 23
1 vote
1 answer
634 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-...
user avatar
  • 11
2 votes
2 answers
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 ...
user avatar
  • 71
1 vote
2 answers
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 ...
user avatar
1 vote
0 answers
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 ...
user avatar
2 votes
1 answer
713 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....
user avatar
  • 2,989
2 votes
1 answer
159 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 ...
user avatar
3 votes
1 answer
430 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 ...
user avatar
1 vote
1 answer
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','...
user avatar
2 votes
3 answers
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?
user avatar