403Webshell
Server IP : 15.235.198.142  /  Your IP : 216.73.216.149
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/twisted/words/protocols/jabber/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/twisted/words/protocols/jabber/__pycache__/sasl.cpython-312.pyc
�

Ϫ�f����dZddlZddlmZmZddlmZddlmZm	Z	ddl
mZdZd�Z
Gd	�d
e�ZGd�de�ZGd
�de�ZGd�de�Zej&d�Zd�ZGd�de	j,�Zy)z
XMPP-specific SASL profile.
�N)�	b64decode�	b64encode)�defer)�sasl_mechanisms�	xmlstream)�domishz urn:ietf:params:xml:ns:xmpp-saslc��g}|jtdfj�D],}|jdk(s�|j	t|���.|S)zJ
    Parse the SASL feature to extract the available mechanism names.
    �
mechanisms�	mechanism)�features�NS_XMPP_SASL�elements�name�append�str)�xsr
�elements   �E/usr/lib/python3/dist-packages/twisted/words/protocols/jabber/sasl.py�get_mechanismsrsU���J��;�;��l�;�<�E�E�G�,���<�<�;�&����c�'�l�+�,���c��eZdZdZy)�	SASLErrorz
    SASL base exception.
    N��__name__�
__module__�__qualname__�__doc__�rrrr���rrc��eZdZdZy)�SASLNoAcceptableMechanismzB
    The server did not present an acceptable SASL mechanism.
    Nrrrrr!r!%rrr!c�$�eZdZdZdd�Zdefd�Zy)�
SASLAuthErrorz%
    SASL Authentication failed.
    Nc��||_y�N��	condition)�selfr's  r�__init__zSASLAuthError.__init__0s	��"��r�returnc� �d|jzS)NzSASLAuthError with condition %rr&�r(s r�__str__zSASLAuthError.__str__3s��0�4�>�>�A�Arr%)rrrrr)rr-rrrr#r#+s���#�B��Brr#c��eZdZdZy)�SASLIncorrectEncodingErrora

    SASL base64 encoding was incorrect.

    RFC 3920 specifies that any characters not in the base64 alphabet
    and padding characters present elsewhere than at the end of the string
    MUST be rejected. See also L{fromBase64}.

    This exception is raised whenever the encoded string does not adhere
    to these additional restrictions or when the decoding itself fails.

    The recommended behaviour for so-called receiving entities (like servers in
    client-to-server connections, see RFC 3920 for terminology) is to fail the
    SASL negotiation with a C{'incorrect-encoding'} condition. For initiating
    entities, one should assume the receiving entity to be either buggy or
    malevolent. The stream should be terminated and reconnecting is not
    advised.
    Nrrrrr/r/7s��rr/z"^[0-9A-Za-z+/]*[0-9A-Za-z+/=]{,2}$c��tj|��
t��	t|�S#t$r}tt|���d}~wwxYw)a�
    Decode base64 encoded string.

    This helper performs regular decoding of a base64 encoded string, but also
    rejects any characters that are not in the base64 alphabet and padding
    occurring elsewhere from the last or last two characters, as specified in
    section 14.9 of RFC 3920. This safeguards against various attack vectors
    among which the creation of a covert channel that "leaks" information.
    N)�
base64Pattern�matchr/r�	Exceptionr)�s�es  r�
fromBase64r6NsL�����1��%�(�*�*�1���|����1�(��Q��0�0��1�s�
,�	A�A	�	Ac�J�eZdZdZedfZdZd�Zd�Zdd�Z	dd�Z
d�Zd	�Zd
�Z
y)
�SASLInitiatingInitializera�
    Stream initializer that performs SASL authentication.

    The supported mechanisms by this initializer are C{DIGEST-MD5}, C{PLAIN}
    and C{ANONYMOUS}. The C{ANONYMOUS} SASL mechanism is used when the JID, set
    on the authenticator, does not have a localpart (username), requesting an
    anonymous session where the username is generated by the server.
    Otherwise, C{DIGEST-MD5} and C{PLAIN} are attempted, in that order.
    r
Nc���|jjj}|jjj}t	|j�}|j
�ld|vr3t
jd|jd|j
|�|_	yd|vr't
jd|j
|�|_	yt��d|vrt
j�|_	yt��)aP
        Select and setup authentication mechanism.

        Uses the authenticator's C{jid} and C{password} attribute for the
        authentication credentials. If no supported SASL mechanisms are
        advertized by the receiving party, a failing deferred is returned with
        a L{SASLNoAcceptableMechanism} exception.
        Nz
DIGEST-MD5�xmpp�PLAIN�	ANONYMOUS)
r�
authenticator�jid�passwordr�userr�	DigestMD5�hostr�Plainr!�	Anonymous)r(r>r?r
s    r�setMechanismz&SASLInitiatingInitializer.setMechanismps����n�n�*�*�.�.���>�>�/�/�8�8��#�D�N�N�3�
��8�8���z�)�!0�!:�!:��C�H�H�d�C�H�H�h�"����J�&�!0�!6�!6�t�S�X�X�x�!P���/�1�1��j�(�!0�!:�!:�!<���/�1�1rc��|j�tj�|_|jjd|j�|jjd|j�|jjd|j�|j|jj��|jS)z5
        Start SASL authentication exchange.
        �
/challenge�/success�/failure)
rEr�Deferred�	_deferredr�addObserver�onChallenge�addOnetimeObserver�	onSuccess�	onFailure�sendAuthr�getInitialResponser,s r�startzSASLInitiatingInitializer.start�s���
	
�������)������"�"�<��1A�1A�B����)�)�*�d�n�n�E����)�)�*�d�n�n�E��
�
�d�n�n�7�7�9�:��~�~�rc��tjtdf�}|jj|d<|�-|jt
|�jd�xsd�|jj|�y)z�
        Initiate authentication protocol exchange.

        If an initial client response is given in C{data}, it will be
        sent along.

        @param data: initial client response.
        @type data: C{str} or L{None}.
        �authrN�ascii�=)
r�Elementr
rr�
addContentr�decoder�send)r(�datarUs   rrQz"SASLInitiatingInitializer.sendAuth�sc���~�~�|�V�4�5�� �N�N�/�/��[�����O�O�I�d�O�2�2�7�;�B�s�C������D�!rc���tjtdf�}|r)|jt	|�jd��|jj|�y)zt
        Send response to a challenge.

        @param data: client response.
        @type data: L{bytes}.
        �responserVN)rrXr
rYrrZrr[)r(r\r^s   r�sendResponsez&SASLInitiatingInitializer.sendResponse�sI���>�>�<��"<�=������	�$�� 6� 6�w� ?�@������H�%rc���	tt|��}|j|jj	|��y#t
$r|jj�YywxYw)z�
        Parse challenge and send response from the mechanism.

        @param element: the challenge protocol element.
        @type element: L{domish.Element}.
        N)r6rr_r�getResponser/rK�errback)r(r�	challenges   rrMz%SASLInitiatingInitializer.onChallenge�sV��	E�"�3�w�<�0�I�
���d�n�n�8�8��C�D��*�	%��N�N�"�"�$�	%�s�A�#A'�&A'c�V�|jjd|j�|jjd|j�|jj	�|jj�|jjtj�y)z�
        Clean up observers, reset the XML stream and send a new header.

        @param success: the success protocol element. For now unused, but
                        could hold additional data.
        @type success: L{domish.Element}
        rGrIN)	r�removeObserverrMrP�reset�
sendHeaderrK�callback�Reset)r(�successs  rrOz#SASLInitiatingInitializer.onSuccess�sl��	
���%�%�l�D�4D�4D�E����%�%�j�$�.�.�A����������!�!�#������	���0rc�<�|jjd|j�|jjd|j�	|j	�j
}|jjt|��y#t$rd}Y�2wxYw)z�
        Clean up observers, parse the failure and errback the deferred.

        @param failure: the failure protocol element. Holds details on
                        the error condition.
        @type failure: L{domish.Element}
        rGrHN)
rrerMrO�firstChildElementr�AttributeErrorrKrbr#)r(�failurer's   rrPz#SASLInitiatingInitializer.onFailure�s~��	
���%�%�l�D�4D�4D�E����%�%�j�$�.�.�A�	��1�1�3�8�8�I�	
�����}�Y�7�8���	��I�	�s�B
�
B�Br%)r)rrrrr
�featurerKrErSrQr_rMrOrPrrrr8r8bs<����\�*�G��I�2�:�"�"&�
E�
1�9rr8)r�re�base64rr�twisted.internetr�twisted.words.protocols.jabberrr�twisted.words.xishrr
rr3rr!r#r/�compiler1r6� BaseFeatureInitiatingInitializerr8rrr�<module>rws����

�'�"�E�%�1��	��	���	��	B�I�	B����(��
�
�?�@�
�1�(C9�	� J� J�C9r

Youez - 2016 - github.com/yon3zu
LinuXploit