403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/cloudinit/config/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/cloudinit/config/__pycache__/cc_phone_home.cpython-36.pyc
3

��bM�@sFdZddlmZmZmZddlmZeZdddddd	d
gZdd�Z	d
S)a�
Phone Home
----------
**Summary:** post data to url

This module can be used to post data to a remote host after boot is complete.
If the post url contains the string ``$INSTANCE_ID`` it will be replaced with
the id of the current instance. Either all data can be posted or a list of
keys to post. Available keys are:

    - ``pub_key_dsa``
    - ``pub_key_rsa``
    - ``pub_key_ecdsa``
    - ``pub_key_ed25519``
    - ``instance_id``
    - ``hostname``
    - ``fdqn``

Data is sent as ``x-www-form-urlencoded`` arguments.

**Example HTTP POST**::

    POST / HTTP/1.1
    Content-Length: 1337
    User-Agent: Cloud-Init/21.4
    Accept-Encoding: gzip, deflate
    Accept: */*
    Content-Type: application/x-www-form-urlencoded

    pub_key_dsa=dsa_contents&pub_key_rsa=rsa_contents&pub_key_ecdsa=ecdsa_contents&pub_key_ed25519=ed25519_contents&instance_id=i-87018aed&hostname=myhost&fqdn=myhost.internal

**Internal name:** ``cc_phone_home``

**Module frequency:** per instance

**Supported distros:** all

**Config keys**::

    phone_home:
        url: http://example.com/$INSTANCE_ID/
        post:
            - pub_key_dsa
            - instance_id
            - fqdn
        tries: 10
�)�	templater�
url_helper�util)�PER_INSTANCE�pub_key_dsa�pub_key_rsa�
pub_key_ecdsa�pub_key_ed25519�instance_id�hostname�fqdncCst|�dkrtj|d�}n d|kr4|jd|�dS|d}d|krT|jd|�dS|d}|jdd�}|jd�}yt|�}Wn&tk
r�d	}tj|d
|�YnX|dkr�t	}i}	|j
�|	d<|j�|	d<|jd
d�|	d<ddddd�}
xL|
j�D]@\}}ytj
|�|	|<Wq�tk
�r4tj|d|�Yq�Xq�Wi}
x:|D]2}||	k�r`|	||
|<nd|
|<|jd|��qDWi}x6|
j�D]*\}}|dk�r�d||<nt|�||<�q�Wd|	di}tj||�}y tj|||dtj|j�d�Wn&tk
�rtj|d||�YnXdS)NrZ
phone_homez=Skipping module named %s, no 'phone_home' configuration found�urlzFSkipping module named %s, no 'url' found in 'phone_home' configurationZpost�all�tries�
z?Configuration entry 'tries' is not an integer, using %s insteadr
rT)rrz/etc/ssh/ssh_host_dsa_key.pubz/etc/ssh/ssh_host_rsa_key.pubz/etc/ssh/ssh_host_ecdsa_key.pubz!/etc/ssh/ssh_host_ed25519_key.pub)rrrr	z1%s: failed to open, can not phone home that data!z=Requested key %s from 'post' configuration list not availablezN/AZINSTANCE_ID�)�dataZretriesZsec_betweenZssl_detailsz0Failed to post phone home data to %s in %s tries)�lenrZ	read_conf�debugZwarning�get�int�	ExceptionZlogexc�
POST_LIST_ALLZget_instance_idZget_hostname�itemsZ	load_file�strrZ
render_stringrZread_file_or_urlZfetch_ssl_details�paths)�nameZcfgZcloud�log�argsZph_cfgr
Z	post_listrZall_keysZpubkeys�n�pathZsubmit_keys�kZreal_submit_keys�vZ
url_params�r#�#/usr/lib/python3.6/cc_phone_home.py�handleSs�




r%N)
�__doc__Z	cloudinitrrrZcloudinit.settingsrZ	frequencyrr%r#r#r#r$�<module>7s

Youez - 2016 - github.com/yon3zu
LinuXploit