PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 131
# -*- coding: utf-8 -*- # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2024 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT import os import logging import subprocess import json import hashlib from clcommon.clwpos_lib import find_wp_paths from xray.internal.constants import advice_list_im360_cache from xray.adviser.advice_helpers import filter_by_non_existence, ThirdPartyAdvice ADV_TYPE = "IMUNIFY_PROTECTION" class ImunifyManager: imunify360_agent = "/usr/bin/imunify360-agent" def __init__(self): self.logger = logging.getLogger('imunify_manager') @staticmethod def _filter_advice_list(advice_list): """ Filter by non-exist user or website add more filters if needed """ return filter_by_non_existence(advice_list) def call_im360_command(self, command): try: result = subprocess.run(command, text=True, capture_output=True, timeout=60, check=True) return json.loads(result.stdout) except (subprocess.CalledProcessError, OSError) as e: self.logger.exception('Unable to run IM360 command: %s', e) except subprocess.TimeoutExpired as e: self.logger.exception('Timeout expired while running IM360 command: %s', e) except json.JSONDecodeError as e: self.logger.exception('Unable to parse json of IM360 response: %s', e) return {} def is_im360_present(self): return os.path.exists(self.imunify360_agent) def is_im360_mu_plugin_disabled_server_wide(self): if not self.is_im360_present(): return True settings = self.get_im360_settings() return not settings.get('mu_plugin_installation', False) def get_im360_settings(self): if not self.is_im360_present(): return {} return self.call_im360_command([self.imunify360_agent, 'smart-advice', 'get-options', '--json']) def get_im360_protection_status(self, username): if not self.is_im360_present(): return False mi_status = self.call_im360_command([self.imunify360_agent, 'myimunify', 'status', username, '--json']) if not mi_status: return False # "items": [{"username": "onemore", "protection": false}] items = mi_status.get('items', []) if items: return items[0].get('protection', False) return False def _make_advice(self, imunify_advice): """ imunify advice item: {"id": 123, "server_id": null, "type": "malware_found_myimun_2", "date": 123, "severity": 1, "translation_id": "1", "parameters": {}, "description": null, "link_text": null, "link": null, "dashboard": false, "popup": false, "snoozed_until": 0, "popup_title": null, "popup_description": null, "config_action": {}, "ignore": {}, "notification": false, "smartadvice": true, "smartadvice_title": "Web hosting user account is infected", "smartadvice_description": "\nImunify detected live malware on the user account hosting this website:\n\n* inf1\n\n* inf2\n", "smartadvice_user": "isuser", "smartadvice_domain": "isuser.com", "smartadvice_docroot": "/", "ts": 123, "first_generated": 123, "iaid": "agent-iaid-123", "notification_body_html": null, "notification_period_limit": 0, "notification_subject": null, "notification_user": null} -> {'created_at': '2024-06-22T00:29:23.898986+00:00', 'updated_at': '2024-06-22T00:29:23.898986+00:00', 'metadata': {'username': 'tkcpanel', 'domain': 'tk-cpanel.com', 'website': '/'}, 'advice': {'id': 1, 'type': 'IMUNIFY_PROTECTION', 'status': 'review', 'description': 'Turn on MyImunify Account protection', 'detailed_description': 'To improve site security, enable the Imunify protection feature.', 'is_premium': False, 'module_name': 'imunify', 'license_status': 'NOT_REQUIRED', 'subscription': {'status': 'no', 'upgrade_url': 'https://whmcs.dev.cloudlinux.com?username=tkcpanel&domain=tk-cpanel.com&server_ip=10.193.176.2 &m=cloudlinux_advantage&action=provisioning&suite=my_imunify_account_protection'}, 'total_stages': 0, 'completed_stages': 0}} """ advices_by_docroot = [] username = imunify_advice['smartadvice_user'] domain = imunify_advice['smartadvice_domain'] infected_docroot = imunify_advice['smartadvice_docroot'] upgrade_url = imunify_advice['upgrade_url'] description = imunify_advice['smartadvice_title'] detailed_description = imunify_advice['smartadvice_description'] iaid = imunify_advice["iaid"] for site in find_wp_paths(infected_docroot): website = f'/{site}' # for analytics: iaid-hash(username-domain-website) hashed_udw = hashlib.md5(f"{username}-{domain}-{website}".encode('utf-8')).hexdigest() adv_id = f'{iaid}_{hashed_udw}' im360_protection_advice = ThirdPartyAdvice(username=username, domain=domain, website=website, id=adv_id, type=ADV_TYPE, status='review', description=description, detailed_description=detailed_description, is_premium=False, module_name='imunify', license_status='NOT_REQUIRED', subscription_status='no', upgrade_url=upgrade_url, total_stages=0, completed_stages=0) advices_by_docroot.append(im360_protection_advice.to_advice()) return advices_by_docroot def im360_advice(self, cache_only=False) -> list: advices = [] if not self.is_im360_present(): return advices # Return only cache if cache_only: return self._im360_read_advice_cache() advice_list = self.call_im360_command([self.imunify360_agent, 'smart-advice', 'notifications', '--json']) logging.info('IM360 advice list: %s', str(advice_list)) if advice_list: items = advice_list.get('items', []) for item in items: try: advice_item = self._make_advice(item) except KeyError as e: logging.error('Unable to make advice based on item: %s, malformed error: %s', str(item), str(e)) continue advices.extend(advice_item) advices = self._filter_advice_list([item for item in advices if item['advice']['type'].startswith(ADV_TYPE)]) self._im360_update_advice_cache(advices) return advices def _im360_read_advice_cache(self) -> list: advice = [] if not os.path.exists(advice_list_im360_cache): return advice try: with open(advice_list_im360_cache) as f: advice = self._filter_advice_list(json.load(f)) except OSError as e: self.logger.exception('An OS error occurred while reading the cache for IM360: %s', e) except json.JSONDecodeError as e: self.logger.exception('Unable to read IM360 json advice cache: %s', e) return advice def _im360_update_advice_cache(self, advice): try: with open(advice_list_im360_cache, 'w') as f: json.dump(advice, f, indent=2) except OSError as e: self.logger.exception('An OS error occurred while updating the cache for IM360: %s', e) except json.JSONDecodeError as e: self.logger.exception('Unable to write IM360 json advice cache: %s', e)