shell bypass 403

Cubjrnet7 Shell


name : asyncresolver.cpython-39.pyc
a

�M�e�E�@s�dZddlZddlZddlmZmZmZmZmZddl	Z
ddlZ
ddlZ
ddl
Z
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlmZmZmZmZe
jjZe
jjZGdd�de
jj�Zdaed�dd	�Z dd�d
d�Z!e
j"j#e
j$j%ddd
ddddf	ee
j&j'e(fee
j"j)e(fee
j$j*e(fe+ee(e+e,ee-ee+ee
j.j/e
jj0d�dd�Z1e(eee
jj0d�dd�Z2ej3fee
j&j'e(fe,ee
jj4d�dd�Z5ee
j&j'e(fe
j&j'd�dd�Z6d(e-dd�dd�Z7e
j$j%dddfee
j&j'e(fe
j$j*e+eeee
j.j/e
j&j'd�dd �Z8d!ej3dfee
j&j'e(fe,e,eeed"�d#d$�Z9e
j"j#e
j$j%ddd
ddddd!ej3dfee
j&j'e(fee
j&j'e(fee
j"j)e(fee
j$j*e(fe+ee(e+e,ee-ee+ee
j.j/e,e,eee
jj0d%�d&d'�Z:dS))�Asynchronous DNS stub resolver.�N)�Any�Dict�List�Optional�Union)�NXDOMAIN�NoAnswer�	NoRootSOA�NotAbsolutec
@s�eZdZdZejjejjdddddddf	e	ej
jefe	ejj
efe	ejjefeeeeeeeeeeejjejjd�dd�Zeeeejjd	�d
d�Zejfe	ej
jefeeejjd�d
d�Ze	ej
jefej
jd�dd�Zdedd�dd�ZdS)�ResolverrFNTr��qname�rdtype�rdclass�tcp�source�raise_on_no_answer�source_port�lifetime�search�backend�returnc
�stj�|||||||	�}|
s&tj��}
t��}|��\}
}|durF|S|
dusRJ�d}|s.|��\}}}|r||
�|�IdH|�	|||j
�}z |j|
|||||
d�IdH}Wn@ty�}z(|�
d|�\}}WYd}~qVWYd}~n
d}~00|�
|d�\}}|durV|SqVq.dS)a�Query nameservers asynchronously to find the answer to the question.

        *backend*, a ``dns.asyncbackend.Backend``, or ``None``.  If ``None``,
        the default, then dnspython will use the default backend.

        See :py:func:`dns.resolver.Resolver.resolve()` for the
        documentation of the other parameters, exceptions, and return
        type of this method.
        NF)�timeoutrrZmax_sizer)�dns�resolverZ_Resolution�asyncbackendZget_default_backend�timeZnext_requestZnext_nameserver�sleep�_compute_timeout�errorsZasync_query�	ExceptionZquery_result)�selfrrrrrrrrrrZ
resolution�startZrequest�answerZdone�
nameserverZbackoffr�response�ex�_�r)�5/usr/lib/python3.9/site-packages/dns/asyncresolver.py�resolve-s>�
�"zResolver.resolve��ipaddr�args�kwargsrc�sLi}|�|�tjj|d<tjj|d<|jtj�|�g|�Ri|��IdHS)a�Use an asynchronous resolver to run a reverse query for PTR
        records.

        This utilizes the resolve() method to perform a PTR lookup on the
        specified IP address.

        *ipaddr*, a ``str``, the IPv4 or IPv6 address you want to get
        the PTR record for.

        All other arguments that can be passed to the resolve() function
        except for rdtype and rdclass are also supported by this
        function.

        rrN)	�updater�	rdatatypeZPTR�
rdataclass�INr+ZreversenameZfrom_address)r"r-r.r/�modified_kwargsr)r)r*�resolve_addressns

