Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure a tor proxy on windows?

How do I configure a tor proxy on windows?

For example, I want to run the following python script through a tor proxy:

import requests

proxies = {
    'http':'socks5h://localhost:9050',
    'https':'socks5h:/localhost:9050'
}
url = 'someWebsite.onion'
res = requests.get(url, proxies=proxies)

On unix systems, you can simply run tor in terminal, but this doesn't seem to work on windows.

like image 850
Lord Elrond Avatar asked Apr 03 '19 14:04

Lord Elrond


People also ask

How do you configure a proxy server in Windows?

Select the Start button, then select Settings > Network & Internet > VPN. Select the VPN connection, then select Advanced options. Under VPN proxy settings, select the type of proxy setup you want to use, then enter the proxy server information for that VPN connection.

What is a Tor proxy?

What Is Tor? Tor is a free-to-use network of access points called nodes that work like proxies for your connection. It's also the name of the browser you use to connect to this network. When you use the Tor browser, your connection gets routed through several of these nodes before arriving at its end destination.

How do I configure Tor settings?

Go to the Preferences in Tor Browser. Select the Network Settings. See use the local IP address and port of the Tor network connection. These data must be inserted in the program Proxifier to the entire operating system, traffic was held in the Tor network.


2 Answers

navigate to \Tor Browser\Browser\TorBrowser\Data\Tor and edit torcc file

# ControlPort 9051
SocksPort 9051

Then restart tor.

Use tor proxy everywhere:

control panel -> network & internet -> internet options -> connection -> lan setting -> tick proxy server & goto advance & add:

proxy 127.0.0.1 port 9051

Use tor proxy in a browser like firefox:

options -> network setting -> tick Manual proxy configuration & add:

proxy 127.0.0.1 port 9051

Use with Python requests library:

import requests

proxies = {
    'http':'socks5://127.0.0.1:9051',
    'https':'socks5:/127.0.0.1:9051'
}
url = 'https://check.torproject.org/'
res = requests.get(url, proxies=proxies)

Note: You have to keep running tor browser for this

like image 153
Mohammed Younus Avatar answered Oct 10 '22 10:10

Mohammed Younus


Txtorcon and Stem are libraries developed by the Tor Project for controlling Tor from Python. Stem doesn't have any external dependencies. However, txtorcon allows one to launch Tor from Python, rather than just connect to a running instance.

Both of these libraries require a Tor binary already installed though. It is possible to use the Tor included with the Tor Browser Bundle, connecting on port 9150 (with control port of 9151).

Better yet though, you can download the "Expert Bundle" to get the Tor binary without any browser. The download for it is not currently linked from their new website, but the latest version can still be pulled from https://dist.torproject.org/torbrowser/. Navigate to a directory for either the alpha or stable version and search for "tor-win64-" (or "tor-win32-" if you need 32-bit).

like image 31
mttpgn Avatar answered Oct 10 '22 12:10

mttpgn