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/lib64/python3.12/site-packages/__pycache__/socks.cpython-312.pyc

gny	ddlmZ	ddlmZddlmZmZm	Z	ddl
Z
ddlmZddl
Z
ddlZddlmZddlZddlZddlZdZej(dk(rej*d	kr	ddlZe
j.eZdxZZdxZZd
xZZeeedZ e!e"e jGe jIZ%ej xZ&Z'dZ(Gdde)Z*Gdde*Z+Gdde*Z,Gdde*Z-Gdde*Z.Gdde*Z/Gdde*Z0ddd d!Z1d"d#d$d%d&d'd(d)d*Z2ed+ed+ed,iZ3		d8d-Z4d.Z5d/Z6e6Z7d0Z8e8Z9					d9d1Z:Gd2d3ej Z;d4Z<d5D]AZe=e;edZ>e?e>ere;jjeeBe;ee<eCGd6d7e;ZCy#e$r
ddlmZYwxYw#e$r	ed
wxYw):)	b64encode)Callable)
EOPNOTSUPPEINVALEAGAINN)BytesIO)SEEK_CURz1.7.1nt)rz8To run PySocks on Windows you must install win_inet_ptonr)SOCKS4SOCKS5HTTPcBtjfd}|S)Nc|d}	|j}|dk(r|jd|i||dk(r|jdSS#t$r}d}~wwxYw#dk(r|jdwwxYw)NrTF)
gettimeoutsetblocking	Exception)argskwargsself_is_blockingefunctions     4/opt/hc_python/lib/python3.12/site-packages/socks.pywrapperz"set_self_blocking.<locals>.wrapper(sAw
	(??,Lq   &T,V,
q   '!			q   '!s#-A

	AAAAA8)	functoolswraps)rrs` rset_self_blockingr &s%__X((NceZdZdZddZdZy)
ProxyErrorz4Socket_err contains original socket.error exception.Ncn||_||_|r%|xjdj|z
c_yy)Nz: {})msg
socket_errformat)rr%r&s   r__init__zProxyError.__init__;s/$HH

j11Hr!c|jSN)r%rs r__str__zProxyError.__str__Bsxxr!r*)__name__
__module____qualname____doc__r(r,r!rr#r#9s>2r!r#ceZdZy)GeneralProxyErrorNr-r.r/r1r!rr3r3Fr!r3ceZdZy)ProxyConnectionErrorNr4r1r!rr7r7Jr5r!r7ceZdZy)SOCKS5AuthErrorNr4r1r!rr9r9Nr5r!r9ceZdZy)SOCKS5ErrorNr4r1r!rr;r;Rr5r!r;ceZdZy)SOCKS4ErrorNr4r1r!rr=r=Vr5r!r=ceZdZy)	HTTPErrorNr4r1r!rr?r?Zr5r!r?zRequest rejected or failedzLRequest rejected because SOCKS server cannot connect to identd on the clientzPRequest rejected because the client program and identd report different user-ids)[\]zGeneral SOCKS server failurez!Connection not allowed by rulesetzNetwork unreachablezHost unreachablezConnection refusedzTTL expiredz(Command not supported, or protocol errorzAddress type not supported)rr
ri8ic|||||r|jnd|r|jft_ydft_y)zSets a default proxy.

    All further socksocket objects will use the default unless explicitly
    changed. All parameters are as for socket.set_proxy().N)encode
socksocket
default_proxy)
proxy_typeaddrportrdnsusernamepasswords      rset_default_proxyrRss@!+D$5= 145= 1 IJCG IJr!cHd|vr|jd|d<t|i|SN	proxytyperL)poprR)rrs  rsetdefaultproxyrW~s-f%zz+6|d-f--r!c"tjS)z4Returns the default proxy, set by set_default_proxy.)rJrKr1r!rget_default_proxyrYs###r!cdtjrt|j_ytd)aAttempts to replace a module's socket library with a SOCKS socket.

    Must set a default proxy using set_default_proxy(...) first. This will
    only work on modules that import socket directly into the namespace;
    most of the Python Standard Library falls into this category.zNo default proxy specifiedN)rJrKsocketr3)modules rwrap_moduler]s%)

 <==r!c
	|\}
}|
jdr|
jd}
|r"|jdr|jd}d}tj||dtjD]}
|
\}}}}}d}	t|||}|	r|	D]}|j|t|ttfr|j||r|j|||||||r|j||j|
|f|cS|r|tjd#tjtf$r }|}|r|j!d}Yd}~d}~wwxYw)acreate_connection(dest_pair, *[, timeout], **proxy_args) -> socket object

    Like socket.create_connection(), but connects to proxy
    before returning the socket object.

    dest_pair - 2-tuple of (IP/hostname, port).
    **proxy_args - Same args passed to socksocket.set_proxy() if present.
    timeout - Optional socket timeout value, in seconds.
    source_address - tuple (host, port) for the socket to bind to as its source
    address before connecting (only for compatibility)
    [z[]Nrzgai returned empty list.)
startswithstripr[getaddrinfoSOCK_STREAMrJ
setsockopt
isinstanceintfloat
settimeout	set_proxybindconnecterrorr#close)	dest_pairtimeoutsource_addressrL
proxy_addr
proxy_port
proxy_rdnsproxy_usernameproxy_passwordsocket_optionsremote_hostremote_porterrrfamilysocket_typeproto	canonnamesasockoptrs                      rcreate_connectionrsa$ )Kc"!''-j++C0%%d+

C


J6;M;M
N451UIr	fk59D)C#DOOS)*'C<0(z:z:-~?		.)LL+{34K)O8	
,,1
22j)	C

		sBD**E#EE#c$eZdZdZdZeZy)_BaseSocketzBAllows Python 2 delegated methods such as send() to be overridden.ctj|g|i|t|_|jD]'}t|||j|<t
||)yr*)_orig_socketr(dict
_savedmethods
_savenamesgetattrdelattrrposkwnames    rr(z_BaseSocket.__init__sSd/S/B/!VOOD'.tT':Dt$D$$r!N)r-r.r/r0r(listrr1r!rrrsL Jr!rcfdS)Nc.|j|i|Sr*)rrs   r<lambda>z_makemethod.<locals>.<lambda>s$<D$6$6t$<c$HR$Hr!r1)rs`r_makemethodrs	HHr!)sendtosendrecvfromrecvcBeZdZdZdZejejdffd	ZdZ	fdZ
dZdZ		dd	Z
d
ZfdZfdZdfd
	Zdfd	ZdZfdZdZeZdZeZdZeZdZfdZdZdZdZdZ e!ee"ee#e iZ$e%dfd	Z&e%dZ'dZ(xZ)S) rJa2socksocket([family[, type[, proto]]]) -> socket object

    Open a SOCKS enabled socket. The parameters are the same as
    those of the standard socket init. In order for SOCKS to work,
    you must specify family=AF_INET and proto=0.
    The "type" argument must be either SOCK_STREAM or SOCK_DGRAM.
    Nrc6|tjtjfvrd}t|j	|tt||||g|i|d|_|jr|j|_
