403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.227.111.102
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/imunify360/venv/lib/python3.11/site-packages/imav/patchman/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/imunify360/venv/lib/python3.11/site-packages/imav/patchman/__pycache__/license.cpython-311.pyc
�

��h���D�dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZddlmZejd	��Zejd
��Zeje��ZdZdZd
ZdZdZdZdZGd�de��ZGd�de ��Z!Gd�d��Z"dS)u

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.


This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
See the GNU General Public License for more details.


You should have received a copy of the GNU General Public License
 along with this program.  If not, see <https://www.gnu.org/licenses/>.

Copyright © 2019 Cloud Linux Software Inc.

This software is also available under ImunifyAV commercial license,
see <https://www.imunify360.com/legal/eula>
�N)�suppress)�IntEnum)�Path)�List�Optional)�importer)�PatchmanConfigzcryptography.x509zpyasn1.codec.der.decoderzlicensing.patchman.coi�z/etc/patchman/ca.crtz"/etc/patchman/license/patchman.crtz"/etc/patchman/license/patchman.keyz*https://{address}:{port}/v2/imunifyav_key/z1.3.6.1.4.1.44098.2.1.3c�F�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdS)�Featurezr
    Patchman functionality depending on the license.
    See patchman agent implementation for more details.
    r���������
���N)�__name__�
__module__�__qualname__�__doc__�Core�CoreMalwareQuarantine�CoreVulnerabilitiesPatch�RulesMalwareScan�RulesMalwareClean�EcommerceVulnerabilitiesScan�EcommerceVulnerabilitiesPatch�PluginVulnerabilitiesScan�PluginVulnerabilitiesPatch�ScanningMultithreaded�ScanningRealtime�PatchDependencies�Waf���J/opt/imunify360/venv/lib/python3.11/site-packages/imav/patchman/license.pyrr1sf��������

�D��� ������#$� �$%�!� !��!"��������
�C�C�Cr*rc��eZdZdS)�PatchmanLicenseErrorN)rrrr)r*r+r-r-Fs�������Dr*r-c���eZdZed���Zedeefd���Zedefd���Z	ed���Z
edeefd���Z
edeefd���ZdS)	�Licensec�N�tt�����S�N)r�LICENSE_CERT_FILE�exists��clss r+�	is_activezLicense.is_activeKs���%�&�&�-�-�/�/�/r*�returnc���g}|����r?ttd��5}t�|�����}ddd��n#1swxYwYt
d�|jD��d��x}r�t�	|j
j
��\}}|���}|�tj��t|d���D]Y\}}	|	dkrNt!t"��5|�t|����ddd��n#1swxYwY�Zt$�d|��|S)zX
        Return the list of features available for the current patchman license
        �rbNc3�DK�|]}|jjtk�|V��dSr1)�oid�
dotted_string�FEATURES_EXTENSION_OID)�.0�exts  r+�	<genexpr>z'License.get_features.<locals>.<genexpr>Ys?��������w�,�0F�F�F��F�F�F�F��r*r)�start�1zPatchman license features: %s)r6�openr2�x509�load_pem_x509_certificate�read�next�
extensions�asn1_decoder�decode�value�asBinary�appendrr�	enumerater�
ValueError�logger�info)
r5�features�f�certr?�	asn1_data�_�	bitstring�posrKs
          r+�get_featureszLicense.get_featuresOs���
���=�=�?�?�	:��'��.�.�
@�!��5�5�a�f�f�h�h�?�?��
@�
@�
@�
@�
@�
@�
@�
@�
@�
@�
@����
@�
@�
@�
@����#�����
�
���s�
:� ,�2�2�3�9�?�C�C��	�1�%�.�.�0�0�	������-�-�-�"+�I�Q�"?�"?�"?�:�:�J�C����|�|�%�j�1�1�:�:�$�O�O�G�C�L�L�9�9�9�:�:�:�:�:�:�:�:�:�:�:����:�:�:�:�����3�X�>�>�>��s#�-A&�&A*�-A*�#E�E	�E	c�B�tj|���vSr1)rr rYr4s r+�has_clean_modezLicense.has_clean_modems���(�C�,<�,<�,>�,>�>�>r*c�B�tj|���vSr1)rr&rYr4s r+�has_realtime_enabledzLicense.has_realtime_enabledqs���'�3�+;�+;�+=�+=�=�=r*c��tjddt���}tjddt���}tjddt���}tj��}|�|���|�tt���tj�
t�||���|�	��5}|j}|jd
kr2|������cddd��S|dkr	ddd��dSt'd
|j�d����#1swxYwYdS)zw
        Get imunify registration key from the Patchman license service.
        See LICENSING-84 for details.
        �	licensing�ca)�default�address�port)�cafile)�certfile�keyfile)rbrc)�context��Ni�z!Patchman license service returns z	 response)r	�get�CA_ROOT_FILE�LICENSE_ADDRESS�LICENSE_PORT�ssl�create_default_context�load_verify_locations�load_cert_chainr2�LICENSE_KEY_FILE�urllib�request�urlopen�IMUNIFY_KEY_URL_TEMPLATE�format�statusrFrJr-)r5rdrbrcrg�responserws       r+�_get_imunify_keyzLicense._get_imunify_keyus��� �#�K��|�L�L�L�� �$���O�
�
�
���!�+�v�|�L�L�L���,�.�.���%�%�V�%�4�4�4����&�$�	 �	
�	
�	
��^�
#�
#�$�+�+�G�$�+�G�G��$�
�
�	���_�F���#�%�%��}�}���-�-�/�/�
	�	�	�	�	�	�	�	��3����	�	�	�	�	�	�	�	�'�N�H�O�N�N�N���
�	�	�	�	����	�	�	�	�	�	s�8E�E�3E�E�Ec��K�tj��}	tj|�d|j��d����d{V��S#t
$r%}t�d|��Yd}~nd}~wwxYwdS)Ni,)�timeoutzCan't get imunify key due to %s)�asyncio�get_event_loop�wait_for�run_in_executorry�	ExceptionrP�error)r5�loop�excs   r+�get_imunify_keyzLicense.get_imunify_key�s������%�'�'��	A� �)��$�$�T�3�+?�@�@�����������
���	A�	A�	A��L�L�:�C�@�@�@�@�@�@�@�@�����	A�����ts�4A�
A;�A6�6A;N)rrr�classmethodr6rrrY�boolr[r]r�strryr�r)r*r+r/r/Js��������0�0��[�0���T�'�]�����[��:�?�t�?�?�?��[�?��>�>��[�>����#������[��:�	�h�s�m�	�	�	��[�	�	�	r*r/)#rr|�loggingrmrr�
contextlibr�enumr�pathlibr�typingrr�defence360agent.utilsr�imav.patchman.configr	�
LazyImportrDrI�	getLoggerrrPrkrlrjr2rqrur=rr�r-r/r)r*r+�<module>r�s�����*��������
�
�
�
�
�
�
�
�������������������!�!�!�!�!�!�!�!�*�*�*�*�*�*�/�/�/�/�/�/��x��.�/�/��"�x�"�#=�>�>��	��	�8�	$�	$��)����%��8��7��G��2��
�
�
�
�
�g�
�
�
�*	�	�	�	�	�9�	�	�	�S�S�S�S�S�S�S�S�S�Sr*

Youez - 2016 - github.com/yon3zu
LinuXploit