⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.144
Server IP:
157.245.143.252
Server:
Linux www 6.11.0-9-generic #9-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 14 13:19:59 UTC 2024 x86_64
Server Software:
nginx/1.26.0
PHP Version:
8.3.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
httplib2
/
__pycache__
/
View File Name :
socks.cpython-312.pyc
'JfL F d Z ddlZddlZddlZddlZ eedd ed dZdZdZ dZ daej Z G d d e Z G d de Z G d de Z G d de Z G d de Z G d de ZdZdZdZdZ ddZd Z G d dej Zy)a SocksiPy - Python SOCKS module. Version 1.00 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. Nsocketz-socket.socket missing, proxy support unusable c e Zd Zy) ProxyErrorN__name__ __module____qualname__ 0/usr/lib/python3/dist-packages/httplib2/socks.pyr r 7 r r c e Zd Zy)GeneralProxyErrorNr r r r r r ; r r r c e Zd Zy)Socks5AuthErrorNr r r r r r ? r r r c e Zd Zy)Socks5ErrorNr r r r r r C r r r c e Zd Zy)Socks4ErrorNr r r r r r G r r r c e Zd Zy) HTTPErrorNr r r r r r K r r r )successzinvalid dataz not connectedz not availablezbad proxy typez bad input) succeededzgeneral SOCKS server failurez!connection not allowed by rulesetzNetwork unreachablezHost unreachablezConnection refusedzTTL expiredzCommand not supportedzAddress type not supportedz Unknown error)r zauthentication is requiredz0all offered authentication methods were rejectedz$unknown username or invalid password unknown error)zrequest grantedzrequest rejected or failedzLrequest rejected because SOCKS server cannot connect to identd on the clientzPrequest rejected because the client program and identd report different user-idsr c | |||||fa y)zsetdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]]) Sets a default proxy which all further socksocket objects will use, unless explicitly changed. N) _defaultproxy) proxytypeaddrportrdnsusernamepasswords r setdefaultproxyr' w s dD(HEMr c V t dk7 rt | j _ yt d )a7 wrapmodule(module) Attempts to replace a module's socket library with a SOCKS socket. Must set a default proxy using setdefaultproxy(...) first. This will only work on modules that import socket directly into the namespace; most of the Python Standard Library falls into this category. N)r zno proxy specified)r socksocketr r )modules r wrapmoduler+ s$ ) 9::r c e Zd ZdZej ej ddfdZd Z fdZ d Z d Z dd Zd Z d Zd Zd Zd Zd Zd Z xZS )r) a socksocket([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, type=SOCK_STREAM and proto=0. r Nc t j | |||| t d k7 rt | _ nd| _ d | _ d | _ d| _ y )N)NNNNNNT) _orgsocket__init__r _socksocket__proxy_socksocket__proxysockname_socksocket__proxypeername_socksocket__httptunnel)selffamilytypeproto_socks r r/ zsocksocket.__init__ sH D&$u=D (DL?DL## r c | j | }t | |k r>| j |t | z }|st d ||z }t | |k r>|S )z__recvall(count) -> data Receive EXACTLY the number of bytes requested from the socket. Blocks until the required number of bytes have been received. )r zconnection closed unexpectedly)recvlenr )r4 countdatads r __recvallzsocksocket.__recvall sb yy$i% %#d)+,A'(MNN!8D $i% r c f | j s| j | }t t | |g| S )zq override socket.socket.sendall method to rewrite the header for non-tunneling proxies if needed )r3 _socksocket__rewriteproxysuperr) sendall)r4 contentargs __class__s r rC zsocksocket.sendall s5 ))'2GZ.w>>>r c d\ }}|j d }|D ]e }|j j d r|}%|j j d s |j j d sd|}g |r|r|j | |j | |j d d }|j d }| j d d k7 r2| j d d k7 r |j d| j |j dd|z |j d|d d ||d d|d dj | S )z rewrite HTTP request headers to support non-tunneling proxies (i.e. those which do not support the CONNECT method). This only works for HTTP (not HTTPS) since HTTPS requires tunneling. )NN zhost:getpost r r N r zHost: %sz http://r )splitlower startswithremover0 insert_socksocket__getauthheaderjoin)r4 headerhostendpthdrshdrs r __rewriteproxyzsocksocket.__rewriteproxy s% !e||F#Cyy{%%g.''.#))+2H2H2P EKKKK::c?1%DKK$E||A$&4<<?d+BAt3356KK:,-KK%(D%(ERSHUV{{4 r c | j d dz | j d z }dt j | j z S )Nr :rL zProxy-Authorization: Basic )r0 base64 b64encodedecode)r4 auths r __getauthheaderzsocksocket.__getauthheader s@ ||A%Q7,v/?/?/E/L/L/NNNr c h |||||r|j nd|r|j nd|f| _ y)a setproxy(proxytype, addr[, port[, rdns[, username[, password]]]]) Sets the proxy to be used. proxytype - 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 preformed 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. headers - Additional or modified headers for the proxy connect request. N)encoder0 )r4 r! r" r# r$ r% r&