Questions tagged [python]
Python is a programming language. For Tor there is the Stem library.
53
questions
0
votes
1
answer
90
views
Python Port Scanner using TOR
I just want to know is it possible to scan ports on TOR network with python. I wrote a port scanner script but it keeps returning socket error. Why does it not work and any solutions?
import socket
...
0
votes
1
answer
30
views
Python APP that requests switching to clean circuits hangs when served with UWSIG but works when it runs from the command line
I have a python Flask application that serves a website and does a bunch of other things such as querying a database, displaying the results on the website...and also creating an instance of the Tor ...
0
votes
0
answers
163
views
How to use a specfic Tor middle node
I have a question related to Tor middle node. I already see some of the answers from here. But non of them is recent so I was thinking maybe some imporoment happen in Tor by now. I want to choose a ...
1
vote
2
answers
190
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 ...
0
votes
2
answers
110
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. ...
0
votes
1
answer
580
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....
1
vote
0
answers
289
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 ...
0
votes
1
answer
377
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 ...
1
vote
1
answer
115
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 ...
0
votes
1
answer
257
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 ...
1
vote
1
answer
1k
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 ...
0
votes
1
answer
976
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
1
answer
454
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
0
answers
111
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 ...
2
votes
2
answers
371
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
0
answers
617
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
1
answer
2k
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://...
2
votes
1
answer
3k
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
1
answer
436
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
2
answers
291
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
1
answer
70
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
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 ...
1
vote
1
answer
762
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
0
answers
345
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
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 ...
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 ...
1
vote
1
answer
693
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
1
answer
895
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 ...
3
votes
2
answers
609
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
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 ...
2
votes
0
answers
551
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
2
answers
866
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
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....
0
votes
1
answer
334
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
1
answer
137
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
1
answer
347
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
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:
...
3
votes
1
answer
256
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
1
answer
2k
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
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 ...
1
vote
1
answer
281
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
1
answer
250
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
1
answer
791
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
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 ...
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 ...
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 ...
2
votes
1
answer
819
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
1
answer
162
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
1
answer
449
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
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','...