ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/__pycache__/sockshandler.cpython-36.opt-1.pyc
3

2;Za@s"dZddlZyddlZddlZWn(ek
rHddljZddljZYnXddl	Z	ddZ
GdddejZGdddej
ZGd	d
d
ejejZedkrddlZyeejdZWneefk
rd
ZYnXejee	jdeZedejdjjedejdjjdS)z
SocksiPy + urllib2 handler

version: 0.3
author: e<e@tr0ll.in>

This module provides a Handler which you can use with urllib2 to allow it to tunnel your connection through a socks.sockssocket socket, with out monkey patching the original socket...
NcCs|j}|j||S)N)copyupdate)abdr"/usr/lib/python3.6/sockshandler.py
merge_dicts
r	c@seZdZdddZddZdS)SocksiPyConnectionNTc	Os*||||||f|_tjj|f||dS)N)	proxyargshttplibHTTPConnection__init__)	self	proxytype	proxyaddr	proxyportrdnsusernamepasswordargskwargsrrrrszSocksiPyConnection.__init__cCsPtj|_|jj|jt|jttfkr8|jj	|j|jj
|j|jfdS)N)
socks
socksocketsocksetproxyrtypetimeoutintfloat
settimeoutconnecthostport)rrrrr!s

zSocksiPyConnection.connect)NTNN)__name__
__module____qualname__rr!rrrrr
s
r
c@seZdZdddZddZdS)SocksiPyConnectionSNTc	Os*||||||f|_tjj|f||dS)N)rrHTTPSConnectionr)	rrrrrrrrrrrrr'szSocksiPyConnectionS.__init__cCs\tj}|j|jt|jttfkr2|j|j|j	|j
|jftj
||j|j|_dS)N)rrrrrrrrr r!r"r#sslZwrap_socketZkey_fileZ	cert_filer)rrrrrr!+szSocksiPyConnectionS.connect)NTNN)r$r%r&rr!rrrrr'&s
r'c@s$eZdZddZddZddZdS)SocksiPyHandlercOs||_||_tjj|dS)N)rkwurllib2HTTPHandlerr)rrrrrrr4szSocksiPyHandler.__init__csdfdd	}j||S)Nrcs(tj|}tj|||d|}|S)N)r"r#r)r	r+r
r)r"r#rrr+conn)rrrbuild:sz(SocksiPyHandler.http_open.<locals>.build)Nr)do_open)rreqr/r)rr	http_open9szSocksiPyHandler.http_opencsdfdd	}j||S)Nrcs(tj|}tj|||d|}|S)N)r"r#r)r	r+r'r)r"r#rrr+r.)rrrr/Asz)SocksiPyHandler.https_open.<locals>.build)Nr)r0)rr1r/r)rr
https_open@szSocksiPyHandler.https_openN)r$r%r&rr2r3rrrrr*3sr*__main__iZ#Z	localhostzHTTP: zhttp://httpbin.org/ipzHTTPS: zhttps://httpbin.org/ip) __doc__r)r,rImportErrorZurllib.requestZrequestZhttp.clientZclientrr	r
r
r(r'r-ZHTTPSHandlerr*r$sysrargvr#
ValueError
IndexErrorZbuild_openerZPROXY_TYPE_SOCKS5openerprintopenreaddecoderrrr<module>	s*