Hacked By AnonymousFox

Current Path : /opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/scan/mds/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/scan/mds/__pycache__/scanner.cpython-311.pyc

�

��g����dZddlZddlZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZmZddlmZdd	lmZdd
lmZddlmZGd�d
��ZdS)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)�Malware�MalwareSignatures)�	HookEvent)�g)�resource_limits)�AIBOLIT_SCAN_INTENSITY_KEY�MalwareScanResourceType)�MalwareIgnorePath)�MDS_PATH)�MDSDetachedScanDir)�
get_memoryc�"�eZdZd�Zd�Zdd�ZdS)�MalwareDatabaseScannerc�h�||_||_||_||_||_||_||_dS�N)�scan_id�initial_path�paths�
intensity_cpu�intensity_io�
intensity_ram�	scan_type)	�selfrrrrrrr�_s	         �U/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/scan/mds/scanner.py�__init__zMalwareDatabaseScanner.__init__*s=�����(�����
�*���(���*���"�����c�@�dtdd|jddtjdt	|j��d|jdt	|j��d	t	|j��d
tj	dt|j��dt	tj
��gS)
Nz/opt/ai-bolit/wrapperz--scanz--pathrz--avdbz
--report-filez
--detachedz
--progressz
--ignore-listz	--procudbz--memoryz--db-timeout)rrr�MDS_AI_BOLIT_HOSTER�str�report_filer�
progress_file�ignore_file�MDS_PROCU_DBr
rr�MDS_DB_TIMEOUT)r�work_dirs  r�_cmdzMalwareDatabaseScanner._cmd=s���#�����J�q�M���1����$�%�%���L����&�'�'����$�%�%���*���t�)�*�*����&�'�'�+
�	
rNc��K�t|j��5}|j�d�d�tjtjj	���D������|�
|��}||j|jd�}|j
�d���5}tj||��ddd��n#1swxYwY|j�d���5}|j�d���5}t'j|j|j|j|pt+j�����}t,j�|���d{V��t3j||j|jd||t;|��t<|j�	���d{V��ddd��n#1swxYwYddd��n#1swxYwYddd��dS#1swxYwYdS)
N�
c3�bK�|]*}tjtj|����V��+dSr)�base64�	b64encode�os�fsencode)�.0�paths  r�	<genexpr>z.MalwareDatabaseScanner.scan.<locals>.<genexpr>YsK��������$�R�[��%6�%6�7�7������r)�
resource_type)�cmdrr�w)�mode)rrr0�startedT)rr�start_new_session�stdout�stderr�cwd�key)rrr#�write_bytes�joinr
�	path_listr	�DB�valuer'rr�scan_info_file�open�json�dump�log_file�err_filer�MalwareScanningStarted�timer�sink�process_messager�create_subprocessrrr r)	rr6r&r3�	scan_info�fp�l_f�e_f�scan_started_events	         r�scanzMalwareDatabaseScanner.scanVs+����
���
-�
-�%	��� �,�,��
�
��� 1� ;�&=�&@�&F�!�!�!������
�
�
��)�)�H�%�%�C�� $� 1�!�^���I�
�(�-�-�3�-�7�7�
)�2��	�)�R�(�(�(�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)����
)�
)�
)�
)��"�'�'��(���
��h�'�,�,�#�,�6�6�
�:=�%.�%E� �L�"�n��*�#�2�t�y�{�{�	&�&�&�"��f�,�,�-?�@�@�@�@�@�@�@�@�@�%�7��"&�"4�!%�!2�&*����H�
�
�2�4�>�B�	�	�	�	�	�	�	�	�	�	�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�#%	�%	�%	�%	�%	�%	�%	�%	�%	�%	�%	�%	����%	�%	�%	�%	�%	�%	s�BG9�1C�G9�C	�G9�C	�G9�9G!�B)G
�>G!�
G�G!�G�G!�G9�!G%	�%G9�(G%	�)G9�9G=�G=r)�__name__�
__module__�__qualname__rr'rQ�rrrr)sF������#�#�#�&
�
�
�2&�&�&�&�&�&rr)�__doc__r+rCr-rH� defence360agent.contracts.configrr�%defence360agent.contracts.hook_eventsr�&defence360agent.internals.global_scoper�defence360agent.utilsr�imav.malwarelib.configrr	�imav.malwarelib.modelr
�imav.malwarelib.scan.mdsr�!imav.malwarelib.scan.mds.detachedr�imav.malwarelib.utilsr
rrUrr�<module>r`s1����*�
�
�
�����	�	�	�	�����G�G�G�G�G�G�G�G�;�;�;�;�;�;�4�4�4�4�4�4�1�1�1�1�1�1���������4�3�3�3�3�3�-�-�-�-�-�-�@�@�@�@�@�@�,�,�,�,�,�,�S�S�S�S�S�S�S�S�S�Sr

Hacked By AnonymousFox1.0, Coded By AnonymousFox