/opt/alt/python37/lib/python3.7/site-packages/__pycache__
NameSizeModeActions
docopt.cpython-37.pyc209280644editdlrm
editor.cpython-37.pyc26220644editdlrm
prettytable.cpython-37.opt-1.pyc443060644editdlrm
prettytable.cpython-37.pyc449400644editdlrm
schema.cpython-37.opt-1.pyc243290644editdlrm
schema.cpython-37.pyc243290644editdlrm
six.cpython-37.opt-1.pyc268710644editdlrm
six.cpython-37.pyc268710644editdlrm
socks.cpython-37.opt-1.pyc214550644editdlrm
socks.cpython-37.pyc214550644editdlrm
socks.cpython-311.pyc357510644editdlrm
sockshandler.cpython-37.opt-1.pyc37130644editdlrm
sockshandler.cpython-37.pyc37130644editdlrm
typing_extensions.cpython-37.opt-1.pyc694490644editdlrm
typing_extensions.cpython-37.pyc697150644editdlrm
zipp.cpython-37.opt-1.pyc100620644editdlrm
zipp.cpython-37.pyc100620644editdlrm
Edit: /opt/alt/python37/lib/python3.7/site-packages/__pycache__/socks.cpython-311.pyc (35751B)
"@Wu dZdZddlZddlZddlmZmZmZddlm Z ddl m Z ddl m Z ddlmZd xZZd xZZd xZZeeed ZeeeeZejxZZGd deZGddeZ GddeZ!GddeZ"GddeZ#GddeZ$GddeZ%ddddZ&dd d!d"d#d$d%d&d'Z'ed(ed(ed)iZ(d5d+Z)e)Z*d,Z+e+Z,d-Z-e-Z. d6d.Z/Gd/d0ejZ0d1Z1d2D]KZ2e3e0e2dZ4e5e4e s0e0j67e2e8e0e2e1e2LGd3d4e0Z9dS)7a SocksiPy - Python SOCKS module. Version 1.5.7 Copyright 2006 Dan-Haim. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Dan Haim nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY DAN HAIM "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAN HAIM OR HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. This module provides a standard socket-like interface for Python for tunneling connections through SOCKS proxies. =============================================================================== Minor modifications made by Christopher Gilbert (http://motomastyle.com/) for use in PyLoris (http://pyloris.sourceforge.net/) Minor modifications made by Mario Vilas (http://breakingcode.wordpress.com/) mainly to merge bug fixes found in Sourceforge Modifications made by Anorov (https://github.com/Anorov) -Forked and renamed to PySocks -Fixed issue with HTTP proxy failure checking (same bug that was in the old ___recvall() method) -Included SocksiPyHandler (sockshandler.py), to be used as a urllib2 handler, courtesy of e000 (https://github.com/e000): https://gist.github.com/869791#file_socksipyhandler.py -Re-styled code to make it readable -Aliased PROXY_TYPE_SOCKS5 -> SOCKS5 etc. -Improved exception handling and output -Removed irritating use of sequence indexes, replaced with tuple unpacked variables -Fixed up Python 3 bytestring handling - chr(0x03).encode() -> b"" -Other general fixes -Added clarification that the HTTP proxy connection method only supports CONNECT-style tunneling HTTP proxies -Various small bug fixes z1.5.7N) EOPNOTSUPPEINVALEAGAIN)BytesIO)SEEK_CUR)Callable) b64encode)SOCKS4SOCKS5HTTPc eZdZdZddZdZdS) ProxyErrorz> socket_err contains original socket.error exception. Ncp||_||_|r%|xjd|z c_dSdS)Nz: {0})msg socket_errformat)selfrrs 6/opt/alt/python37/lib/python3.7/site-packages/socks.py__init__zProxyError.__init__NsB$  3 HHz22 2HHHH 3 3c|jSN)rrs r__str__zProxyError.__str__Us xrr)__name__ __module__ __qualname____doc__rrrrrrJsA3333rrceZdZdS)GeneralProxyErrorNrrr r"rrr$r$Xrr$ceZdZdS)ProxyConnectionErrorNr%r"rrr(r(Yr&rr(ceZdZdS)SOCKS5AuthErrorNr%r"rrr*r*Zr&rr*ceZdZdS) SOCKS5ErrorNr%r"rrr,r,[r&rr,ceZdZdS) SOCKS4ErrorNr%r"rrr.r.\r&rr.ceZdZdS) HTTPErrorNr%r"rrr0r0]r&rr0zRequest 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 refusedz TTL expiredz(Command not supported, or protocol errorzAddress type not supported)r r r i8iTc|||||r|nd|r|ndft_dS)z set_default_proxy(proxy_type, addr[, port[, rdns[, username, password]]]) Sets a default proxy which all further socksocket objects will use, unless explicitly changed. All parameters are as for socket.set_proxy(). N)encode socksocket default_proxy) proxy_typeaddrportrdnsusernamepasswords rset_default_proxyrCssL!+D$5= G 1 1 145= G 1 1 14 IJrctjS)z> Returns the default proxy, set by set_default_proxy. )r;r<r"rrget_default_proxyrEs   ##rc^tjrt|j_dStd)a" Attempts 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)r;r<socketr$)modules r wrap_modulerIs.>)  <===rc |\} } | dr| d} |r*|dr|d}d} tj||dtjD]} | \}}}}}d} t |||}| | D] }|j| t|ttfr| ||| |||||||| || | | f|cS#tj$r$}|} ||d}Yd}~d}~wwxYw| | tjd)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.) startswithstriprG getaddrinfo SOCK_STREAMr; setsockopt isinstanceintfloat settimeout set_proxybindconnecterrorclose) dest_pairr= proxy_addr proxy_port proxy_rdnsproxy_usernameproxy_passwordtimeoutsource_addresssocket_options remote_host remote_porterrrfamily socket_typeproto canonnamesasockoptes rcreate_connectionros" )Kc"".!''-- ,j++C00,%%d++ C  J6;M N N451 UIr fk599D))**C#DOS)))'C<00 )(((%z:z:-~???) .))) LL+{3 4 4 4KKK|   C      ,1 2 22s BD--E <EE c,eZdZdZdZeZdS) _BaseSocketzJAllows Python 2's "delegated" methods such as send() to be overridden ctj|g|Ri|t|_|jD]*}t |||j|<t ||+dSr) _orig_socketrdict _savedmethods _savenamesgetattrdelattrrposkwnames rrz_BaseSocket.__init__std/S///B///!VVO  D'.tT':':D t $ D$      rN)rrr r!rlistrvr"rrrqrqs4   JJJrrqcfdS)Nc*|j|i|Sr)rurys rz_makemethod..s$ 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. Nrc|tjtjfvr$d}t||t j||||g|Ri|d|_|jr |j|_ nd|_ d|_ d|_ dS)Nz0Socket type must be stream or datagram, not {!r})NNNNNN) rGrO SOCK_DGRAM ValueErrorrrqr _proxyconnr<proxyproxy_socknameproxy_peername)rrgtyperiargskwargsrs rrzsocksocket.__init__s *F,=> > >DCSZZ--.. .T64HHHHHHH   >+DJJ=DJ""rcd}t||krN||t|z }|std||z }t||kN|S)z Receive EXACTLY the number of bytes requested from the file object. Blocks until the required number of bytes have been received. rConnection closed unexpectedly)lenreadr$)rfilecountdatads r_readallzsocksocket._readallsq $ii% %#d))+,,A J'(HIII AID $ii%  rTcx|||||r|nd|r|ndf|_dS)aset_proxy(proxy_type, addr[, port[, rdns[, username[, password]]]]) 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)r:r)rr=r>r?r@rArBs rrUzsocksocket.set_proxysH$!$d+3=hoo'''+3=hoo'''? rc|j\}}}}}}|r|jtjkrt j|g|Ri|S|jrtjtd|tkrd} tjt| tj|g|Ri|| \} } d| f} t |_| } |j| d}||j|| \} }| \}} |\} } t||| fd|_dS)zm Implements proxy connection for UDP sockets, which happens during the bind() phase. z"Socket already bound to an addressz'UDP only supported by SOCKS5 proxy type0)0.0.0.0rN)rrrGrrsrVrrXrrrrq getsockname _proxy_addrrW_SOCKS5_requestr)rrzr{r=r[r\r@rArBr_r?dstr UDP_ASSOCIATErelayhosts rrVzsocksocket.bind*sc HLzD J D(H 7TY&*;;;$T6C666266 6 ? M,v'KLL L   ;C,z3// /****r*** ""$$4Dk&..  "" &&& ''LL5a4D4,///,rc|jtjkrtj||g|Ri|S|js|d|d}|dd}t}d}||d}||| ||tj || |zg|Ri|} | | z S)Nrs) rrGrrqrrrVrwrite_write_SOCKS5_addressrgetvaluetell) rbytesrraddressflagsheaderRSV STANDALONEsents rrzsocksocket.sendtoNs 9) ) )%dECDCCCFCC C  IIg   r(SbS  S  Z    ""7F333foo&7&7%&?R%RRR6RRfkkmm##rc ~|jtjkr|j|||jfi|St j|||fi|Sr)rrGrrrrqr)rrrrs rrzsocksocket.sendasP 9) ) )4;ueT-@KKFKK K#D%AA&AA ArcX|jtjkrt|||S|js|dtt|||}| dt| d}t|rtd||\}}|jr0|j\}}||ks|d|fvrtjt"d| ||ffS)Nrr r zReceived UDP packet fragmentrzPacket filtered)rrGrrqrrrVrrseekrrordNotImplementedError_read_SOCKS5_addressrrXr) rbufsizerbuffragfromhostfromportpeerhostpeerports rrzsocksocket.recvfromgs 9) ) )''gu== =  IIg   k&&tWe<<== Xxx{{ t99 F%&DEE E!66s;;(   >!%!4 Hh8##x8}'D'Dl6+<=== Xx011rc&|j|i|\}}|Sr)r)rrzr{rrs rrzsocksocket.recv{s! 4=#,,,q rcv|jr|jt|Sr)rrYrqrs rrYzsocksocket.closes4 ? $ O ! ! # # #  &&&rc|jS)zL Returns the bound IP address and port number at the proxy. )rrs rget_proxy_socknamezsocksocket.get_proxy_socknames ""rc6t|S)z> Returns the IP and port number of the proxy. )rq getpeernamers rget_proxy_peernamezsocksocket.get_proxy_peernames&&t,,,rc|jS)z Returns the IP address and port number of the destination machine (note: get_proxy_peername returns the proxy) )rrs r get_peernamezsocksocket.get_peernames ""rcRd}||||\|_|_dS)zI Negotiates a stream connection through a SOCKS5 server. N)rrr)r dest_addrCONNECTs r_negotiate_SOCKS5zsocksocket._negotiate_SOCKS5s6373G3G Y4 4 0T000rc0|j\}}}}}} |d} |dd} |r| r| dn| d| || d} | dddkrt d | ddd kr| d t t|z|zt t| z| z| || d} | ddd krt d | ddd krtd n:| ddd kr,| dddkrtdt d | d|zd z| || }| || d}|dddkrt d t|dd}|dkr>t |d}td|||| }||f| | S#| | 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 datarrzSOCKS5 authentication failedz7All offered SOCKS5 authentication methods were rejectedr Unknown error {0:#04x}: {1})rmakefilerflushrr$chrrr:r*rr SOCKS5_ERRORSgetr,rrrY)rconncmdrr=r>r?r@rArBwriterreader chosen_auth auth_statusresolvedrespstatusrXbnds rrzsocksocket._SOCKS5_requests <@:8 D$ht$$tQ''G  .H . 01111 _--- LLNNN--22K1Q37**((OPPP1Q37** Ws3x=='9'9'@'@'B'BB'("3x==1188::; (())) "mmFA66 qs#w..+,STTTqs#w..)*HIII/QqS!W,,qs#w..)*cddd+,STTT LL30 1 1 111#v>>H LLNNN==++DAaCyG##'(OPPPac^^F~~%))&/BB!/"8"8"G"GHHH++F33Cc? LLNNN LLNNNN LLNNN LLNNNNs JK++*Lc |\}}|j\}}}}}} tjdtjdi} tjtjfD]} tj| |} || | | ztj| | }|tjd|||fcS#tj $rYwxYw|r]| d} |dtt|  z| zntj ||tjtjtjtj}|d}|d} |dd}tj| |} || | | ztj| | }|tjd|||fS)z~ Return the host and port packed for the SOCKS5 protocol, and the resolved address as a tuple object. r>Hidnarrr4)rrGAF_INETAF_INET6 inet_ptonr inet_ntopstructpackrXr:rrrN AF_UNSPECrO IPPROTO_TCP AI_ADDRCONFIG)rr>rrr?r=rr@rArBfamily_to_byterg addr_bytes host_bytes addresses target_addrs rrz socksocket._write_SOCKS5_addresss  d59Z2 Aq$( .'6?GL ~v7  F #-fd;;  >&1J>???' ;; 6;tT22333Tz!!!<      8V,,J JJwS__!5!5!!>>K L L L L*4v7GI[]c]oqwrFGGI$A,K ^Fq>!$D)&$77J JJ~f- : ; ; ;#FJ77D 6;tT**+++Tzs A3B??CCc||d}|dkr)tj||d}n|dkr:||d}||t|}nI|dkr4tjtj||d}nt dtjd||d d }||fS) Nr rr4rrrrr r) rrG inet_ntoarrrr$runpack)rratypr>lengthr?s rrzsocksocket._read_SOCKS5_address!s}}T1%% 7??#DMM$$:$:;;DD W__]]4++F==s6{{33DD W__#FOT]]45L5LMMDD#$KLL L}T4==q#9#9::1=Tzrc"|j\}}}}}}|d} |dd} d} tj|} nB#tj$r0|rd} d} n&tjtj|} YnwxYw| tjddd || | |r| || d | r+| | d d z| | | d } | dd d krtd t| d d}|dkr>t|d}t!d||tj| ddtjd| dddf|_| rtj| |f|_n ||f|_| | dS#| | wxYw)zB Negotiates a connection through a SOCKS4 server. rrrFsTz>BBHr4r rrr8z%SOCKS4 proxy server sent invalid datar ZrrNr)rrrG inet_atonrX gethostbynamerrrr:rrr$r SOCKS4_ERRORSrr.rrrrrrY)rr dest_portr=r>r?r@rArBrrremote_resolverrrrXs r_negotiate_SOCKS4zsocksocket._negotiate_SOCKS40s<@:8 D$ht$$tQ''1 "N S#-i88 < S S SS!4J%)NN!'!1&2Fy2Q2Q!R!RJ  S LLVT4CC D D D LL $ $ $ ' X&&& LL ! ! !  A Y--f55?@@@ LLNNN==++DAaCyG##'(OPPPac^^F~~%))&/BB!/"8"8"G"GHHH$*#3DH#=#=v}TSWXYZ[X[S\?]?]^_?`"aD  ;&,&6z&B&BI&M##&/&:# LLNNN LLNNNNN LLNNN LLNNNNs/I$AI$r?r@rArB http_headersfobj status_lineri status_code status_msgrXs r_negotiate_HTTPzsocksocket._negotiate_HTTPks] <@:8 D$h!Eyyf&:9&E&E $++f-- - 4s9~~7L7L7N7N NQ] ]  ((00 0  h h    >8VZ?]eKeAfAf f g g gG$$$ W\\,//000}}mmoo   F#$DEE E O-8->->sA-F-F *E;  O O O#$MNN N O(( X#$VWW W Tk**KK T T TRSS S T #  %%k:>>Eo-->?E"" "-"Ios9EE.F&&Gct|dks|ddrtjd|\}}|jtjkrK|js|dtj|}|dkr |sd|_ n ||f|_ dS|j \}}}}}} t|ttfr*t|dks|rt|tstd|&||_ t |||fdS|} t || |j|} | |||dS#tj$r)} |td | d} ~ wt*$r|wxYw#tj$rg} ||\}}d ||} t.|} d | | }t1|| 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 rrKzPySocks doesn't support IPv6rrNz0Invalid destination-connection (host, port) pairz Socket errorz{0}:{1}z!Error connecting to {0} proxy {1})rrLrGrXrrrrVrrrrQr}tuplerRr$rqrWr_proxy_negotiatorsrYrrPRINTABLE_PROXY_TYPESr()rrZrrr=r[r\r@rArB negotiaterX proxy_serverprintable_typers rrWzsocksocket.connects y>>Q  )A,"9"9#">"> ,=>> >( 9 9) ) )? # '""",Y77II%%i%&*##'0)&<# FGKzD J D(H9tUm44 Xy>>Q&& '!)S11'$$VWW W  "+D    y)&< = = = F%%''     j 1 1 1  3J?  $ 955555< ? ? ? '>>>     +| 3 3 3 JJLLL%/ "J $++J CCL2:>N5<<^;GIIC&sE22 2 3s1G$FG$F33#GI(A"I  Ic|j\}}}}}}|pt|}|std||fS)zD Return proxy address to connect to as tuple object zInvalid proxy type)r DEFAULT_PORTSrr$)rr=r[r\r@rArBs rrzsocksocket._proxy_addrsTHLzD J D(H@=#4#4Z#@#@  :#$899 9:%%rNNNTNN)r)$rrr r!r<rGrrOrrrUsetproxyrVrrrrrYrgetproxysocknamergetproxypeernamerrrrrrr rr rrrrWrr"rrr;r;sM$n63EQ # # # #   ????,H"-"-"-H$$$&BBBB 2222(''' ### *--- *###K   PPPd(((T   999v4.4.4.n"#4!#4KKKZ&&&&&rr;r#) NNNTNNNNN):r! __version__rGrerrnorrriorosr collectionsrbase64r PROXY_TYPE_SOCKS4r PROXY_TYPE_SOCKS5rPROXY_TYPE_HTTPr PROXY_TYPESrtzipvalueskeysr _orgsocketrsIOErrorrr$r(r*r,r.r0rrr"rCsetdefaultproxyrEgetdefaultproxyrI wrapmodulerorqrr|rwmethodrQrvrsetattrr;r"rrr;sr44l ,,,,,,,,,, FF$64@@ SS!3!3!5!5{7G7G7I7IJJKK"M) \        *)))) ))),,,,,:,,,'''''j'''#####*########*###!!!!! !!!4fj 7;-*,%B4 $$ I I I I$$$$ $ > > > =A26:>37%) 93939393v     &-   III 2 6 6D W[$ - -F :fh ' '6%%d+++ T;;t#4#4555R&R&R&R&R&R&R&R&R&R&r