shell bypass 403

Cubjrnet7 Shell


name : xfr.cpython-39.opt-1.pyc
a

�M�e�3�@s\ddlmZmZmZmZmZddlZddlZddl	Zddl
ZddlZddlZddl
ZddlZddlZddlZGdd�dejj�ZGdd�dejj�ZGdd�dejj�ZGd	d
�d
�Zddddddddejjf	ejjeeeeeefeeeeeeeeejjeeej j!eej j!e"feej#j$eefd�dd
�Z%ej#j&eed�dd�Z'dS)�)�Any�List�Optional�Tuple�UnionNcs eZdZdZ�fdd�Z�ZS)�
TransferErrorz.A zone transfer response got a non-zero rcode.cs&dtj�|�}t��|�||_dS)NzZone transfer error: %s)�dns�rcodeZto_text�super�__init__)�selfr	�message��	__class__��+/usr/lib/python3.9/site-packages/dns/xfr.pyr#szTransferError.__init__)�__name__�
__module__�__qualname__�__doc__r�
__classcell__rrrrr src@seZdZdZdS)�SerialWentBackwardsz:The current serial number is less than the serial we know.N�rrrrrrrrr)src@seZdZdZdS)�UseTCPz'This IXFR cannot be completed with UDP.Nrrrrrr-src@s`eZdZdZejjddfejjejj	e
eed�dd�Z
ejjed�dd	�Zd
d�Zdd
�ZdS)�Inboundz+
    State machine for zone transfers.
    NF)�txn_manager�rdtype�serial�is_udpcCst||_d|_||_|tjjkr0|dur<td��n|r<td��||_||_|�	�\}}|_
d|_d|_d|_
d|_dS)aqInitialize an inbound zone transfer.

        *txn_manager* is a :py:class:`dns.transaction.TransactionManager`.

        *rdtype* can be `dns.rdatatype.AXFR` or `dns.rdatatype.IXFR`

        *serial* is the base serial number for IXFRs, and is required in
        that case.

        *is_udp*, a ``bool`` indidicates if UDP is being used for this
        XFR.
        Nz,a starting serial must be supplied for IXFRszis_udp specified for AXFRF)r�txnrr�	rdatatype�IXFR�
ValueErrorrr�origin_information�origin�soa_rdataset�done�
expecting_SOA�delete_mode)rrrrr�_rrrr6s
zInbound.__init__)r
�returncCs^|jdur&|jtjjk}|j�|�|_|��}|tjjkrBt	|��t
|j�dkr�|jdj|j
krntj�d��|jdj|jkr�tj�d��d}|jdu�rn|jr�|jdj|j
kr�tj�d��|jd}|}|jtjjkr�tj�d��d}|��|_|jtjjk�rn|jdj|jk�r"d|_nLtj�|jdj�|jk�rDt�n*|j�rht
|j|d��dk�rht�d|_|j|d�D�]�}|j}|}|j�r�tj�d	��|jtjjk�r�||j
k�r�|jtjjk�r�|j|_||jk�rr|jtjjk�s
|jtjjk�rr|j�rr|j�rtj�d
��|jtjjk�rL|j|djk�rLtj�d��|j�||�|j��d|_d|_nfd|_|jtjjk�r�|j�r�|dj|jk�r�tj�d
��n|dj|_|j�||�ntj�d���q||j�rtjj|_d|_d|_|j��|j�d�|_|j�r*|j� ||�n|j�!||��q||j�rX|j�sXtj�d��|jS)aZProcess one message in the transfer.

        The message should have the same relativization as was specified when
        the `dns.xfr.Inbound` was created.  The message should also have been
        created with `one_rr_per_rrset=True` because order matters.

        Returns `True` if the transfer is complete, and `False` otherwise.
        Nrzwrong question namezwrong question rdatatypez&No answer or RRset not for zone originzfirst RRset is not an SOA�Tzanswers after final SOAzempty IXFR sequencezunexpected end of IXFR sequenceFzIXFR base serial mismatchzunexpected origin SOA in AXFRzunexpected end of UDP IXFR)"rrrr �AXFRr�writerr	ZNOERRORr�len�question�namer$�	exception�	FormErrorr%Zanswer�SOA�copyr!rr&ZSerialrrrr'r(�replaceZcommit�rollbackZdelete_exact�add)rr
Zreplacementr	Zanswer_index�rrset�rdatasetr0rrr�process_messageYs�	


 
�����
�

zInbound.process_messagecCs|S)Nr)rrrr�	__enter__�szInbound.__enter__cCs|jr|j��dS)NF)rr6)r�exc_typeZexc_valZexc_tbrrr�__exit__�s
zInbound.__exit__)rrrrrr r,�transaction�TransactionManagerZ	RdataTyper�int�boolrr
�Messager:r;r=rrrrr1s��#r)rr�use_edns�	ednsflags�payload�request_payload�options�keyring�keyname�keyalgorithmr*c
CsV|��\}
}}|
durtd��|dur0tjj}
n�t|t�sDtd��n�|dkr�|���@}|�|d�}|rz|dj	}tjj
}
nd}tjj}
Wd�q�1s�0Yn"|dkr�|dkr�tjj
}
ntd��|��}tj�
|
|
||d||||�	}|du�r4tj�|dd	|�d
��}|j|j|
|tjjdd�}|�|d�|du�rN|j|||	d
�||fS)aMake an AXFR or IXFR query.

    *txn_manager* is a ``dns.transaction.TransactionManager``, typically a
    ``dns.zone.Zone``.

    *serial* is an ``int`` or ``None``.  If 0, then IXFR will be
    attempted using the most recent serial number from the
    *txn_manager*; it is the caller's responsibility to ensure there
    are no write transactions active that could invalidate the
    retrieved serial.  If a serial cannot be determined, AXFR will be
    forced.  Other integer values are the starting serial to use.
    ``None`` forces an AXFR.

    Please see the documentation for :py:func:`dns.message.make_query` and
    :py:func:`dns.message.Message.use_tsig` for details on the other parameters
    to this function.

    Returns a `(query, serial)` tuple.
    Nzno zone originzserial is not an integerrr3lzserial out-of-rangeFz. . z 0 0 0 0T)Zcreate)�	algorithm)r#r"rr r,�
isinstancer@�reader�getrr!Z	get_classr
�
make_query�rdataZ	from_text�
find_rrset�	authorityr3r7Zuse_tsig)rrrCrDrErFrGrHrIrJZzone_originr)r$rrr9�rdclass�qrPr8rrrrO�sN





(
�
�
rO)�queryr*cCslt|tjj�std��|jd}|jtjjkr2dS|jtjj	krHtd��|�
|j|j|j
tjj�}|djS)a7Extract the SOA serial number from query if it is an IXFR and return
    it, otherwise return None.

    *query* is a dns.message.QueryMessage that is an IXFR or AXFR request.

    Raises if the query is not an IXFR or AXFR, or if an IXFR doesn't have
    an appropriate SOA RRset in the authority section.
    zquery not a QueryMessagerNzquery is not an AXFR or IXFR)rLrr
�QueryMessager"r/rr r,r!rQrRr0rSr3r)rUr/Zsoarrr�extract_serial_from_queryDs	
�rW)(�typingrrrrrZ
dns.exceptionrZdns.messageZdns.nameZ	dns.rcodeZdns.rdatasetZ
dns.rdatatypeZ
dns.serialZdns.transactionZdns.tsigZdns.zoner1ZDNSExceptionrr2rrrZtsigZdefault_algorithmr>r?r@rAZednsZOptionr0�Name�strr
rVrOrBrWrrrr�<module>sL	L�
�J

© 2025 Cubjrnet7