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: //opt/hc_python/lib/python3.12/site-packages/__pycache__/sockshandler.cpython-312.pyc

g~dZddlZddlZ	ddlZddlZddl
Z
dZdZe
ZGddejZGddej"ZGd	d
ej&ej(Zedk(rddlZ	eej2dZej:ee
j<deZe dejCdjEjGze dejCdjEjGzyy#e$rddlmZddlm	ZY wxYw#eef$rd
ZYwxYw)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...
NcH|j}|j||SN)copyupdate)abds   ;/opt/hc_python/lib/python3.12/site-packages/sockshandler.py
merge_dictrs	AHHQKHc	d|vr%tjtj|yd|vrtj|yy#YyxYw)N:.FT)socket	inet_ptonAF_INET6	inet_aton)ss r
is_iprsR
!8V__a0AXQ	s(AAA
ceZdZddZdZy)SocksiPyConnectionNcd||||||f|_tjj|g|i|yr)	proxyargshttplibHTTPConnection__init__	self	proxytype	proxyaddr	proxyportrdnsusernamepasswordargskwargss	         r
rzSocksiPyConnection.__init__+s4#Y	48T''>t>v>rc|j\}}}}}}|xr|tv}		tj|j|j
f|jd||||||tjtjdff
}	||_y#tj$rG}|r:dt|vr-t|jsd}tj|nYd}~nd}~wwxYw)N0x5bF)rsocks4_no_rdnssockscreate_connectionhostporttimeoutrIPPROTO_TCPTCP_NODELAYSOCKS4Errorstrraddsock)	rrr r!r"r#r$r5es	         r
connectzSocksiPyConnection.connect/sFJnnCIy$(7	7

..YY		*DLL$y)T8X((&*<*<a@BD	$$
Fc!f,U4995E!D"&&y12
sAB		C#=CC#NTNN__name__
__module____qualname__rr7rr
rr*s?rrceZdZddZdZy)SocksiPyConnectionSNcd||||||f|_tjj|g|i|yr)rrHTTPSConnectionrrs	         r
rzSocksiPyConnectionS.__init__Ds4#Y	48T((???rctj||jj|j|j
|_|jjsG|jr:	tj|jj|j
yyy#t$rE|jjtj|jjwxYw)N)server_hostname)rr7_contextwrap_socketr5r-check_hostname_check_hostnamesslmatch_hostnamegetpeercert	Exceptionshutdownr	SHUT_RDWRclose)rs r
r7zSocksiPyConnectionS.connectHs""4(MM--dii-S	}}++0D0D
""499#8#8#:DIIF1E+
		""6#3#34		!
s
/8B**AC8r8r9r=rr
r?r?Cs
@	rr?ceZdZdZdZdZy)SocksiPyHandlerc^||_||_tjj	|yr)r%kwurllib2HTTPHandlerr)rr%r&s   r
rzSocksiPyHandler.__init__Ts$	$$T*rc4dfd	}j||S)Ncftj|}tj|||d|}|SN)r-r.r/)rrRrr%r-r.r/r&rRconnrs      r
buildz(SocksiPyHandler.http_open.<locals>.buildZs3DGGV,B%tyyt$PW^[]^DKrNrdo_openrreqrZs`  r
	http_openzSocksiPyHandler.http_openY	||E3''rc4dfd	}j||S)Ncftj|}tj|||d|}|SrW)rrRr?r%rXs      r
rZz)SocksiPyHandler.https_open.<locals>.buildas3DGGV,B&		4QX_\^_DKrr[r\r^s`  r

https_openzSocksiPyHandler.https_open`rarN)r:r;r<rr`rdr=rr
rPrPSs+
((rrP__main__r(iZ#	localhostzHTTP: zhttp://httpbin.org/ipzHTTPS: zhttps://httpbin.org/ip)$__doc__rrHrSrImportErrorurllib.requestrequesthttp.clientclientr+rrsetr*rrrAr?rTHTTPSHandlerrPr:sysintargvr.
ValueError
IndexErrorbuild_openerPROXY_TYPE_SOCKS5openerprintopenreaddecoder=rr
<module>r{sH
"


//2'11 (g))7+?+?((z388A;"W
!
!/%2I2I;X\"]
^F	(V[[!89>>@GGI
IJ	)fkk":;@@BIIK
KLo"$!!"v

#s#D 9D8 D54D58	EE