socks

cURL request using socks5 proxy fails when using PHP, but it works through the command line

≯℡__Kan透↙ 提交于 2019-12-05 04:25:37
cURL + proxy noob here, having a hard time. I'm having trouble trying to retrieve a web page from a remote secure server via a proxy. Everything has apparently been set up correctly by a remote dev, such that the following command line instruction works and returns what we're looking for: curl -k --socks5-hostname localhost:xxxx https://hostname/ However, the following PHP does not echo the requested webpage. Instead it echoes the error 'Couldn't resolve host name': $proxy = 'localhost:xxxx'; $url = 'https://hostname/'; //$proxyauth = 'user:password'; $ch = curl_init(); curl_setopt($ch,

Selenium chrome driver socks proxy configuration

蓝咒 提交于 2019-12-04 22:42:42
I am having troubles in setting socks proxy for chrome driver Proxy proxy = new Proxy(); proxy.setProxyType(Proxy.ProxyType.MANUAL); proxy.setAutodetect(false); proxy.setSocksProxy(ProxyHelper.PROXY_HOST + ":" + ProxyHelper.PROXY_PORT); DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilities.setCapability(CapabilityType.PROXY, proxy); WebDriver chromeDriver = new ChromeDriver(capabilities); This configuration gives: Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot parse capability: proxy from unknown error: proxyType is 'manual' but

Android Orbot malformed reply from SOCKS server

假装没事ソ 提交于 2019-12-04 21:59:15
I am trying to enable TOR support on my own XMPP app in android. I am using orbot as TOR proxy and I have the following code to connect app socket: socket = new Socket(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.1", 9050))); socket.connect(addr, Config.SOCKET_TIMEOUT * 1000); but I am getting Malformed reply from SOCKS server even that my Orbot is up and running. I believe that this error is thrown when app cant access proxy server or mentioned server is not SOCKS proxy. I have also tried to use jsocks: Socks5Proxy sProxy = new Socks5Proxy("127.0.0.1", 9050); sProxy

How to forward HTTPS traffic from a SOCKS proxy to HTTP proxy

我的未来我决定 提交于 2019-12-04 19:34:55
I have written a SOCKS proxy which works with both HTTP and HTTPS traffic if chaining is turned off. If chaining is turned on and the forwarding host and port belong to a filtering HTTP proxy then only HTTP traffic can flow. HTTPS traffic does not flow and reports an SSL error. Note that the HTTP proxy does handle HTTPS traffic when the request is coming direct from the browser and not from the SOCKS server. As an example if I make a request to https://www.google.com the following occurs: 1) Client sends a SOCKS 5 greeting to let us know which auth methods are acceptable. 2) Server responds

NodeJS CPU spikes to 100% one CPU at a time

我的未来我决定 提交于 2019-12-04 18:02:48
问题 I have a SOCKS5 Proxy server that I wrote in NodeJS. I am utilizing the native net and dgram libraries to open TCP and UDP sockets. It's working fine for around 2 days and all the CPUs are around 30% max. After 2 days with no restarts, one CPU spikes to 100%. After that, all CPUs take turns and stay at 100% one CPU at a time. Here is a 7 day chart of the CPU spikes: I am using Cluster to create instances such as: for (let i = 0; i < Os.cpus().length; i++) { Cluster.fork(); } This is the

Why Tor cant access localhost pages

拥有回忆 提交于 2019-12-04 17:44:29
问题 I have Tor running and a python script to get web pages: socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050) socket.socket = socks.socksocket print urllib2.urlopen(URL).read() However, if the URL is http://localhost/some_page.html I get the following error: raise Socks5Error(ord(resp[1]),_generalerrors[ord(resp[1])]) TypeError: __init__() takes exactly 2 arguments (3 given) Can someone explain to me what exactly happens? Thank you. 回答1: It is the way protocol is designed. When

Emulating SSH's SOCKS Proxy Tunnel in Python

天大地大妈咪最大 提交于 2019-12-04 16:34:15
I used to create a SOCKS connection between a windows client and linux server using SSH server and putty. However, the firewall between the client and server is now able to identify SSH packets and drop them. I was wondering if I can emulate such behavior of SSH tunnels using python? Any recommendations on libraries or readings? Thanks in advance. synthesizerpatel Yes, yes you can. Pick your poison. http://socksipy.sourceforge.net/ http://sourceforge.net/projects/pysocks/ http://code.google.com/p/socksipy-branch/ How can I use a SOCKS 4/5 proxy with urllib2? http://google-api-python-client

Send and receive via SOCKS5 c++

南楼画角 提交于 2019-12-04 10:38:21
I am playing with SOCKS5 proxy ( TOR ). I am able to estabilish connection but now I dont know how to send and receive data to/from destination. Thanks for help. Code: #include <stdio.h> #include <WinSock2.h> #include <stdlib.h> #pragma comment(lib,"ws2_32.lib") #define PUT_BYTE(ptr,data) (*(unsigned char*)ptr = data) int main() { WORD wVersionRequested = MAKEWORD(2,0); WSADATA wsaData; if(WSAStartup(wVersionRequested,&wsaData) != 0 ) { return 1; } int fd = socket( AF_INET, SOCK_STREAM, 0); if (fd < 0) return 1; struct sockaddr_in destaddr; destaddr.sin_addr.s_addr = inet_addr("xx.xx.xx.xx");

使用ssh正向连接、反向连接、做socks代理的方法

。_饼干妹妹 提交于 2019-12-04 09:45:12
使用ssh正向连接、反向连接、做socks代理的方法 Submitted by admin on Sat, 12/01/2012 - 20:54 Linux Network 来源地址: http://dzmailbox.blog.163.com/blog/static/120534385201232642637847/ 【原创】使用ssh正向连接、反向连接、做socks代理的方法 最近才发现ssh有多么的强大! 在网上搜了半天,发现大多数人都是一瓶子不满的水平,浅尝辄止。就没有几个人有点儿科学研究的精神吗?为啥不把它搞明白呢? 当然,相信有不少人是很明白的,但是不愿意写博文来公开。其实这样大可不必,独乐乐不如众乐乐,何必那么小肚鸡肠? 1、用ssh做正向连接 啥叫正向连接?就是client连上server,然后把server能访问的机器地址和端口(当然也包括server自己)镜像到client的端口上。 命令: ssh -L [客户端IP或省略]:[客户端端口]:[服务器侧能访问的IP]:[服务器侧能访问的IP的端口] [登陆服务器的用户名@服务器IP] -p [服务器ssh服务端口(默认22)] 其中,客户端IP可以省略,省略的话就是127.0.0.1了,也就是说只能在客户端本地访问。服务器IP都可以用域名来代替。 举例说明: 你的IP是192.168.1.2

Why do I get “SOCKS connection failed. Connection not allowed by ruleset” for some .onion sites?

耗尽温柔 提交于 2019-12-04 06:24:12
I'm experimenting with Node and socks5-https-client . For some reason, certain Tor hidden service ( .onion ) sites return with a connection error. For example, connecting to DuckDuckGo ( 3g2upl4pq6kufc4m.onion ) works and returns HTML. However, connecting to The Pirate Bay ( uj3wazyk5u4hnvtk.onion ) or TORCH ( xmh57jrzrnw6insl.onion ) returns... Error: SOCKS connection failed. Connection not allowed by ruleset. What does this error mean? How can I avoid it? Here's code to reproduce it: var shttps = require('socks5-https-client'); shttps.get({ hostname: '3g2upl4pq6kufc4m.onion', path: '',