hdZddlZddlZddlZddlZddlmZmZddlm Z ddl m Z ddl m Z ddlmZmZddlmZdd lmZdd lmZdd lmZGd 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 . Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see N)MalwareMalwareSignatures) HookEvent)g)resource_limits)AIBOLIT_SCAN_INTENSITY_KEYMalwareScanResourceType)MalwareIgnorePath)MDS_PATH)MDSDetachedScanDir) get_memoryc"eZdZdZdZddZdS)MalwareDatabaseScannerc h||_||_||_||_||_||_||_dSN)scan_id initial_pathpaths 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 |jd|jdt |jd t |jd tj d t|j d t tj gS) Nz/opt/ai-bolit/wrapperz--scanz--pathrz--avdbz --report-filez --detachedz --progressz --ignore-listz --procudbz--memoryz --db-timeout)r rrMDS_AI_BOLIT_HOSTERstr report_filer progress_file ignore_file MDS_PROCU_DBr rrMDS_DB_TIMEOUT)rwork_dirs r_cmdzMalwareDatabaseScanner._cmd=s #    JqM   1  $ % %  L  & ' '  $ % %   *  t) * *  & ' '+  rNc Kt|j5}|jddt jtjj D| |}||j |j d}|j d5}tj||dddn #1swxYwY|jd5}|jd5}t'j|j|j |j |pt+j}t,j|d{Vt3j||j|jd||t;|t<|j  d{Vdddn #1swxYwYdddn #1swxYwYddddS#1swxYwYdS) N c3bK|]*}tjtj|V+dSr)base64 b64encodeosfsencode).0paths r z.MalwareDatabaseScanner.scan..YsK$R[%6%677r) resource_type)cmdrrw)mode)rrr0startedT)rrstart_new_sessionstdoutstderrcwdkey)r rr# write_bytesjoinr path_listr DBvaluer'rrscan_info_fileopenjsondumplog_fileerr_filerMalwareScanningStartedtimersinkprocess_messagercreate_subprocessrrr r) rr6r&r3 scan_infofpl_fe_fscan_started_events rscanzMalwareDatabaseScanner.scanVs+  - -%   , ,  1 ;&=&@&F!!!   ))H%%C $ 1!^I (--3-77 )2 )R((( ) ) ) ) ) ) ) ) ) ) ) ) ) ) )"''( h',,#,66 :=%.%E L"n*#2ty{{ &&&" f,,-?@@@@@@@@@%7"&"4!%!2&*H 24>B                                        #% % % % % % % % % % % % % % % % % % sBG91C G9C G9C G99G!B)G > G! G G!G G! G9!G% %G9(G% )G99G=G=r)__name__ __module__ __qualname__rr'rQrrrr)sF###&   2&&&&&&rr)__doc__r+rCr-rH defence360agent.contracts.configrr%defence360agent.contracts.hook_eventsr&defence360agent.internals.global_scoperdefence360agent.utilsrimav.malwarelib.configrr imav.malwarelib.modelr imav.malwarelib.scan.mdsr !imav.malwarelib.scan.mds.detachedr imav.malwarelib.utilsr rrUrrr`s1* GGGGGGGG;;;;;;444444111111433333------@@@@@@,,,,,,SSSSSSSSSSr