tor

Connect to .onion websites on tor using python?

蹲街弑〆低调 提交于 2019-11-29 13:44:00
Here is the code that i have till now import socks import socket import requests import json socks.setdefaultproxy(proxy_type=socks.PROXY_TYPE_SOCKS5, addr="127.0.0.1", port=9050) socket.socket = socks.socksocket data = json.loads(requests.get("http://freegeoip.net/json/").text) and it works fine. The problem is when i use a .onion url it shows error Failed to establish a new connection: [Errno -2] Name or service not known After researching a little i found that although the http request is made over tor the resolution still occours over clearnet. What is the proper way so i can also have the

How to control tor, when use tor proxy

て烟熏妆下的殇ゞ 提交于 2019-11-29 07:42:47
I'm trying to connect to a resource using a tor, changing identity. But after the first connection attempt to change identity causes an error. Code: import urllib2, socks, socket from stem import Signal from stem.control import Controller def newI(): with Controller.from_port(port=9051) as controller: controller.authenticate() controller.signal(Signal.NEWNYM) newI() socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050) socket.socket = socks.socksocket headers = {'User-Agent': 'Mozilla/3.0 (x86 [en] Windows NT 5.1; Sun)'} req = urllib2.Request('https://google.com', None, headers)

Block TOR Servers

空扰寡人 提交于 2019-11-29 05:10:55
I need a script that blocks TOR servers in php ... I need to get the list of servers and block them. Or, any solution to install on the server (centos). Here is more information about TorDNSEL https://www.torproject.org/projects/tordnsel.html.en and how to structure query. And below is function I found on the net that can perform dynamic checks. ( https://check.torproject.org/ must use something similar to this ). I am not sure about performance under heavier traffic. function IsTorExitPoint(){ if (gethostbyname(ReverseIPOctets($_SERVER['REMOTE_ADDR']).".".$_SERVER['SERVER_PORT']."."

Request new identity from Windows command line

限于喜欢 提交于 2019-11-29 04:38:20
问题 I'm trying to use a simple Windows Command Line command to change TOR identities. I see plenty of examples for Linux, but not sure how to implement the same thing on Windows. Anyone have any ideas? 回答1: To create a new circuit (switch IP addresses) on Windows without stopping and starting Tor, you need to open a connection to Tor's control port to issue a NEWNYM signal. Here is a batch file that will achieve this. You also need to download netcat for Windows and put nc.exe in the same folder

Python - Controlling Tor

左心房为你撑大大i 提交于 2019-11-29 03:00:20
问题 I'm attempting to control Tor with Python. I've read a couple of the other questions asked about this subject on stackoverflow but none of them answer this question. I'm looking for a method to have tor give you a 'new identity', a new IP address, when the command is run. I've googled around and found the TorCtl module as a method for controlling tor, but can't find a way to get a new identity. Here's what I have so far for atleast connecting to tor, but can't get any farther. from TorCtl

Python script Exception with Tor

我是研究僧i 提交于 2019-11-29 02:32:58
I have the following script which uses SocksiPY and Tor: from TorCtl import TorCtl import socks import socket socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050) socket.socket = socks.socksocket import urllib2 import sqlite3 from BeautifulSoup import BeautifulSoup def newId(): conn = TorCtl.connect(controlAddr="127.0.0.1", controlPort=9051, passphrase="123") TorCtl.Connection.send_signal(conn, "NEWNYM") newId() print(urllib2.urlopen("http://www.ifconfig.me/ip").read()) This code should change Tor identity but it waits for some time and gives the following error: tuple index out

Java Tor Lib : How to setup Orchid Tor Lib with Java?

别来无恙 提交于 2019-11-28 23:28:54
问题 I am trying to implement Orchid Tor lib with Java code; unfortunately and because the lack of documentation I am not able to make it work, this is what I did: .................... private final static String DEFAULT_SOCKS_PORT = "9050"; TorClient torClient = new TorClient(); torClient.addInitializationListener(new TorInitializationListener() { @Override public void initializationProgress(String string, int i) { System.out.println(">>> [ "+ i + "% ]: "+ string); // throw new

How to contribute on github anonymously via Tor?

无人久伴 提交于 2019-11-28 16:58:55
I would like to contribute anonymously to projects on github. Not to cause mischief, more in the spirit of anonymous donations. The tool of choice for being anonymous online seems to be TOR, which works well for almost anything you can do in a browser. However, to contribute on github, it appears necessary to use the command line interface, or the Mac app. How can I channel my git operations in this setup through Tor? And how can I verify that this is actually what is happening? Edit: please note the difference between pseudonymous (with a fake e-mail address) and anonymous (with an IP address

Doing http requests through a SOCKS5 proxy in NodeJS

浪子不回头ぞ 提交于 2019-11-28 16:00:13
问题 I'm planning to do a series of HTTP requests in NodeJS though Tor. Tor uses SOCKS5 so I went out and searched for a way to proxify HTTP requests in NodeJS. I'm planning to the the default http.request() function to do the work. However, I can't seem to find a way to use a proxy with that. Someone suggested that I could do this: var http = require("http"); var options = { host: "localhost", port: 9050, path: "http://check.torproject.org", method: 'GET', headers: { Host: "http://check

General SOCKS server failure when switching identity using stem

浪子不回头ぞ 提交于 2019-11-28 11:43:21
I have Tor running on a remote server (Ubuntu) on port 9150 with the control port on 9151. I've confirmed both are running via netstat -ant. Here is my code which is eliciting the SOCKS5Error: 0x01: General SOCKS server failure error. import socks import socket socks.set_default_proxy(socks.SOCKS5, server_ip, 9150) socket.socket = socks.socksocket I can make requests from any library and successfully get responses back with a tor ip address. However the following is what causes the error: from stem import Signal from stem.control import Controller with Controller.from_port(port = 9151) as