shell bypass 403

Cubjrnet7 Shell


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

�M�em�
@s�dZddlZddlZddlmZmZmZmZmZm	Z	m
Z
ddlZddl
ZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZGdd�dejj�ZGdd�dejj�Zdd	�Ze	ejjeejj eejj eee!e"e!e"fZ#d
d�Z$Gdd
�d
�Z%Gdd�dej&j'�Z(Gdd�dej&j)�Z*ddej+j,ej+j,dddejj-df	eee
ejj e.fee!ee
ej+j/e.fe
ej+j/e.fee
ej0j1e.fee
e!e.feejj2ee
ejj e.fe"eej3j4d�dd�Z5dS)z
DNS Zones.�N)�Any�Iterable�List�Optional�Set�Tuple�Unionc@seZdZdZdS)�
UnknownOriginzUnknown originN��__name__�
__module__�__qualname__�__doc__�rr�0/usr/lib/python3.9/site-packages/dns/zonefile.pyr	&sr	c@seZdZdZdS)�CNAMEAndOtherDataz!A node has a CNAME and other dataNr
rrrrr*srcCsztjj�|�}|�|�}|dur$dS|��}|tjjjkrR|tjjjkrRtd��n$|tjjjkrv|tjjjkrvtd��dS)Nz1rdataset type is not compatible with a CNAME nodez9CNAME rdataset is not compatible with a regular data node)	�dns�nodeZNodeKindZclassify_rdatasetZget_nodeZclassifyZCNAMEZREGULARr)�txn�name�rdatasetZ
rdataset_kindrZ	node_kindrrr�_check_cname_and_other_data.s"
��
���rcCs|��}|�d�sd|}|S)N�$)�upper�
startswith)�srrr�_upper_dollarizeQs
rc@s�eZdZdZdejjejjej	j
eeee
efeejjeeeejjeejjeed�
dd�Zdd	�Zd
d�Zdd
�Zeeeeeeefd�dd�Zdd�Zdd�dd�ZdS)�Readerz(Read a DNS zone file into a transaction.FTN)
�tok�rdclassr�
allow_include�allow_directives�
force_name�	force_ttl�
force_rdclass�force_rdtype�default_ttlcCs�||_|j��\|_|_}|j|_d|_d|_|dur:|}
|
durPd|_d|_	n|
|_d|_	|j|_
||_||_g|_
d|_||dur�hd�|_|r�|j�d�n&|dur�t�|_ntdd�|D��|_||_||_||_|	|_|j�t�dS)NrFT>�	$GENERATE�$TTL�$ORIGIN�$INCLUDEcss|]}t|�VqdS�N)r)�.0�drrr�	<genexpr>��z"Reader.__init__.<locals>.<genexpr>)r�manager�origin_information�zone_origin�
relativize�current_origin�last_ttl�last_ttl_knownr&�default_ttl_known�	last_name�zone_rdclassr�saved_state�current_file�allowed_directives�add�setr"r#r$r%Zcheck_put_rdatasetr)�selfrrrr r!r"r#r$r%r&�_rrr�__init__[s<


zReader.__init__cCs|j��}|��rqqdSr+)r�get�
is_eol_or_eof�r?�tokenrrr�	_eat_line�s
zReader._eat_linecCs|j��}|��stjj�|Sr+)rrB�
is_identifierr�	exception�SyntaxErrorrDrrr�_get_identifier�s
zReader._get_identifierc	
CsHd}|jdur|j}n�|jdur$t�|jjdd�}|��sN|j�||j�|_n"|j��}|��rddS|j�	|�|j}|�
|j�s�|��dS|j
r�|�
|j�}|jdur�|j}||_d|_nT|��}d}z"tj�|j�}||_d|_d}Wn$tjj�y|j�	|�Yn0|jdu�r&|j}nr|��}ztj�|j�}Wn>tjj�yZ�Yn&t�y~|j}|j�	|�Yn0||jk�r�tj�d��|du�r|��}d}z"tj�|j�}||_d|_d}WnBtjj�y|j�r�|j}n|j�r|j}|j�	|�Yn0|jdu�r(|j}nB|��}ztj �|j�}Wn&t�yhtj�d|j��Yn0z"tj!�|||j|j|j
|j�}Wn\tjj�y��YnDt�y�t"�#�dd�\}}tj�d�$t%|�t%|����Yn0|j�s|tj j&k�r|j'|_d|_|du�r|j'}|du�r4tj�d��|j(�)|||�dS)	z&Process one line from a DNS zone file.NT)Zwant_leading�RR class is not zone's class�unknown rdatatype '%s'�zcaught exception {}: {}�Missing default TTL value)*r"r4r	rrBZ
is_whitespaceZas_namer8rC�unget�is_subdomainr2rFr3r#r5r6rJr�ttl�	from_text�value�BadTTLr$�
rdataclassrHrI�	Exceptionr9r7r&r%�	rdatatype�rdata�sys�exc_info�format�strZSOAZminimumrr=)	r?rErrQr�rdtype�rd�ty�varrr�_rr_line�s�




��


zReader._rr_line)�side�returnc
Cst�d�}t�d�}t�d�}|�|�}|rJ|��\}}}}	}
|dkrJd}|�|�}|rz|��\}}}|dkrrd}d}	d}
|�|�}|r�|��\}}}}	|dkr�d}d}
|s�|s�|s�d}d}d}d}	d}
t|�}t|	�}	|dvr�tj�d	|��|
d
v�r
tj�d|
��||||	|
fS)Nz"^.*\$({(\+|-?)(\d+),(\d+),(.)}).*$z^.*\$({(\+|-?)(\d+)}).*$z^.*\$({(\+|-?)(\d+),(\d+)}).*$��+rr-)re�-zinvalid offset sign %s)r-�o�x�X�n�Nzinvalid type %s)�re�compile�match�groups�intrrHrI)
r?rbZis_generate1Zis_generate2Zis_generate3Zg1�mod�sign�offset�width�baseZg2Zg3rrr�
_parse_modifysD






zReader._parse_modifyc
s�|jdurt�|j��}z2tj�|j�\}}}|j��}|��sHtj	j
�Wntydtj	j
�Yn0z$|j}|j��}|��s�tj	j
�Wnty�tj	j
�Yn0z8tj�|j�}||_
d|_|j��}|��s�tj	j
�WnRtjj�y0|j�s|j�stj	�
d��|j�r|j}n|j�r,|j
}Yn0z.tj�|j�}|j��}|���s^tj	j
�Wn8tj	j
�y�tj	j
�Ynt�y�|j}Yn0||jk�r�tj	�
d��z.tj�|j�}|j��}|���s�tj	j
�Wn&t�ytj	�
d|j��Yn0|j}	ttttd�dd�}
ttttd	��fd
d��|�|�\}}}
}}|�|	�\}}}}}t||d|�D�]2}|
|||
�}|
|||�}�|||�}�|||�}|�d
||�}|	�d
||�}tj�||j|jj�|_|j}|�|j��s|��dS|j �r|� |j�}z tj!�||||j|j |j�}Wn\tj	j
�yP�YnDt�y�t"�#�dd�\}}tj	�
dt|�t|�f��Yn0|j$�%|||��qrdS)zPProcess one line containing the GENERATE statement from a DNS
        zone file.NTrNrKrL)�counter�offset_signrsrccSs|dkr|d9}||S)z0Calculate the index from the counter and offset.rf���r)rwrxrsrrr�_calculate_index�sz/Reader._generate_line.<locals>._calculate_index)�indexrurtrccsT|dvrt||��|�S�|d|�}d�|ddd��d|�}|dkrP|��}|S)zVFormat the index with the given base, and zero-fill it
            to the given width.)r-rgrhrirh�.Nryrk)r[�zfill�joinr)r{rurtZhexaZnibbles��
_format_indexrrr��sz,Reader._generate_line.<locals>._format_index�z$%srMzcaught exception %s: %s)&r4r	rrBrZgrangerRrSrGrHrIrVrQr5r6rTr7r&rUr9rWrpr\rv�range�replacer�
idna_codecr8rPr2rFr3rXrYrZrr=)r?rE�start�stop�stepZlhsrQrr]ZrhsrzZlmodZlsignZloffsetZlwidthZlbaseZrmodZrsignZroffsetZrwidthZrbase�iZlindex�rindexZlzfindexZrzfindexrrXr^r_r`rrr�_generate_line@s�









���
zReader._generate_line)rcc	
Cs��zr|j�dd�}|��rr|jdur.|j��t|j�dkrj|j�d�\|_|_|_	|_|_
|_|_|_
q�qr�n�|��r�q�n�|��r�|j��q�n�|jddk�r\t|j�dk�r\|j��}||jvr�tj�d|�d���|dk�r,|j��}|���s
tj�d	��tj�|j�|_d|_
|j��q|d
k�rp|j��|_|j��|jdu�r`|j|_|j�|j�q|dk�r2|j��}|j}|j��}|���r�tj�|j|j|jj�}|j��n|� ��s�tj�d��n|j}|j�!|j|j|j	|j|j
|j|j|j
f�t"|d
�|_tj#�$|j|�|_||_q|dk�rF|�%�qtj�d|�d���q|j�&|�|�'�qWnttjj�y�}zV|j�(�\}}|du�r�d}tj�d|||f�}t)�*�d}|�+|�d�WYd}~n
d}~00dS)z�Read a DNS zone file and build a zone object.

        @raises dns.zone.NoSOA: No SOA RR was found at the zone origin
        @raises dns.zone.NoNS: No NS RRset was found at the zone origin
        TNrryrzzone file directive 'z' is not allowedr(zbad $TTLr)r*zbad origin in $INCLUDE�rr'zUnknown zone file directive '�'zsyntax errorz	%s:%d: %srM),rrBZis_eofr;�close�lenr:�popr4r8r5r6r&r7Zis_eolZ
