shell bypass 403

Cubjrnet7 Shell


name : common.cpython-39.opt-1.pyc
a

\��`n4�@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z
mZm
ZddlmZzddlmZddlmZWn*ey�ddlmZddlmZYn0d	Zd
Ze�dej�Ze�d�Zd
Ze�d�Zd:dd�Z	dd�Zdd�Z
dd�Z dd�Z!e"e�e"d�BZ#dd�Z$dd�Z%dd �Z&d!d"�Z'd#efd$d%�Z(d&d'�Z)d(d)�Z*d#efd*d+�Z+d,d-�Z,d;d/d0�Z-d1d2�Z.d<d4d5�Z/Gd6d7�d7e0�Z1Gd8d9�d9�Z2dS)=z|
oauthlib.common
~~~~~~~~~~~~~~

This module provides data structures and utilities common
to all implementations of OAuth.
�N)�quote�unquote�	urlencode�)�	get_debug)�randbits)�SystemRandom)�getrandbitsZ>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789z_ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}z&([^&;]*(?:password|token)[^=]*=)[^&;]+z&%[^0-9A-Fa-f]|%[0-9A-Fa-f][^0-9A-Fa-f]zAABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-Zoauthlib�/cCs:t|t�r|�d�n|}t||�}t|t�r6|�d�}|S�N�utf-8)�
isinstance�str�encode�_quote�bytes�decode)�s�safe�r�3/usr/lib/python3.9/site-packages/oauthlib/common.pyr-s



rcCs t|�}t|t�r|�d�}|Sr)�_unquoter
rr)rrrrr7s

rcCs,t|�}t|�}t|t�r|S|�d�SdSr)�encode_params_utf8�
_urlencoder
rr)�paramsZutf8_params�
urlencodedrrrrAs

rcCsLg}|D]>\}}|�t|t�r(|�d�n|t|t�r>|�d�n|f�q|S)ziEnsures that all parameters in a list of 2-element tuples are encoded to
    bytestrings using UTF-8
    r)�appendr
rr)rZencoded�k�vrrrrJs�rcCsLg}|D]>\}}|�t|t�r(|�d�n|t|t�r>|�d�n|f�q|S)zfEnsures that all parameters in a list of 2-element tuples are decoded to
    unicode using UTF-8.
    r)rr
rr)rZdecodedrrrrr�decode_params_utf8Vs�rz=&;:%+~,*@!()/?'$cCsT|r,t|�tks,d}t|t|�t|f��t�|�r>td��tj|dd�}t|�S)a�Decode a query string in x-www-form-urlencoded format into a sequence
    of two-element tuples.

    Unlike urlparse.parse_qsl(..., strict_parsing=True) urldecode will enforce
    correct formatting of the query string by validation. If validation fails
    a ValueError will be raised. urllib.parse_qsl will only raise errors if
    any of name-value pairs omits the equals sign.
    z�Error trying to decode a non urlencoded string. Found invalid characters: %s in the string: '%s'. Please ensure the request/response body is x-www-form-urlencoded.z%Invalid hex encoding in query string.T��keep_blank_values)�setr�
ValueError�INVALID_HEX_PATTERN�search�urlparse�	parse_qslr)�query�errorrrrr�	urldecodees

r*cCs�t|ttf�r4zt|�}Wq�ty0d}Yq�0njt|d�r�zt|�Wn*ty`d}Yq�tytd}Yq�0tt|t�r�|�	�n|�}t
|�}nd}|S)a*Extract parameters and return them as a list of 2-tuples.

    Will successfully extract parameters from urlencoded query strings,
    dicts, or lists of 2-tuples. Empty strings/dicts/lists will return an
    empty list of parameters. Any other input will result in a return
    value of None.
    N�__iter__)r
rrr*r#�hasattr�dict�	TypeError�list�itemsr)�rawrrrr�extract_params�s 


r2cCstttd��t��S)a�Generate pseudorandom nonce that is unlikely to repeat.

    Per `section 3.3`_ of the OAuth 1 RFC 5849 spec.
    Per `section 3.2.1`_ of the MAC Access Authentication spec.

    A random 64-bit number is appended to the epoch timestamp for both
    randomness and to decrease the likelihood of collisions.

    .. _`section 3.2.1`: https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01#section-3.2.1
    .. _`section 3.3`: https://tools.ietf.org/html/rfc5849#section-3.3
    �@)rr�generate_timestamprrrr�generate_nonce�sr5cCsttt����S)aDGet seconds since epoch (UTC).

    Per `section 3.3`_ of the OAuth 1 RFC 5849 spec.
    Per `section 3.2.1`_ of the MAC Access Authentication spec.

    .. _`section 3.2.1`: https://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01#section-3.2.1
    .. _`section 3.3`: https://tools.ietf.org/html/rfc5849#section-3.3
    )r�int�timerrrrr4�s	r4�cs$t��d���fdd�t|�D��S)aXGenerates a non-guessable OAuth token

    OAuth (1 and 2) does not specify the format of tokens except that they
    should be strings of random characters. Tokens should not be guessable
    and entropy when generating the random characters is important. Which is
    why SystemRandom is used instead of the default random.choice method.
    �c3s|]}����VqdS�N)�choice)�.0�x��charsZrandrr�	<genexpr>��z!generate_token.<locals>.<genexpr>)r�join�range��lengthr?rr>r�generate_token�srFcCsTddl}tj��}|j|tj|jd�d�}|�|j�|�||d�}t	|d�}|S)Nr)Zseconds)�scopeZexp�RS256�UTF-8)
�jwt�datetimeZutcnowrGZ	timedeltaZ
expires_in�update�claimsr�
to_unicode)Zprivate_pemZrequestrJZnowrM�tokenrrr�generate_signed_token�s
�
rPcCsddl}|j||dgd�S)NrrH)Z
algorithms)rJr)Z
public_pemrOrJrrr�verify_signed_token�srQcCs
t||�S)z�Generates an OAuth client_id

    OAuth 2 specify the format of client_id in
    https://tools.ietf.org/html/rfc6749#appendix-A.
    )rFrDrrr�generate_client_id�srRcCs2t|t�r|��}tj|dd�}|�|�t|�S)z)Extend a query with a list of two-tuples.Tr )r
r-r0r&r'�extendr)r(rZqueryparamsrrr�add_params_to_qs�s


rTFc	CsFt�|�\}}}}}}|r&t||�}n
t||�}t�||||||f�S)z5Add a list of two-tuples to the uri query components.)r&rT�
urlunparse)	�urir�fragmentZschZnet�pathZparr(Zfrarrr�add_params_to_uri�s

rYcCsHt|�t|�krdSd}t||�D]\}}|t|�t|�AO}q"|dkS)a Near-constant time string comparison.

    Used in order to avoid timing attacks on sensitive information such
    as secret keys during request verification (`rootLabs`_).

    .. _`rootLabs`: http://rdist.root.org/2010/01/07/timing-independent-array-comparison/

    Fr)�len�zip�ord)�a�b�resultr=�yrrr�safe_string_equals�s	rarIcs�t|t�r|St|t�r$t|�d�St|d�r�zt|�Wn4tyLYnHtyn�fdd�|D�YS0t|d�r�|��}�fdd�|D�S|S)z:Convert a number of different types of objects to unicode.��encodingr+c3s|]}t|��VqdSr:�rN)r<�irbrrr@rAzto_unicode.<locals>.<genexpr>r0cs"i|]\}}t|��t|���qSrrd)r<rrrbrr�
<dictcomp>$rAzto_unicode.<locals>.<dictcomp>)r
rrr,r-r.r#r0)�datarcrrbrrNs



rNcsbeZdZdZiZdd�Zdd�Z�fdd�Z�fdd	�Zddd�Z	�fd
d�Z
�fdd�Z�ZS)�CaseInsensitiveDictz3Basic case insensitive dict with strings only keys.cCs*dd�|D�|_|D]}||||<qdS)NcSsi|]}|��|�qSr)�lower)r<rrrrrf0rAz0CaseInsensitiveDict.__init__.<locals>.<dictcomp>)�proxy)�selfrgrrrr�__init__/szCaseInsensitiveDict.__init__cCs|��|jvSr:)rirj)rkrrrr�__contains__4sz CaseInsensitiveDict.__contains__cs*|j|��}t��|�|j|��=dSr:)rjri�super�__delitem__�rkr�key��	__class__rrro7szCaseInsensitiveDict.__delitem__cs|j|��}t��|�Sr:)rjrirn�__getitem__rprrrrrt<szCaseInsensitiveDict.__getitem__NcCs||vr||S|Sr:r)rkr�defaultrrr�get@szCaseInsensitiveDict.getcs t��||�||j|��<dSr:)rn�__setitem__rjri)rkrrrrrrrwCszCaseInsensitiveDict.__setitem__cs8t�j|i|��t|i|��D]}||j|��<q dSr:)rnrLr-rjri)rk�args�kwargsrrrrrrLGszCaseInsensitiveDict.update)N)
�__name__�
__module__�__qualname__�__doc__rjrlrmrortrvrwrL�
__classcell__rrrrrrh)s
rhc@sNeZdZdZddd�Zdd�Zd	d
�Zedd��Zed
d��Z	edd��Z
dS)�Requesta:A malleable representation of a signable HTTP request.

    Body argument may contain any data, but parameters will only be decoded if
    they are one of:

    * urlencoded query string
    * dict
    * list of 2-tuples

    Anything else will be treated as raw body data to be passed through
    unmolested.
    �GETNrcs��fdd�}||�|_||�|_t||p*i��|_||�|_t|j�|_g|_i|_ddddddddddddddddddddddddddddddd�|_	|j	�
tt|j
���|j	�
t|jp�g��dS)Ncs�rt|��S|Sr:rd)r=rbrr�<lambda>_rAz"Request.__init__.<locals>.<lambda>)Zaccess_tokenZclientZ	client_idZ
client_secret�codeZcode_challengeZcode_challenge_methodZ
code_verifierZextra_credentialsZ
grant_typeZredirect_uriZ
refresh_tokenZ
request_tokenZ
response_typerGZscopes�staterO�userZtoken_type_hintZ
response_modeZnonceZdisplay�promptrMZmax_ageZ
ui_localesZ
id_token_hintZ
login_hintZ
acr_values)rV�http_methodrh�headers�bodyr2�decoded_bodyZoauth_paramsZ
validator_log�_paramsrLr-r*�	uri_query)rkrVr�r�r�rcrrrbrrl\sR


�"zRequest.__init__cCs ||jvr|j|St|��dSr:)r��AttributeError)rk�namerrr�__getattr__�s

zRequest.__getattr__cCsRt�s
dS|j}|j��}|r.t�dt|��}d|vr>d|d<d�|j|j	||�S)Nz<oauthlib.Request SANITIZED>z<SANITIZED>Z
Authorizationz<SANITIZED>zF<oauthlib.Request url="{}", http_method="{}", headers="{}", body="{}">)
rr�r��copy�SANITIZE_PATTERN�subr�formatrVr�)rkr�r�rrr�__repr__�s
�zRequest.__repr__cCst�|j�jSr:)r&rVr(�rkrrrr��szRequest.uri_querycCs|js
gStj|jddd�S)NT)r!�strict_parsing)r�r&r'r�rrr�uri_query_params�s

�zRequest.uri_query_paramscCsPt�t�}dd�|jpg|jD�}|D]}||d7<q(dd�|��D�S)Ncss|]}|dVqdS)rNr)r<�prrrr@�s�z+Request.duplicate_params.<locals>.<genexpr>rcSsg|]\}}|dkr|�qS)rr)r<r�crrr�
<listcomp>�rAz,Request.duplicate_params.<locals>.<listcomp>)�collections�defaultdictr6r�r�r0)rkZ	seen_keysZall_keysrrrr�duplicate_params�s
�zRequest.duplicate_params)r�NNr)rzr{r|r}rlr�r��propertyr�r�r�rrrrrMs
�
2

r)r
)F)rI)3r}r�rKZlogging�rer7�urllib.parse�parser&rrrrrrr9rZsecretsrr�ImportErrorZrandomr	ZUNICODE_ASCII_CHARACTER_SETZCLIENT_ID_CHARACTER_SET�compile�
IGNORECASEr�r$Zalways_safeZ	getLogger�logrrr"rr*r2r5r4rFrPrQrRrTrYrarNr-rhrrrrr�<module>sP




	!		


$

© 2025 Cubjrnet7