���zResolver.resolve_address��name�familyr/rc�sXi}|�|�|�dd�tjj|d<|tjkr^|j|tjj	fi|��IdH}tj
jj|d�S|tj
kr�|j|tjjfi|��IdH}tj
jj|d�S|tjkr�td|����|�dd�}|�d	d�}t��}	|j|tjjfd
|�|	|�d�|��IdH}|j}|j|tjj	fd
|�|	|�d�|��IdH}tj
jj|||d�}
|
�sTt|jd
��|
S)aUse an asynchronous resolver to query for address records.

        This utilizes the resolve() method to perform A and/or AAAA lookups on
        the specified name.

        *qname*, a ``dns.name.Name`` or ``str``, the name to resolve.

        *family*, an ``int``, the address family.  If socket.AF_UNSPEC
        (the default), both A and AAAA records will be retrieved.

        All other arguments that can be passed to the resolve() function
        except for rdtype and rdclass are also supported by this
        function.
        rNr)�v4)�v6zunknown address family rTrF)rr)r:r9Z	add_empty)r&)r0�poprr2r3�socketZAF_INETr+r1�Ar�HostAnswersZmakeZAF_INET6ZAAAA�	AF_UNSPEC�NotImplementedErrorrrrr	r&)r"r7r8r/r4r9r:rrr#�answersr)r)r*�resolve_name�sP



�
���
���zResolver.resolve_name�r7rc
�sRz|j|dd�IdH}|j}Wn.tjjyL}z|j}WYd}~n
d}~00|S)a�Determine the canonical name of *name*.

        The canonical name is the name the resolver uses for queries
        after all CNAME and DNAME renamings have been applied.

        *name*, a ``dns.name.Name`` or ``str``, the query name.

        This method can raise any exception that ``resolve()`` can
        raise, other than ``dns.resolver.NoAnswer`` and
        ``dns.resolver.NXDOMAIN``.

        Returns a ``dns.name.Name``.
        F)rN)r+�canonical_namerrr)r"r7r$rD�er)r)r*rD�s
zResolver.canonical_name�@)rrc�stz\t��|}|jtjjd|d�IdH}tj�|�}tj�||�IdH}t|�dkrZ||_	Wnt
ynYn0dS)a�Try to update the resolver's nameservers using Discovery of Designated
        Resolvers (DDR).  If successful, the resolver will subsequently use
        DNS-over-HTTPS or DNS-over-TLS for future queries.

        *lifetime*, a float, is the maximum time to spend attempting DDR.  The default
        is 5 seconds.

        If the SVCB query is successful and results in a non-empty list of nameservers,
        then the resolver's nameservers are set to the returned servers in priority
        order.

        The current implementation does not use any address hints from the SVCB record,
        nor does it resolve addresses for the SCVB target name, rather it assumes that
        the bootstrap nameserver will always be one of the addresses and uses it.
        A future revision to the code may offer fuller support.  The code verifies that
        the bootstrap nameserver is in the Subject Alternative Name field of the
        TLS certficate.
        Zsvcb)rNr)rr+rZ_ddrZ_local_resolver_name�queryZ
_remainingZ_get_nameservers_async�len�nameserversr!)r"rZ
expirationr$rrIr)r)r*�try_ddr�s
�
zResolver.try_ddr)rF) �__name__�
__module__�__qualname__�__doc__rr1r=r2r3rr7�Name�str�	RdataType�
RdataClass�boolr�int�floatr�Backendr�Answerr+rr5r<r?r>rBrDrJr)r)r)r*r*sF�
�B���E r)rcCstdurt�tdusJ�tS)zDGet the default asynchronous resolver, initializing it if necessary.N)�default_resolver�reset_default_resolverr)r)r)r*�get_default_resolversrZcCs
t�adS)z�Re-initialize default asynchronous resolver.

    Note that the resolver configuration (i.e. /etc/resolv.conf on UNIX
    systems) will be re-read immediately.
    N)rrXr)r)r)r*rYsrYFTr
c

�s$t��||||||||||	�
IdHS)a
Query nameservers asynchronously to find the answer to the question.

    This is a convenience function that uses the default resolver
    object to make the query.

    See :py:func:`dns.asyncresolver.Resolver.resolve` for more
    information on the parameters.
    N)rZr+)
