ó
"b<]c        3   @  sà  d  Z  d d l m Z d d d d d d d	 d
 d d d d d d d d d d d d d d d d d d d d d d  d! d" d# d$ d% d& d' d( d) d* d+ d, d- d. d/ d0 d1 d2 d3 d4 d5 g3 Z d d6 l Z d d6 l Z d d6 l Z d d6 l Z d7 d8 l m	 Z	 m
 Z
 m Z m Z m Z m Z d7 d9 l m Z m Z m Z y* d d: l m Z m Z d d; l m Z Wn7 e k
 r’d d: l m Z m Z d d; l m Z n Xd d< l m Z m Z e	 ƒ  Z d= e _  d e f d> „  ƒ  YZ d6 d6 d6 d? „ Z! e! d@ d dA ƒZ" Z# e! dB ƒ Z$ Z% e! dC ƒ Z& Z' e! dD ƒ Z( Z) d e f dE „  ƒ  YZ* e* Z+ d e* f dF „  ƒ  YZ, e, Z- d e* f dG „  ƒ  YZ. e. Z/ d e f dH „  ƒ  YZ0 e0 Z1 d e* f dI „  ƒ  YZ2 e2 Z3 d e f dJ „  ƒ  YZ4 e4 Z5 d e f dK „  ƒ  YZ6 e6 Z7 d  e f dL „  ƒ  YZ8 e8 Z9 dM e f dN „  ƒ  YZ: d6 dO „ Z; e; Z< d" e f dP „  ƒ  YZ= e= Z> d# e f dQ „  ƒ  YZ? e? Z@ d$ e f dR „  ƒ  YZA eA ZB d% e f dS „  ƒ  YZC eC ZD d& e f dT „  ƒ  YZE eE ZF d' e f dU „  ƒ  YZG eG ZH dV e f dW „  ƒ  YZI d6 dX „ ZJ eJ ZK dY e f dZ „  ƒ  YZL d6 d[ „ ZM eM ZN eO d\ „ ZP d6 d] „ ZQ d^ „  ZR d_ „  ZS dA d6 eO eO d6 d` „ ZT da „  ZU db „  ZV dc „  ZW dd „  ZX de „  ZY eY eX _Z e ƒ  Z[ Z\ df e[ _  e] dg k rÜd d6 l^ Z^ e^ j_ ƒ  n  d6 S(h   s-   
