AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/cloudinit/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/cloudinit/__pycache__/user_data.cpython-310.pyc
o

x[h�9�@s�ddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZmZe�e�ZejZejZejZdZd	d
gZddgZd
gZd	ZdZdZgd�ZdZdgZ dd�Z!dd�Z"ddd�Z#Gdd�d�Z$dd�Z%efdd�Z&dS)�N)�MIMEBase)�
MIMEMultipart)�MIMENonMultipart)�MIMEText)�features�handlers�util)�UrlError�read_file_or_urlzContent-Typez
text/plainztext/x-not-multipartztext/x-include-urlztext/x-include-once-urlztext/cloud-config-archiveztext/cloud-configzapplication/octet-stream)zapplication/gzipzapplication/gzip-compressedzapplication/gzippedzapplication/x-compresszapplication/x-compressedzapplication/x-gunzipzapplication/x-gzipzapplication/x-gzip-compressedzNumber-AttachmentscCs||=|||<dS�N�)�msg�key�valuerr�5/usr/lib/python3/dist-packages/cloudinit/user_data.py�_replace_header;srcCs|d=|jddt|�d�dS)NzContent-Disposition�
attachment)�filename)�
add_header�str)r
rrrr�
_set_filename@srcCstjrt|�|�t�|�dSr)r�ERROR_ON_USER_DATA_FAILURE�RuntimeError�LOG�warning)�
error_message�source_exceptionrrr�
_handle_errorEs
rc@s^eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zdd�ZdS)�UserDataProcessorcCs||_t�|�|_dSr)�pathsr�fetch_ssl_details�ssl_details)�selfrrrr�__init__MszUserDataProcessor.__init__cCsBt�}t|t�r|D]
}|�t|�|�q
|S|�t|�|�|Sr)r�
isinstance�list�_process_msg�convert_string)r"�blob�accumulating_msg�brrr�processQs
�zUserDataProcessor.processcCs�dd�}|��D]�}t|�rqd}|��}t�|�}d}|tvrOz
tj|dd�}d}d}Wn!tjyN}	zd�|t	|�|	�}
t
|
|	�WYd}	~	qd}	~	ww|sSt}|tdgvr^||�}|durd|}|r�|�
dd	�\}}t||�}
|
�|�|��r�t|
|���d
D]}||vr�t|
|t||��q�|
}||kr�t|t|�|tvr�|�||�q|tvr�|�||�qt|t|�|�||�qdS)NcSs
t�|�Sr)r�type_from_starts_with)�payloadrrr�
find_ctype[s
z2UserDataProcessor._process_msg.<locals>.find_ctypeF)�quietTz<Failed decompressing payload from {} of length {} due to: {}ztext/x-shellscript�/�)�Launch-Index)�walk�is_skippable�get_content_typer�fully_decoded_payload�DECOMP_TYPES�decomp_gzip�DecompressionError�format�lenr�
UNDEF_TYPE�TYPE_NEEDED�splitr�set_payload�get_filenamerrr�CONTENT_TYPE�
INCLUDE_TYPES�_do_include�
ARCHIVE_TYPES�_explode_archive�_attach_part)r"�base_msg�
append_msgr.�part�ctype�
ctype_origr-�was_compressed�er�maintype�subtype�n_part�hrrrr&Zsf

��
��

��zUserDataProcessor._process_msgc	Cs�|�dd�}d}|��tvr*zt�|jdd��}|r|�d�}Wn	ty)Ynw|dur0|}|dur6|}|durTz
|�dtt	|���WdSt
tfySYdSwdS)Nr2T��decode�launch-index)�getr5�EXAMINE_FOR_LAUNCH_INDEXr�	load_yaml�get_payload�	Exceptionrr�int�
ValueError�	TypeError)r"r
�
header_idx�payload_idxr-rrr�_attach_launch_index�s,
����z&UserDataProcessor._attach_launch_indexcCs&t�|dd�}tj�|j�d�d|�S)N�md5�@�data�urlcache)r�	hash_blob�os�path�joinr�
get_ipath_cur)r"�entry�entry_fnrrr�_get_include_once_filename�s�z,UserDataProcessor._get_include_once_filenamecCs$|��st|t|�|�|�dSr)r@r�PART_FN_TPLr_)r"r
�attached_idrrr�_process_before_attach�sz(UserDataProcessor._process_before_attachcCs�d}|��D]�}|��}|�d�r|td�d���}d}n|�d�r/|td�d���}d}|�d�r5q|��}|s<qd}d}|rG|�|�}|rUtj�	|�rUt
�|�}npz-t|dd|j
d�}|rn|��rnt
j||jd	d
�|��rv|j}nd�||j�}	t|	�WnBty�}
zt|
�}||vr�|d�|�7}t||
�WYd}
~
n!d}
~
wty�}zd
�||�}	t|	|�WYd}~nd}~ww|dur�t|�}
|�|
|�qdS)NFz
#include-onceTz#include�#��
)�timeout�retriesr!i�)�modez6Fetching from {} resulted in a invalid http code of {}z
 for url: {0}zFetching from {} resulted in {})�
splitlines�lower�
startswithr;�lstrip�striprkrerf�isfiler�load_text_filer
r!�ok�
write_file�contentsr:�coderr	r�IOErrorr'r&)r"�contentrH�include_once_on�line�lc_line�include_url�include_once_fn�respr�urle�message�ioe�new_msgrrrrC�st



�����������zUserDataProcessor._do_includecCsHtj|gttfd�}|D]�}t|t�rd|i}t|t�sq|�dd�}|�d�}|s9t}t|t	�r3t
}t�||�}|�
dd�\}}	|dkrUt|t	�rN|��}t||	d�}
n
t||	�}
|
�|�d	|vrjt|
|d	�d
|vrx|
�dt|d
��t|���D]}|��dd	dd
dt��t��fvr�q~|
�|||�q~|�||
�qdS)
N)�default�allowedr���typer0r1�text)�_subtyperrTr2zcontent-disposition)rrWr%�setr$r�dictrU�ARCHIVE_UNDEF_TYPE�bytes�ARCHIVE_UNDEF_BINARY_TYPErr,r>rSrrr?rr�keysrv�ATTACHMENT_FIELDrArF)r"�archiverH�entries�entr��mtyper�rNrOr
�headerrrrrEsL






�	�z"UserDataProcessor._explode_archiveNc	Csjt|vrd|t<|durt|tt|��d}z
t|�t��}W|Sttfy4t|tt|��Y|Sw)z
        Return the number of attachments to this MIMEMultipart by looking
        at its 'Number-Attachments' header.
        �0Nr)r�rrrZrUr[r\)r"�	outer_msg�	new_count�
fetched_countrrr�_multi_part_countFs��z#UserDataProcessor._multi_part_countcCs8|�|�}|�||d�|�|�|�||d�dS)z�
        Attach a message to an outer message. outermsg must be a MIMEMultipart.
        Modifies a header in the outer message to keep track of number of
        attachments.
        r1N)r�rn�attach)r"r�rI�
part_countrrrrFXs

zUserDataProcessor._attach_partr)
�__name__�
__module__�__qualname__r#r+r&r_rkrnrCrEr�rFrrrrrLs	PE
4rcCs |��pd}|��dkrdSdS)Nr��	multipartTF)�get_content_maintyperv)rI�
part_maintyperrrr4dsr4cCsn|sd}dd�}t|t�r|�d�}n|}tj|dd�}d|dd	���vr0t�|�d��}|S|||�}|S)
zJconvert a string (more likely bytes) or a message into
    a mime message.�cSs(|�dd�\}}t||�}|�|�|S)Nr0r1)r>rr?)rb�content_typerNrOr
rrr�
create_binmsgss

z%convert_string.<locals>.create_binmsgzutf-8FrRs
mime-version:ri)r$r�encoderr8rv�message_from_stringrS)�raw_datar�r��bdatar
rrrr'ms

�r'r)'�loggingre�email.mime.baser�email.mime.multipartr�email.mime.nonmultipartr�email.mime.textr�	cloudinitrrr�cloudinit.url_helperr	r
�	getLoggerr�r�NOT_MULTIPART_TYPErl�
OCTET_TYPErAr=rBrDr<r�r�r7r�rVrrrrr4r'rrrr�<module>s<


	

Anon7 - 2022
AnonSec Team