관리-도구
편집 파일: execute.cpython-311.pyc
� IMg} � � � d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dl m Z d dlmZ d dl mZ d dlmZmZ e � � Zd� Zdd �Zej fd�ZdS ) � N)�Core��native)�EventHookLogger)� EventHook)�db)�run� snake_casec � � t j rg S t j � � � t j | k � � }t |� � S )N)r �deferredr �select�where�event�list)r �hookss �R/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/hooks/execute.py� get_hooksr sB � � �{� �� �����$�$�Y�_��%=�>�>�E���;�;�� Fc � �` K � |rt j | |� � d\ }}nbt j |� � � � � }t j � | � � }t | d||�� � � d {V ��\ }}}n(# t $ r}d t |� � }}Y d }~nd }~ww xY w||fS )N)r NT)�shell�input�cwd)�native_hooks�execute_hook�json�dumps�encode�os�path�dirnamer � Exception�repr)r �datar � exit_code�errr �_�es r r r s� � � � �'�� ��%�d�D�1�1�1�$�N�I�s�s��:�d�#�#�*�*�,�,�D��'�/�/�$�'�'�C�&)��D��#�'� '� '� !� !� !� !� !� !��I�q�#��� � '� '� '��t�A�w�w�3� � � � � � �����'���� �c�>�s �A?B � B)�B$�$B)c � �. K � | � d� � }t | � � }t | j � � }|sd S t | j | j � � 5 }|r�t | j j � � dz }t j d|d|�� � }t j ||� � |� � � t j |� � � � � |j |d<