rrrrrrrrrrr)r)r*r+s�r+r,c�s t�j|g|�Ri|��IdHS)z�Use a resolver to run a reverse query for PTR records.

    See :py:func:`dns.asyncresolver.Resolver.resolve_address` for more
    information on the parameters.
    N)rZr5)r-r.r/r)r)r*r5=s	r5r6c�st�j||fi|��IdHS)z�Use a resolver to asynchronously query for address records.

    See :py:func:`dns.asyncresolver.Resolver.resolve_name` for more
    information on the parameters.
    N)rZrB)r7r8r/r)r)r*rBIs	rBrCc�st��|�IdHS)z�Determine the canonical name of *name*.

    See :py:func:`dns.resolver.Resolver.canonical_name` for more
    information on the parameters and possible exceptions.
    N)rZrD)r7r)r)r*rDUsrDrF)rrc�st��|�IdHS)aTry to update the default resolver's nameservers using Discovery of Designated
    Resolvers (DDR).  If successful, the resolver will subsequently use
    DNS-over-HTTPS or DNS-over-TLS for future queries.

    See :py:func:`dns.resolver.Resolver.try_ddr` for more information.
    N)rZrJ)rr)r)r*rJ_srJ)r7rrrrrc	�s�t|t�rtj�|tjj�}|dur*t�}|��s:t|��zB|j	|tj
j|||d�IdH}|jdushJ�|jj|krz|WSWnt
tfy�Yn0z|��}Wq:tjjy�t�Yq:0q:dS)z�Find the name of the zone which contains the specified name.

    See :py:func:`dns.resolver.Resolver.zone_for_name` for more
    information on the parameters and possible exceptions.
    N)r)�
isinstancerPrr7Z	from_text�rootrZ�is_absoluterr+r1ZSOAZrrsetrr	�parentZNoParentr
)r7rrrrr$r)r)r*�
zone_for_nameis&
�
r_�5)�where�portr8rrc�s�|durt�}g}t|t�r>tj�|�r>|�tj�||��n4|�	||�IdH}|�
�D]}|�tj�||��qXtjjdd�}||_
|S)aMake a stub resolver using the specified destination as the full resolver.

    *where*, a ``dns.name.Name`` or ``str`` the domain name or IP address of the
    full resolver.

    *port*, an ``int``, the port to use.  If not specified, the default is 53.

    *family*, an ``int``, the address family to use.  This parameter is used if
    *where* is not an address.  The default is ``socket.AF_UNSPEC`` in which case
    the first address returned by ``resolve_name()`` will be used, otherwise the
    first address of the specified family will be used.

    *resolver*, a ``dns.asyncresolver.Resolver`` or ``None``, the resolver to use for
    resolution of hostnames.  If not specified, the default resolver will be used.

    Returns a ``dns.resolver.Resolver`` or raises an exception.
    NF)Z	configure)rZr[rPrZinetZ
is_address�appendr%ZDo53NameserverrBZ	addressesZ
asyncresolverrrI)rarbr8rrIrAZaddress�resr)r)r*�make_resolver_at�sre)rarrrrrrrrrrrbr8rrc�s6t||||
�IdH}|�|||||||||	|
�
IdHS)a�Query nameservers to find the answer to the question.

    This is a convenience function that calls ``dns.asyncresolver.make_resolver_at()``
    to make a resolver, and then uses it to resolve the query.

    See ``dns.asyncresolver.Resolver.resolve`` for more information on the resolution
    parameters, and ``dns.asyncresolver.make_resolver_at`` for information about the
    resolver parameters *where*, *port*, *family*, and *resolver*.

    If making more than one query, it is more efficient to call
    ``dns.asyncresolver.make_resolver_at()`` and then use that resolver for the queries
    instead of calling ``resolve_at()`` multiple times.
    N)rer+)rarrrrrrrrrrrbr8rrdr)r)r*�
resolve_at�s�rf)rF);rNr<r�typingrrrrrZdns._ddrrZdns.asyncbackendZdns.asyncqueryZ
dns.exceptionZdns.nameZ	dns.queryZdns.rdataclassZ
dns.rdatatypeZdns.resolverrr	r
rZ
asyncqueryZudpZ_udprZ_tcprZBaseResolverrrXrZrYr1r=r2r3r7rOrPrQrRrSrTrUrrVrWr+r5r?r>rBrDrJr_rerfr)r)r)r*�<module>s�[
�
�$�
�� 
�
�&��(�
�

© 2025 Cubjrnet7