Web API (wrapper around WSGI)
(from web.py)
iÿÿÿÿ(   t   print_functiont   configt   headert   debugt   inputt   datat	   setcookiet   cookiest   ctxt	   HTTPErrort   OKt   Createdt   Acceptedt	   NoContentt   okt   createdt   acceptedt	   nocontentt   Redirectt   Foundt   SeeOthert   NotModifiedt   TempRedirectt   redirectt   foundt   seeothert   notmodifiedt   tempredirectt
   BadRequestt   Unauthorizedt	   Forbiddent   NotFoundt   NoMethodt   NotAcceptablet   Conflictt   Gonet   PreconditionFailedt   UnsupportedMediaTypet   UnavailableForLegalReasonst
   badrequestt   unauthorizedt	   forbiddent   notfoundt   nomethodt   notacceptablet   conflictt   gonet   preconditionfailedt   unsupportedmediatypet   unavailableforlegalreasonst   InternalErrort   internalerrorNi   (   t   storaget   storifyt   threadeddictt   dictaddt   intgett   safestr(   t   PY2t   urljoint   string_types(   t   unquotet   quote(   t   Morsel(   t   StringIOt   BytesIOs£   
A configuration object for various aspects of web.py.

`debug`
   : when True, enables reloading, disabled template caching and sets internalerror to debugerror.
c           B  s   e  Z i  d  d „ Z RS(   t    c         C  sP   | t  _ x' | j ƒ  D] \ } } t | | ƒ q W| |  _ t j |  | ƒ d  S(   N(   R   t   statust   itemsR   R   t	   Exceptiont   __init__(   t   selfRC   t   headersR   t   kt   v(    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   J   s
    		(   t   __name__t
   __module__RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR	   H   s   c           s   | d  k r% ˆ  j d d ƒ d } n  ˆ  j d d ƒ d j d d ƒ } | pT d ˆ  } | i  ‡  f d † } t | t t f i | d 6| d 6ƒ S(   Nt    i   RB   s   `%s` statusc           s   t  j |  ˆ  | | ƒ d  S(   N(   R	   RF   (   RG   R   RH   (   RC   (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   Y   s    t   __doc__RF   (   t   Nonet   splitt   replacet   typeR	   t   object(   RC   R   t	   classnamet	   docstringRF   (    (   RC   s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyt   _status_codeS   s    "s   200 OKRB   s   201 Createds   202 Accepteds   204 No Contentc           B  s   e  Z d  Z d e d „ Z RS(   s#   A `301 Moved Permanently` redirect.s   301 Moved Permanentlyc         C  sw   t  t j | ƒ } | j d ƒ rI | r3 t j } n	 t j } | | } n  i d d 6| d 6} t j |  | | d ƒ d S(   sª   
        Returns a `status` redirect to the new URL.
        `url` is joined with the base URL so that things like
        `redirect("about") will work properly.
        t   /s	   text/htmls   Content-Typet   LocationRB   N(   R;   R   t   patht
   startswitht   realhomet   homeR	   RF   (   RG   t   urlRC   t   absolutet   newlocR\   RH   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   h   s    	

(   RK   RL   RN   t   FalseRF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR   e   s   c           B  s   e  Z d  Z e d „ Z RS(   s   A `302 Found` redirect.c         C  s   t  j |  | d d | ƒd  S(   Ns	   302 FoundR^   (   R   RF   (   RG   R]   R^   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF      s    (   RK   RL   RN   R`   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR   |   s   c           B  s   e  Z d  Z e d „ Z RS(   s   A `303 See Other` redirect.c         C  s   t  j |  | d d | ƒd  S(   Ns   303 See OtherR^   (   R   RF   (   RG   R]   R^   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   ˆ   s    (   RK   RL   RN   R`   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR   …   s   c           B  s   e  Z d  Z d „  Z RS(   s   A `304 Not Modified` status.c         C  s   t  j |  d ƒ d  S(   Ns   304 Not Modified(   R	   RF   (   RG   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   ‘   s    (   RK   RL   RN   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR   Ž   s   c           B  s   e  Z d  Z e d „ Z RS(   s$   A `307 Temporary Redirect` redirect.c         C  s   t  j |  | d d | ƒd  S(   Ns   307 Temporary RedirectR^   (   R   RF   (   RG   R]   R^   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   š   s    (   RK   RL   RN   R`   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR   —   s   c           B  s    e  Z d  Z d Z d d „ Z RS(   s   `400 Bad Request` error.s   bad requestc         C  s6   d } i d d 6} t  j |  | | | p. |  j ƒ d  S(   Ns   400 Bad Requests	   text/htmls   Content-Type(   R	   RF   t   message(   RG   Ra   RC   RH   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   ¤   s    N(   RK   RL   RN   Ra   RO   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR       s   c           B  s    e  Z d  Z d Z d d „ Z RS(   s   `401 Unauthorized` error.R(   c         C  s6   d } i d d 6} t  j |  | | | p. |  j ƒ d  S(   Ns   401 Unauthorizeds	   text/htmls   Content-Type(   R	   RF   Ra   (   RG   Ra   RC   RH   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   °   s    N(   RK   RL   RN   Ra   RO   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR   ¬   s   c           B  s    e  Z d  Z d Z d d „ Z RS(   s   `403 Forbidden` error.R)   c         C  s6   d } i d d 6} t  j |  | | | p. |  j ƒ d  S(   Ns   403 Forbiddens	   text/htmls   Content-Type(   R	   RF   Ra   (   RG   Ra   RC   RH   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   ¼   s    N(   RK   RL   RN   Ra   RO   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR   ¸   s   t	   _NotFoundc           B  s    e  Z d  Z d Z d d „ Z RS(   s   `404 Not Found` error.s	   not foundc         C  s6   d } i d d 6} t  j |  | | | p. |  j ƒ d  S(   Ns   404 Not Founds	   text/htmls   Content-Type(   R	   RF   Ra   (   RG   Ra   RC   RH   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   È   s    N(   RK   RL   RN   Ra   RO   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRb   Ä   s   c         C  s;   |  r t  |  ƒ St j d ƒ r0 t j d j ƒ  St  ƒ  Sd S(   sN   Returns HTTPError with '404 Not Found' error from the active application.
    t	   app_stackiÿÿÿÿN(   Rb   R   t   getRc   R*   (   Ra   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR   Î   s
    
c           B  s   e  Z d  Z d d „ Z RS(   s!   A `405 Method Not Allowed` error.c         C  s   d } i  } d | d <d d d d d g } | r\ g  | D] } t  | | ƒ r8 | ^ q8 } n  d	 j | ƒ | d
 <d  } t j |  | | | ƒ d  S(   Ns   405 Method Not Alloweds	   text/htmls   Content-Typet   GETt   HEADt   POSTt   PUTt   DELETEs   , t   Allow(   t   hasattrt   joinRO   R	   RF   (   RG   t   clsRC   RH   t   methodst   methodR   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   Þ   s    
	+N(   RK   RL   RN   RO   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR    Û   s   c           B  s    e  Z d  Z d Z d d „ Z RS(   s   `406 Not Acceptable` error.s   not acceptablec         C  s6   d } i d d 6} t  j |  | | | p. |  j ƒ d  S(   Ns   406 Not Acceptables	   text/htmls   Content-Type(   R	   RF   Ra   (   RG   Ra   RC   RH   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   õ   s    N(   RK   RL   RN   Ra   RO   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR!   ñ   s   c           B  s    e  Z d  Z d Z d d „ Z RS(   s   `409 Conflict` error.R-   c         C  s6   d } i d d 6} t  j |  | | | p. |  j ƒ d  S(   Ns   409 Conflicts	   text/htmls   Content-Type(   R	   RF   Ra   (   RG   Ra   RC   RH   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF     s    N(   RK   RL   RN   Ra   RO   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR"   ý   s   c           B  s    e  Z d  Z d Z d d „ Z RS(   s   `410 Gone` error.R.   c         C  s6   d } i d d 6} t  j |  | | | p. |  j ƒ d  S(   Ns   410 Gones	   text/htmls   Content-Type(   R	   RF   Ra   (   RG   Ra   RC   RH   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF     s    N(   RK   RL   RN   Ra   RO   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR#   	  s   c           B  s    e  Z d  Z d Z d d „ Z RS(   s    `412 Precondition Failed` error.s   precondition failedc         C  s6   d } i d d 6} t  j |  | | | p. |  j ƒ d  S(   Ns   412 Precondition Faileds	   text/htmls   Content-Type(   R	   RF   Ra   (   RG   Ra   RC   RH   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF     s    N(   RK   RL   RN   Ra   RO   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR$     s   c           B  s    e  Z d  Z d Z d d „ Z RS(   s#   `415 Unsupported Media Type` error.s   unsupported media typec         C  s6   d } i d d 6} t  j |  | | | p. |  j ƒ d  S(   Ns   415 Unsupported Media Types	   text/htmls   Content-Type(   R	   RF   Ra   (   RG   Ra   RC   RH   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   %  s    N(   RK   RL   RN   Ra   RO   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR%   !  s   t   _UnavailableForLegalReasonsc           B  s    e  Z d  Z d Z d d „ Z RS(   s*   `451 Unavailable For Legal Reasons` error.s   unavailable for legal reasonsc         C  s6   d } i d d 6} t  j |  | | | p. |  j ƒ d  S(   Ns!   451 Unavailable For Legal Reasonss	   text/htmls   Content-Type(   R	   RF   Ra   (   RG   Ra   RC   RH   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   1  s    N(   RK   RL   RN   Ra   RO   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRp   -  s   c         C  s;   |  r t  |  ƒ St j d ƒ r0 t j d j ƒ  St  ƒ  Sd S(   sb   Returns HTTPError with '415 Unavailable For Legal Reasons' error from the active application.
    Rc   iÿÿÿÿN(   Rp   R   Rd   Rc   R1   (   Ra   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR&   7  s
    
t   _InternalErrorc           B  s    e  Z d  Z d Z d d „ Z RS(   s   500 Internal Server Error`.s   internal server errorc         C  s6   d } i d d 6} t  j |  | | | p. |  j ƒ d  S(   Ns   500 Internal Server Errors	   text/htmls   Content-Type(   R	   RF   Ra   (   RG   Ra   RC   RH   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRF   H  s    N(   RK   RL   RN   Ra   RO   RF   (    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyRq   D  s   c         C  s;   |  r t  |  ƒ St j d ƒ r0 t j d j ƒ  St  ƒ  Sd S(   sS   Returns HTTPError with '500 internal error' error from the active application.
    Rc   iÿÿÿÿN(   Rq   R   Rd   Rc   R3   (   Ra   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR2   N  s
    
c         C  s·   t  |  ƒ t  | ƒ }  } d |  k sI d |  k sI d | k sI d | k rX t d ƒ ‚ n  | t k r x6 t j D]( \ } } | j ƒ  |  j ƒ  k rn d Sqn Wn  t j j |  | f ƒ d S(   s    
    Adds the header `hdr: value` with the response.
    
    If `unique` is True and a header with that name already exists,
    it doesn't add a new one.
    s   
s   s   invalid characters in headerN(   R9   t
   ValueErrort   TrueR   RH   t   lowert   append(   t   hdrt   valuet   uniquet   hRJ   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR   [  s    0c   	        s³  |  p	 d }  d „  } t  j j ƒ  } i  } } |  j ƒ  d k r)| d d k r)| j d d	 ƒ j ƒ  j d
 ƒ r½ t  j d ƒ } | s| d } t j d | d | d d ƒ } | t  _ qnZ t	 ƒ  } t
 rí t | t ƒ rí | j d ƒ } n  t | ƒ } t j d | d | d d ƒ } | | ƒ } q)n  |  j ƒ  d k rfd | d <| t j d | d d ƒ ƒ } n  ‡  f d †  ‰  t g  t | | ƒ j ƒ  D] \ } } | ˆ  | ƒ f ^ qŽƒ S(   s7   Returns storage object with GET or POST arguments.
    t   bothc         S  sH   |  j  d  k r g  |  _  n  t g  |  j ƒ  D] } | |  | f ^ q+ ƒ S(   N(   t   listRO   t   dictt   keys(   t   fsRI   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyt   dictifyr  s    t   postt   putt   REQUEST_METHODRg   Rh   t   CONTENT_TYPERB   s
   multipart/t   _fieldstorages
   wsgi.inputt   fpt   environt   keep_blank_valuesi   s   utf-8Rd   Re   c           sJ   t  |  t ƒ r, g  |  D] } ˆ  | ƒ ^ q S|  j d  k rB |  j S|  Sd  S(   N(   t
   isinstanceR{   t   filenameRO   Rw   (   R~   t   x(   t   process_fieldstorage(    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR‹   Œ  s    (   Rz   R€   R   (   Rg   Rh   (   Rz   Rd   (   R   t   envt   copyRt   Rd   RZ   t   cgit   FieldStorageR„   R   R:   Rˆ   t   unicodet   encodeRA   R4   R7   RD   (	   Ro   R   t   et   at   bR…   t   dRI   RJ   (    (   R‹   s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyt   rawinputm  s.    	
!
	
!	c          O  sc   | j  d d ƒ } t | ƒ } y$ | j d t ƒ t | |  | Ž SWn t k
 r^ t ƒ  ‚ n Xd S(   s€   
    Returns a `storage` object with the GET and POST arguments.
    See `storify` for how `requireds` and `defaults` work.
    t   _methodRz   t   _unicodeN(   t   popR–   t
   setdefaultRs   R5   t   KeyErrorR'   (   t	   requiredst   defaultsR—   t   out(    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR   ˜  s    c          C  sJ   d t  k rC t t  j j d ƒ d ƒ }  t  j d j |  ƒ t  _ n  t  j S(   s'   Returns the data sent with the request.R   t   CONTENT_LENGTHi    s
   wsgi.input(   R   R8   RŒ   Rd   t   readR   (   t   cl(    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR   ¦  s    c         C  sÖ   t  ƒ  } t |  ƒ t | ƒ }  } | j |  | t | ƒ ƒ t | t ƒ r_ | d k  r_ d } n  | | d <| py t j d | d <| r“ | | d <n  | r¦ | | d <n  | j ƒ  } | rÅ | d 7} n  t	 d	 | ƒ d
 S(   s   Sets a cookie.i    i 6eÄt   expiresRW   RY   t   domaint   secures
   ; httponlys
   Set-CookieN(
   R?   R9   t   setR>   Rˆ   t   intR   t   homepatht   OutputStringR   (   t   nameRw   R¢   R£   R¤   t   httponlyRY   t   morsel(    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR   ®  s    		
c         C  s[   y t  |  d ƒ SWnC t k
 rV y t  |  d ƒ SWqW t k
 rR t  |  d d ƒ SXn Xd S(   s;  Safely decodes a cookie value to unicode.
    
    Tries us-ascii, utf-8 and io8859 encodings, in that order.
    
    >>> decode_cookie('')
    u''
    >>> decode_cookie('asdf')
    u'asdf'
    >>> decode_cookie('foo \xC3\xA9 bar')
    u'foo \xe9 bar'
    >>> decode_cookie('foo \xE9 bar')
    u'foo \xe9 bar'
    s   us-asciis   utf-8t   iso8859t   ignoreN(   R   t   UnicodeError(   Rw   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyt   decode_cookieÁ  s    c   	      C  s>  d |  k rË t  j ƒ  } y | j |  ƒ Wnb t  j k
 r t  j ƒ  } xC |  j d ƒ D]. } y | j | ƒ WqX t  j k
 r… qX XqX Wn Xt g  | j ƒ  D]! \ } } | t | j ƒ f ^ qž ƒ } no i  } xf |  j d ƒ D]U } | j d d ƒ } t	 | ƒ d k rá | \ } } t | j
 ƒ  ƒ | | j
 ƒ  <qá qá W| S(   su  Parse a HTTP_COOKIE header and return dict of cookie names and decoded values.
    
    >>> sorted(parse_cookies('').items())
    []
    >>> sorted(parse_cookies('a=1').items())
    [('a', '1')]
    >>> sorted(parse_cookies('a=1%202').items())
    [('a', '1 2')]
    >>> sorted(parse_cookies('a=Z%C3%A9Z').items())
    [('a', 'Z\xc3\xa9Z')]
    >>> sorted(parse_cookies('a=1; b=2; c=3').items())
    [('a', '1'), ('b', '2'), ('c', '3')]
    >>> sorted(parse_cookies('a=1; b=w("x")|y=z; c=3').items())
    [('a', '1'), ('b', 'w('), ('c', '3')]
    >>> sorted(parse_cookies('a=1; b=w(%22x%22)|y=z; c=3').items())
    [('a', '1'), ('b', 'w("x")|y=z'), ('c', '3')]
    
    >>> sorted(parse_cookies('keebler=E=mc2').items())
    [('keebler', 'E=mc2')]
    >>> sorted(parse_cookies(r'keebler="E=mc2; L=\"Loves\"; fudge=\012;"').items())
    [('keebler', 'E=mc2; L="Loves"; fudge=\n;')]
    t   "t   ;t   =i   i   (   t   Cookiet   SimpleCookiet   loadt   CookieErrorRP   R|   t	   iteritemsR=   Rw   t   lent   strip(	   t   http_cookiet   cookiet
   attr_valueRI   RJ   R   t	   key_valuet   keyRw   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyt   parse_cookiesØ  s&    =#c          O  s”   | j  d ƒ t k r" t | d <n  d t k rU t j j  d d ƒ } t | ƒ t _ n  y t t j |  | Ž SWn! t k
 r t	 ƒ  t
 ƒ  ‚ n Xd S(   s4  Returns a `storage` object with all the request cookies in it.
    
    See `storify` for how `requireds` and `defaults` work.
    
    This is forgiving on bad HTTP_COOKIE input, it tries to parse at least
    the cookies it can.
    
    The values are converted to unicode if _unicode=True is passed.
    R˜   t   _parsed_cookiest   HTTP_COOKIERB   N(   Rd   Rs   R¯   R   RŒ   R¿   RÀ   R5   R›   R'   t   StopIteration(   Rœ   R   Rº   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR     s    
c          G  sR   y t  j d } Wn t j } n Xx' |  D] } t t j | ƒ d | ƒq+ Wd S(   s=   
    Prints a prettyprinted version of `args` to stderr.
    s   wsgi.errorst   fileRB   (   R   R†   t   syst   stderrt   printt   pprintt   pformat(   t   argsRž   t   arg(    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyR     s    c         C  s5   y t  j d } Wn t j } n X| j |  ƒ d  S(   Ns   wsgi.errors(   R   R†   RÄ   RÅ   t   write(   RŠ   Rž   (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyt   _debugwrite,  s
    s%  
A `storage` object containing various information about the request:

`environ` (aka `env`)
   : A dictionary containing the standard WSGI environment variables.

`host`
   : The domain (`Host` header) requested by the user.

`home`
   : The base path for the application.

`ip`
   : The IP address of the requester.

`method`
   : The HTTP method used.

`path`
   : The path request.

`query`
   : If there are no query arguments, the empty string. Otherwise, a `?` followed
     by the query string.

`fullpath`
   : The full path requested, including query arguments (`== path + query`).

### Response Data

`status` (default: "200 OK")
   : The status code to be used in the response.

`headers`
   : A list of 2-tuples to be used in the response.

`output`
   : A string to be used as the response.
t   __main__(`   RN   t
   __future__R    t   __all__RÄ   RŽ   RÇ   t   urllibt   utilsR4   R5   R6   R7   R8   R9   t
   py3helpersR:   R;   R<   t   urllib.parseR=   R>   t   http.cookiesR?   t   ImportErrorR³   t   ioR@   RA   R   RE   R	   RO   RV   R   R
   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R'   R   R(   R   R)   Rb   R   R*   R    R+   R!   R,   R"   R-   R#   R.   R$   R/   R%   R0   Rp   R&   R1   Rq   R2   R3   R`   R   R–   R   R   R   R¯   R¿   R   R   RÌ   RË   R   t   contextRK   t   doctestt   testmod(    (    (    s£   /mnt/my-files/home/darkz3ro/Desktop/my files/malware analysing and devlopment/viruses codes and analysis/APT34-leat/MuddyC3v1.0.1-/muddyc3_v1.0.1/lib/web/webapi.pyt   <module>   sö   	0.		










+				/						