tor

General SOCKS server failure when switching identity using stem

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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

Accessing youtube via stem (tor) gives unable to reach url error

匿名 (未验证) 提交于 2019-12-03 01:46:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have combined this example in stem with pytube to measure the time it takes for me to download a youtube video via Tor. Here's the code: import io import pycurl import stem . process from stem . util import term import pickle import socks # SocksiPy module import socket import urllib from pytube import YouTube import pdb import time import string import random SOCKS_PORT = 9050 # Set socks proxy and wrap the urllib module socks . setdefaultproxy ( socks . PROXY_TYPE_SOCKS5 , '127.0.0.1' , SOCKS_PORT ) socket . socket = socks .

How to use SOCKS proxies to make requests with aiohttp?

匿名 (未验证) 提交于 2019-12-03 01:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use aiohttp to make asynchronous HTTP requests over multiple SOCKS proxies. Basically, I am creating a pool of Tor clients with different IP addresses, and want to be able to route HTTP requests through them using aiohttp . Based on the suggestions here and here , I have been trying to use aiosocks , but the examples in those threads do not work (if they ever did) because they are based on an old version of aiosocks with a different API. Documentation and examples of using aiosocks online are very sparse (it doesn't seem

Stem is giving the “Unable to connect to port 9051” error

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried this example: import getpass import sys import stem import stem.connection from stem.control import Controller if __name__ == '__main__': try: controller = Controller.from_port() except stem.SocketError as exc: print("Unable to connect to tor on port 9051: %s" % exc) sys.exit(1) try: controller.authenticate() except stem.connection.MissingPassword: pw = getpass.getpass("Controller password: ") try: controller.authenticate(password = pw) except stem.connection.PasswordAuthFailed: print("Unable to authenticate, password is incorrect")

Is it possible to block Tor users?

人盡茶涼 提交于 2019-12-03 01:12:09
问题 Would it be possible to block Tor users? (https://www.torproject.org/) Due to the nature of the site I run I should do all I can to stop multiple accounts and block certain locations. Tor is worse than proxies - a total nightmare... 回答1: Tor is much easier to block than other open proxies since the list of exit IP addresses is known and published. Read the answer at https://www.torproject.org/docs/faq-abuse.html.en#Bans and if you still want to block users from accessing your site you could

Controlling Tor client with Ruby

﹥>﹥吖頭↗ 提交于 2019-12-03 00:16:25
I am writing a Ruby script which automatically crawls websites for data analysis, and now I have a requirement which is fairly complicated: I have to be able to simulate access from a variety of countries, about 20 different ones. The website will contain different information depending on the IP location, so the only way to get it done is to request it from a server which is actually in that country. Since I don't want to buy servers in each of those 20 countries, I chose to give Tor a try - as many of you will know, by editing the torrc configuration file it is possible to specify the exit

Using Tor proxy with scrapy

≯℡__Kan透↙ 提交于 2019-12-02 23:00:11
I need help setting up Tor in Ubuntu and to use it within scrapy framework. I did some research and found out this guide: class RetryChangeProxyMiddleware(RetryMiddleware): def _retry(self, request, reason, spider): log.msg('Changing proxy') tn = telnetlib.Telnet('127.0.0.1', 9051) tn.read_until("Escape character is '^]'.", 2) tn.write('AUTHENTICATE "267765"\r\n') tn.read_until("250 OK", 2) tn.write("signal NEWNYM\r\n") tn.read_until("250 OK", 2) tn.write("quit\r\n") tn.close() time.sleep(3) log.msg('Proxy changed') return RetryMiddleware._retry(self, request, reason, spider) then use it in

How to use Tor control protocol in C#?

自闭症网瘾萝莉.ら 提交于 2019-12-02 20:51:56
I'm trying to send commands to the Tor control port programmatically to make it refresh the chain. I haven't been able to find any examples in C#, and my solution's not working. The request times out. I have the service running, and I can see it listening on the control port. public string Refresh() { TcpClient client = new TcpClient("localhost", 9051); string response = string.Empty; string authenticate = MakeTcpRequest("AUTHENTICATE\r\n", client); if (authenticate.Equals("250")) { response = MakeTcpRequest("SIGNAL NEWNYM\r\n", client); } client.Close(); return response; } public string

Changing Tor identity in R

有些话、适合烂在心里 提交于 2019-12-02 18:16:16
I am using Tor in combination with R and would like to change my IP for each new request. The code I have is as follows: library(RCurl) opts <- list(proxy="127.0.0.1", proxyport=8118) for (i in 1:10) { con <- socketConnection(host="127.0.0.1",port=9051) # DOES NOT WORK writeLines("signal newnym", con=con) # DOES NOT WORK ip <- getURL("http://ifconfig.me/ip", .opts = opts) print(ip) Sys.sleep(1) } I am able to connect via Tor, however the two lines marked as 'DOES NOT WORK' don't seem to get the proper signal across to Tor, so the IP stays the same. Regards! I had a similar problem, but managed

Is it possible to block Tor users?

拥有回忆 提交于 2019-12-02 14:29:37
Would it be possible to block Tor users? ( https://www.torproject.org/ ) Due to the nature of the site I run I should do all I can to stop multiple accounts and block certain locations. Tor is worse than proxies - a total nightmare... Johan Nilsson Tor is much easier to block than other open proxies since the list of exit IP addresses is known and published. Read the answer at https://www.torproject.org/docs/faq-abuse.html.en#Bans and if you still want to block users from accessing your site you could use https://www.torproject.org/projects/tordnsel.html.en or the Bulk Exit List exporting tool