is_commentZget_eolrSr<rrrHrIrGrQrRZget_namer2r�_set_originrr�rC�append�open�	tokenizer�	Tokenizerr�rOra�whererYrZ�with_traceback)	r?rE�c�filenameZ
new_originZdetailZline_number�ex�tbrrr�read�s�



�
 


�








�
��


�
�zReader.read)FTNNNNN)rrr
rrr�r�rU�
RdataClass�transaction�Transaction�boolrrr\rr�NamerprW�	RdataTyperArFrJrarrvr�r�rrrrrXs6�


�2z-rcsteZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Z�ZS)�RRsetsReaderTransactioncst��|||�i|_dSr+)�superrA�	rdatasets)r?r0�replacementZ	read_only��	__class__rrrA+sz RRsetsReaderTransaction.__init__cCs|j�|||f�Sr+)r�rB�r?rr]�coversrrr�
_get_rdataset0sz%RRsetsReaderTransaction._get_rdatasetcCsTg}|j��D] \\}}}}||kr|�|�qt|�dkr@dStj��}||_|S�Nr)r��itemsr�r�rrZNode)r?rr�Z
rdataset_namer@rrrrr�	_get_node3s
z!RRsetsReaderTransaction._get_nodecCs||j||j|jf<dSr+)r�r]r�)r?rrrrr�
_put_rdataset>sz%RRsetsReaderTransaction._put_rdatasetcCsHg}|jD]}|d|kr
|�|�q
t|�dkrD|D]}|j|=q6dSr�)r�r�r�)r?r�remove�keyrrr�_delete_nameAs
z$RRsetsReaderTransaction._delete_namecCs*z|j|||f=Wnty$Yn0dSr+)r��KeyErrorr�rrr�_delete_rdatasetKsz(RRsetsReaderTransaction._delete_rdatasetcCs$|jD]\}}}||krdSqdS�NTF)r�)r?rrjr@rrr�_name_existsQsz$RRsetsReaderTransaction._name_existscCst|j�dkSr�)r�r��r?rrr�_changedWsz RRsetsReaderTransaction._changedcCsf|rb|��rbg}|j��D]:\\}}}}tj�||j|j|j�}|�	|�|�
|�q|j�|�dSr+)
r�r�r�r�rrset�RRsetrr]r��updater�r0�
set_rrsets)r?Zcommit�rrsetsrr@rr�rrr�_end_transactionZs�
z(RRsetsReaderTransaction._end_transactioncCsdSr+r)r?�originrrrr�esz#RRsetsReaderTransaction._set_origincCst�dSr+��NotImplementedErrorr�rrr�_iterate_rdatasetshsz*RRsetsReaderTransaction._iterate_rdatasetscCst�dSr+r�r�rrr�_iterate_namesksz&RRsetsReaderTransaction._iterate_names)rrr
rAr�r�r�r�r�r�r�r�r�r�r��
__classcell__rrr�rr�*s
r�c@sNeZdZejjdejjfdd�Zdd�Z	ddd�Z
dd	�Zd
d�Zdd
�Z
dS)�RRSetsReaderManagerFcCs||_||_||_g|_dSr+)r�r3rr�)r?r�r3rrrrrApszRRSetsReaderManager.__init__cCst�dSr+r�r�rrr�readerxszRRSetsReaderManager.readercCst|dd�Sr�)r�)r?r�rrr�writer{szRRSetsReaderManager.writercCs|jSr+)rr�rrr�	get_classszRRSetsReaderManager.get_classcCs$|jrtjj}n|j}|j|j|fSr+)r3rr�emptyr�)r?Z	effectiverrrr1�s
z&RRSetsReaderManager.origin_informationcCs
||_dSr+)r�)r?r�rrrr��szRRSetsReaderManager.set_rrsetsN)F)rrr
rr�rootrU�INrAr�r�r�r1r�rrrrr�os�

r�F)�textrrQr�default_rdclassr]r&r�r�r3rcc
Cst|t�rtj�|tjj|�}t|t�r8tj�|||�}t|t�rNtj�|�}t|t�rdtj�|�}|dur|tjj�	|�}nd}tjj�	|�}|dur�tj
j�	|�}nd}t||	|�}
|
�
d��D}tjj|d|d�}t|||d|||||d�	}
|
��Wd�n1�s0Y|
jS)a�	Read one or more rrsets from the specified text, possibly subject
    to restrictions.

    *text*, a file object or a string, is the input to process.

    *name*, a string, ``dns.name.Name``, or ``None``, is the owner name of
    the rrset.  If not ``None``, then the owner name is "forced", and the
    input must not specify an owner name.  If ``None``, then any owner names
    are allowed and must be present in the input.

    *ttl*, an ``int``, string, or None.  If not ``None``, the the TTL is
    forced to be the specified value and the input must not specify a TTL.
    If ``None``, then a TTL may be specified in the input.  If it is not
    specified, then the *default_ttl* will be used.

    *rdclass*, a ``dns.rdataclass.RdataClass``, string, or ``None``.  If
    not ``None``, then the class is forced to the specified value, and the
    input must not specify a class.  If ``None``, then the input may specify
    a class that matches *default_rdclass*.  Note that it is not possible to
    return rrsets with differing classes; specifying ``None`` for the class
    simply allows the user to optionally type a class as that may be convenient
    when cutting and pasting.

    *default_rdclass*, a ``dns.rdataclass.RdataClass`` or string.  The class
    of the returned rrsets.

    *rdtype*, a ``dns.rdatatype.RdataType``, string, or ``None``.  If not
    ``None``, then the type is forced to the specified value, and the
    input must not specify a type.  If ``None``, then a type must be present
    for each RR.

    *default_ttl*, an ``int``, string, or ``None``.  If not ``None``, then if
    the TTL is not forced and is not specified, then this value will be used.
    if ``None``, then if the TTL is not forced an error will occur if the TTL
    is not specified.

    *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA
    encoder/decoder.  If ``None``, the default IDNA 2003 encoder/decoder
    is used.  Note that codecs only apply to the owner name; dnspython does
    not do IDNA for names in rdata, as there is no IDNA zonefile format.

    *origin*, a string, ``dns.name.Name``, or ``None``, is the origin for any
    relative names in the input, and also the origin to relativize to if
    *relativize* is ``True``.

    *relativize*, a bool.  If ``True``, names are relativized to the *origin*;
    if ``False`` then any relative names in the input are made absolute by
    appending the *origin*.
    NTz<input>)r�F)r!r"r#r$r%r&)�
isinstancer\rrrRr�rQrUr�ZmakerWr�r�r�r�r�rr�r�)r�rrQrr�r]r&r�r�r3r0rrr�rrr�read_rrsets�s>=



�(r�)6rrlrY�typingrrrrrrrZ
dns.exceptionrZ
dns.grangeZdns.nameZdns.nodeZ	dns.rdataZdns.rdataclassZ
dns.rdatatypeZdns.rdtypes.ANY.SOAZ	dns.rrsetZ
dns.tokenizerZdns.transactionZdns.ttlrHZDNSExceptionr	rrr�r�rr�rpr�ZSavedStateTyperrr�r�r�ZTransactionManagerr�rUr�r�r\r�rWr�Z	IDNACodecr�r�r�rrrr�<module>st$

��UE �

�

© 2025 Cubjrnet7