nd|_
d|_d|_d|_
y)Nz0Socket type must be stream or datagram, not {!r})NNNNNN)r[rc
SOCK_DGRAM
ValueErrorr'superrJr(
_proxyconnrKproxyproxy_socknameproxy_peername_timeout)rr{typer}rrr%	__class__s       rr(zsocksocket.__init__s**F,=,=>>DCSZZ-..
j$(uNtNvN++DJ=DJ""
r!cd}t||kr>|j|t|z
}|std||z
}t||kr>|S)zReceive EXACTLY the number of bytes requested from the file object.

        Blocks until the required number of bytes have been received.r!Connection closed unexpectedly)lenreadr3)rfilecountdatads     r_readallzsocksocket._readallsY$i%		%#d)+,A'(HIIAID	$i%
r!c||_	|j}tt||jy#t
j$rYywxYwr*)rget_proxy_peernamerrJrhr[rl)rropeerrs   rrhzsocksocket.settimeoutsF
	**,D*d.t}}=||		s-8A
Ac|jSr*)rr+s rrzsocksocket.gettimeout#s}}r!cN|r|jdy|jdy)Ng)rh)rvs  rrzsocksocket.setblocking&sOOD!OOC r!ct|||||r|jnd|r|jf|_ydf|_y)a Sets the proxy to be used.

        proxy_type -  The type of the proxy to be used. Three types
                        are supported: PROXY_TYPE_SOCKS4 (including socks4a),
                        PROXY_TYPE_SOCKS5 and PROXY_TYPE_HTTP
        addr -        The address of the server (IP or DNS).
        port -        The port of the server. Defaults to 1080 for SOCKS
                        servers and 8080 for HTTP proxy servers.
        rdns -        Should DNS queries be performed on the remote side
                       (rather than the local side). The default is True.
                       Note: This has no effect with SOCKS4 servers.
        username -    Username to authenticate with to the server.
                       The default is no authentication.
        password -    Password to authenticate with to the server.
                       Only relevant when username is also provided.N)rIr)rrLrMrNrOrPrQs       rrizsocksocket.set_proxy,s<"!$d+3hoo'+3hoo'?
9=?
r!cVd|vr|jd|d<|j|i|SrT)rVri)rrrs   rsetproxyzsocksocket.setproxyAs3& #)::k#:F< t~~t.v..r!c|j\}}}}}}|r|jtjk7rt	j
|g|i|S|jrtjtd|tk7rd}	tjt|	tt||i||j\}
}d|f}t	|_|j}
|jj|
d}|j!|j||\}
}|
\}}
|\}
}tt|?||ftt|G|j$d|_y)zVImplements proxy connection for UDP sockets.

        Happens during the bind() phase.z"Socket already bound to an addressz'UDP only supported by SOCKS5 proxy type0)0.0.0.0rN)rrr[rrrjrrlrrrrrJgetsockname_proxy_addrrk_SOCKS5_requestrhrr)rrrrLrqrrrOrPrQr%_rNdstr
UDP_ASSOCIATErelayhostrs                 rrjzsocksocket.bindFsA
ZZ	ZT8	TYY&*;*;;$$T6C6266??,,v'KLL;C,,z3//
j$$c0R0
""$4Dk&.  "&
''L5a4
j$'t5
j$*4==9,r!c|jtjk7rtt||g|i|S|js|jd|d}|dd}t}d}|j|d}|j||j||tt|.|j|zg|i|}	|	|jz
S)Nrs)rr[rrrJrrrjrwrite_write_SOCKS5_addressrgetvaluetell)rbytesrraddressflagsheaderRSV
STANDALONEsentrs          rrzsocksocket.sendtoks99)))T1%I$I&IIIIgr(Sb	S
Z ""7F3Z+FOO,=,E66.46fkkm##r!c|jtjk(r|j|||jfi|Stt|||fi|Sr*)rr[rrrrrJr)rrrrrs    rrzsocksocket.sendsN99)))4;;ueT-@-@KFKKT/uGGGr!c,|jtjk7rtt|||S|js|jdttt|'|dz|}|jdt|jd}t|rtd|j|\}}|j r4|j \}}||k7s|d|fvrtj"t$d|j|||ffS)Nrir
rzReceived UDP packet fragmentrzPacket filtered)rr[rrrJrrrjrrseekr	rordNotImplementedError_read_SOCKS5_addressrrlr)
rbufsizerbuffragfromhostfromportpeerhostpeerportrs
         rrzsocksocket.recvfroms99)))T3GUCCIIgeJ27T>5IJHxx{t9%&DEE!66s;(!%!4!4Hh8#x8}'Dll6+<==!Hh#788r!c0|j|i|\}}|Sr*)r)rrrrrs     rrzsocksocket.recvs  4==#,,qr!ct|jr|jjtt|Sr*)rrmrrJ)rrs rrmzsocksocket.closes*??OO!!#Z,..r!c|jS)z:Returns the bound IP address and port number at the proxy.)rr+s rget_proxy_socknamezsocksocket.get_proxy_socknames"""r!c"|jS)z>
        Returns the IP and port number of the proxy.
        )getpeernamer+s rrzsocksocket.get_proxy_peernames!!r!c|jS)zwReturns the IP address and port number of the destination machine.

        Note: get_proxy_peername returns the proxy.)rr+s rget_peernamezsocksocket.get_peernames"""r!cHd}|j|||\|_|_y)z7Negotiates a stream connection through a SOCKS5 server.N)rrr)r	dest_addrCONNECTs   r_negotiate_SOCKS5zsocksocket._negotiate_SOCKS5s)373G3G'94&0T0r!c |j\}}}}}}	|jd}
|jdd}	|r|	r|
jdn|
jd|
j|j	|d}|dddk7rtd	|ddd
k(r|r|	st
d|
jdtt|jz|ztt|	jz|	z|
j|j	|d}
|
dddk7rtd	|
ddd
k7r1t
d|ddd
k7r|dddk(rt
dtd	|
jd|zd
z|j||
}|
j|j	|d}|dddk7rtd	t|dd}|dk7r1tj|d}tdj|||j!|}t"t$|O|j(||f|j+|
j+S#|j+|
j+wxYw)z
        Send SOCKS5 request with given command (CMD field) and
        address (DST field). Returns resolved DST address that was used.
        wbrbrssr
r%SOCKS5 proxy server sent invalid datazPNo username/password supplied. Server requested username/password authenticationrrzSOCKS5 authentication failedz7All offered SOCKS5 authentication methods were rejectedr
Unknown error{:#04x}: {})rmakefilerflushrr3r9chrrrIrr
SOCKS5_ERRORSgetr;r'rrrJrhrrm)rconncmdrrLrMrNrOrPrQwriterreaderchosen_authauth_statusresolvedrespstatusrlbndrs                   rrzsocksocket._SOCKS5_requests
<@::8
D$ht$tQ'W	H01_-
LLN--2K1Q7*(;==
1Q7*!X*+<==Ws3x='9'@'@'BB'("3x=188:; (()"mmFA6q#w.+?AAq#w.)*HII
Qq!W,q#w.)$%%,?AA
LL30111#v>HLLN==+DAayG#';==a^F~%))&/B!-"6"6vu"EFF++F3C*d.t}}=c?LLNLLN
LLNLLNsHI++"J
c|\}}|j\}}}}}}	tjdtjdi}
tjtjfD]p}	tj||}|j|
||ztj||}|jtjd|||fcS|rI|jd}
|jdtt|
jz|
zntj||tjtjtj tj"}|d}|d}|dd}tj||}|j|
||ztj||}|jtjd|||fS#tj$rYwxYw)z~
        Return the host and port packed for the SOCKS5 protocol,
        and the resolved address as a tuple object.
        r>HidnarrrC)rr[AF_INETAF_INET6	inet_ptonr	inet_ntopstructpackrlrIrrrb	AF_UNSPECrcIPPROTO_TCP
AI_ADDRCONFIG)rrMrrrNrLrrOrPrQfamily_to_byter{
addr_bytes
host_bytes	addressestarget_addrs                rrz socksocket._write_SOCKS5_address s

d59ZZ2
Aq$( ..'6??GL
~~v7F
#--fd;


>&1J>?''
;

6;;tT23Tz!
8V,JJJwS_!5!<!<!>>KL**4v7G7G+1+=+=+1+=+=+1+?+?AI$A,K ^Fq>!$D))&$7JJJ~f-
:;##FJ7D

6;;tT*+Tz1<<

sA+G))H?Hc|j|d}|dk(r&tj|j|d}nx|dk(r.|j|d}|j|t|}nE|dk(r5tjtj
|j|d}nt
dtjd|j|d	d
}||fS)NrrrCrrrrr
r)	rr[	inet_ntoarrr
r3r
unpack)rratyprMlengthrNs      rrzsocksocket._read_SOCKS5_addressMs}}T1%7?##DMM$$:;D
W_]]4+F==s6{3D
W_##FOOT]]45LMD#$KLL}}T4==q#9:1=Tzr!ct|j\}}}}}}|jd}	|jdd}
	d}	tj|}|	j
tjddd	||	j
||r|	j
||	j
d
|r#|	j
|jdd
z|	j|j|
d}
|
dd	d
k7rtd
t|
d	d}|dk7r1tj|d}t!dj#||tj$|
ddtj&d|
dddf|_|rtj$||f|_n	||f|_|
j-|	j-y#tj$r3|rd}d}n(tjtj
|}YwxYw#|
j-|	j-wxYw)z0Negotiates a connection through a SOCKS4 server.rrrFsTz>BBHrCrrrrGz%SOCKS4 proxy server sent invalid datar
ZrrNr)rrr[	inet_atonrl
gethostbynamerr
rrIrrr3r
SOCKS4_ERRORSrr=r'rrrrrm)rr	dest_portrLrMrNrOrPrQrrremote_resolverrrrls                r_negotiate_SOCKS4zsocksocket._negotiate_SOCKS4\s;?::8
D$ht$tQ'4	"N	
9#--i8

LLVT4CDLL$X&LL!
Y--f5?@LLN==+DAayG#';==a^F~%))&/B!-"6"6vu"EFF$*#3#3DH#=#)==tAay#A!#D#FD&,&6&6z&BI&M#&/&:#LLNLLN_<<
9!4J%)N!'!1!1,,Y7"9J

9\
LLNLLNs0HGEHAHHHH"H7cj|j\}}}}}}|r|ntj|}d|jdzdzt	|jzdzd|jdzg}	|r%|r#|	jdt
|dz|zz|	jd|jdj|	|j}
|
j}|
j|std	|jd	d
\}}
}|jdstd
	t!|
}
|
dk7r&dj%|
|}|
dvr|dz
}t#|d|_||f|_y#t$rtdwxYw#t$rt#dwxYw)zwNegotiates a connection through an HTTP server.

        NOTE: This currently only supports HTTP CONNECT-style proxies.sCONNECT r:s	 HTTP/1.1sHost: sProxy-Authorization: basic s
r r
z'HTTP proxy server sent invalid responsezHTTP/z0Proxy server does not appear to be an HTTP proxyz4HTTP proxy server did not return a valid HTTP statusz{}: {})iiiza
[*] Note: The HTTP proxy server may not be supported by PySocks (must be a CONNECT tunnel proxy))s0.0.0.0rN)rr[r rIstrappendrsendalljoinrreadlinermr3splitrr`rfr?r'rr)rrr"rLrMrNrOrPrQhttp_headersfobjstatus_liner}status_code
status_msgrls                r_negotiate_HTTPzsocksocket._negotiate_HTTPs<@::8
D$h!yf&:&:9&E4;;v.
.
59~$$&')56	((00
 >"+HtOh,F"G!H
I	G$W\\,/0}}mmo

#$DEE	O-8->->sA-F*E;
(#BD
D	Hk*K
#OOK<Eo-$%E""-"Io1	O#$MNN	O	HFH
H	HsF>FFF2ct|dk7s|djdr!tjdt	|z|\}}|j
tjk(rK|js|jdtj|}|dk(r
|sd|_
y||f|_
y|j\}}}}}	}
t|ttfr t|dk7s|rt|tst!dt"t$|O|j(|:||_
t"t$|O|j(t"t$|W||fy|j-}	t"t$|W|	|j.|}||||y#tj$r%}|s|j1t!d	||d}~wt2$r|j1wxYw#tj$rn}|j1|sU|\}}d
j5||}
t6|}dj5||
}t8j;d||t=|||d}~wwxYw)
z
        Connects to the specified destination through a proxy.
        Uses the same API as socket's connect().
        To select the proxy server, use set_proxy().

        dest_pair - 2-tuple of (IP/hostname, port).
        r
rr_z PySocks doesn't support IPv6: %srrNz0Invalid destination-connection (host, port) pairzSocket errorz{}:{}zError connecting to {} proxy {}z
%s due to: %s)rr`r[rlr)rrrrjr rrrertuplerfr3rrJrhrrkr_proxy_negotiatorsrmr#r'PRINTABLE_PROXY_TYPESlogdebugr7)rrncatch_errorsrr"rLrqrrrOrPrQ	negotiaterlproxy_serverprintable_typer%rs                rrkzsocksocket.connectsYy>Q)A,"9"9#">,,A!$Y 01
1 )	999)))??		'",,Y7II%i&*#
(1)&<#ZZ	ZT8	9tUm4y>Q& !)S1#BD
D
	j$*4==9"+D*d.t}}=*d+Y	,BC%%'
#	*d+J7&
 33J?	$	95<<
 #JJL+NEBBK



9||
	JJL)3&
J&~~j*E!6z!B7>>~DPR		/36*366
	s10G2FG/1 GG/2I3A)I..I3c	|j|dy#t$r#}|jr|jcYd}~Sd}~wwxYw)a& https://docs.python.org/3/library/socket.html#socket.socket.connect_ex
        Like connect(address), but return an error indicator instead of raising an exception for errors returned by the C-level connect() call (other problems, such as "host not found" can still raise exceptions).
        T)r;rN)rkOSErrorerrno)rrnrs   r
connect_exzsocksocket.connect_ex6s?
		LLL6	wwww
	s	A=A=Ac||j\}}}}}}|xstj|}|std||fS)zD
        Return proxy address to connect to as tuple object
        zInvalid proxy type)r
DEFAULT_PORTSrr3)rrLrqrrrOrPrQs       rrzsocksocket._proxy_addrFsL
ZZ	ZT8	@=#4#4Z#@
#$899:%%r!NNNTNN)rr*)*r-r.r/r0rKr[r	rcr(rrhrrrirrjrrrrrmrgetproxysocknamergetproxypeernamerrrrrrr$r4rrrr7r rkrBr
__classcell__)rs@rrJrJsM$nn63E3E$
!EI*.?*/
#-J$(H9(/
#*"*#K&`D+Z
:x9.x"#4!#4ZZx

	&r!rJrE)	NNNNNTNNN)Dbase64rcollections.abcrImportErrorcollectionsrArrrriorloggingosr	r[r
sys__version__rversion_info
win_inet_pton	getLoggerr-r9PROXY_TYPE_SOCKS4rPROXY_TYPE_SOCKS5rPROXY_TYPE_HTTPrPROXY_TYPESrzipvalueskeysr8
_orgsocketrr IOErrorr#r3r7r9r;r=r?r!rrDrRrWrYgetdefaultproxyr]
wrapmodulerrrrmethodrerr*setattrrJr1r!r<module>rbs[%(-,	


77d?s''&0H
g!FF$64@S!3!3!5{7G7G7IJK"MM)
\&

	
		:		j		*		*		
	'!	
)
-




4
&	
vtT48
CG.2I.$$	>
482626:>%):3z
&--
I2D
[$
-Ffh'%%d+T;t#45
3^	&^	&[%$$%$HFH	HHsF-F?-F<;F<?G