CasperSecurity

Current Path : /lib/python3/dist-packages/cloudinit/analyze/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/cloudinit/analyze/__pycache__/dump.cpython-310.pyc

o

쑛h��@sDUddlZddlZddlmZmZddlmZmZmZmZm	Z	m
Z
mZddlm
Z
mZmZdddddd	d
dd�Zeeefed
<dZdZdZdedefdd�Zdefdd�Zdedefdd�Zdede	eeeffdd�Z		d#de	eede	edeeeeefeeffdd�Zdefd d!�Zed"kr�ee��dSdS)$�N)�datetime�timezone)�IO�Any�Dict�List�Optional�TextIO�Tuple)�
atomic_helper�subp�utilzfinished running cloud-initz%starting search for local datasourcesz!searching for network datasourceszrunning config moduleszfinalizing moduleszrunning modules forzrunning single module )�finishedz
init-local�init-network�initzmodules-configz
modules-final�modules�single�stage_to_descriptionz%Y-%m-%d %H:%M:%S,%fz%b %d %H:%M:%S.%f %Yz%b %d %H:%M:%S %Y�timestampstr�returncCs�dd�tdd�D�}|��d|vr6t}d|vrt}t�|dtt��j�|�j	t
jd�}|��}t|�Sd	|vrMt�|t
�j	t
jd�}|��}t|�St|�}t|�S)
NcSsg|]}tj|�qS�)�calendar�
month_abbr)�.0�mrr�8/usr/lib/python3/dist-packages/cloudinit/analyze/dump.py�
<listcomp>!sz#parse_timestamp.<locals>.<listcomp>��
r�.� )�tzinfo�,)�range�split�DEFAULT_FMT�CLOUD_INIT_JOURNALCTL_FMTr�strptime�str�now�year�replacer�utc�	timestamp�CLOUD_INIT_ASCTIME_FMT�parse_timestamp_from_date�float)r�months�FMT�dtr-rrr�parse_timestamps*�����r4cCsdt�ddg�jvS)z�GNU date includes a string containing the word GNU in it in
    help output. Posix date does not. Use this to indicate on Linux
    systems without GNU date that the extended parsing is not
    available.
    �GNU�datez--help)r�stdoutrrrr�has_gnu_date:sr8cCsRt��st�d�rd}nt�rd}ntd|�d���tt�|ddd|g�j���S)N�gdater6z-Unable to parse timestamp without GNU date: [�]z-uz+%s.%3Nz-d)	r
�is_Linuxr�whichr8�
ValueErrorr0r7�strip)rr6rrrr/Cs
��r/�linecCs�d}dd|g}d}|D]
}||vrd}nq|sdS|�|�\}}|�d�r1d�|��dd	��}d
|vrQ|�d
�\}}|d|��d7}d|vrP|��d	}	n |��d	}	||krh|��}|jdd
�d}n	|�|	�d��}d|vr�d}
d|vr�|�d�d��}|�d�\}}
|�dd��dd�}|dkr�d}ndSt|}n|��dd�\}}
}|�|�d��}|�d�|t|�d|
�d�d�}|ddkr�|�d�d}|�|�d�d���}||d<|��|d<|S)Nz cloud-init[z - z
 [CLOUDINIT] FT�:r r���r"z,%sr)�maxsplit�
Cloud-init v.�start�runningz at �'��-rr��	cloudinit)�name�descriptionr-�origin�
event_typerN�finish�resultrL)	r$�endswith�joinr>�lstripr+r�rstripr4)r?�amazon_linux_2_sep�
separators�found�sep�timehost�eventstrr�extra�hostnamerN�stage_and_timestamp�
event_name�_�event_description�_pymodloglvl�eventrP�descrrr�parse_ci_loglineQsb
�
��
�rd�cisource�rawdatac
Cs�g}d}gd�}t||g�std��|dur|��}n|dur#|��}|D](}|D]#}||vrLzt|�}WntyDtj�d�Ynw|rL|�|�q)q%||fS)N)zstart:zfinish:rCz2Either cisource or rawdata parameters are requiredzSkipping invalid entry
)	�anyr=�
splitlines�	readlinesrd�sys�stderr�write�append)rerf�eventsrb�CI_EVENT_MATCHES�datar?�matchrrr�dump_events�s,
�
��	rrcCs2ttj�dkrttjd�}ntj}t�t|��S)Nr)�lenrj�argv�open�stdinr�
json_dumpsrr)rerrr�main�srx�__main__)NN) rrjrr�typingrrrrrr	r
rJrrr
rr(�__annotations__r.r&r%r0r4�boolr8r/rdrrrx�__name__�printrrrr�<module>sD
$�	W�
��
�	�
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY