Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.6/site-packages/agent360/plugins/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.6/site-packages/agent360/plugins/__pycache__/process.cpython-36.pyc

3

�uGh
�@sHddlZddlZddlZddlZGdd�dej�ZedkrDe�j�dS)�Nc@s eZdZdZdd�Zdd�ZdS)�Plugin�processcCsxtjd|�}|r*|jd�}|jd�p&d}nd}|}tjdd|tjd�}tjdd	|tjd�}tjd
d|tjd�}tjdd
|tjd�}tjdd
|tjd�}tjdd
|tjd�}tjdd|tjd�}tjdd
|tjd�}tjdd
|tjd�}tjdd
|tjd�}tjdd
|tjd�}tjdd
|tjd�}tjdd
|tjd�}tjdd
|tjd�}||j�}t|�dk�rt|dd�d}|S)Nz^(\S+)(\s+.*)?$���z	(/[^ ]+)+z/***)�flagszp(--(?:password|pass|pwd|token|secret|key|api-key|access-key|secret-key|client-secret|auth-key|auth-token)\s+\S+)z--***z
(-p\s+\S+)z-p ***za\b(?:password|pass|pwd|token|secret|key|api_key|access_key|client_secret|auth_key|auth_token)=\S+z***z!\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\bz$\b(?:[a-fA-F0-9:]+:+)+[a-fA-F0-9]+\bz(--port\s+\d+)z
--port ***z�\b(?:DB_PASS|DB_USER|AWS_SECRET_ACCESS_KEY|AWS_ACCESS_KEY_ID|SECRET_KEY|TOKEN|PASSWORD|USERNAME|API_KEY|PRIVATE_KEY|SSH_KEY|SSL_CERTIFICATE|SSL_KEY)\b=\S+z#\b(root|admin|cpanelsolr|user\d*)\bz6(\S+\.(pem|crt|key|cert|csr|pfx|p12|ovpn|enc|asc|gpg))zi\b(?:id_rsa|id_dsa|id_ecdsa|id_ed25519|known_hosts|authorized_keys|credentials|.env|docker-compose.yml)\bzK\b(?:jdbc|mysql|postgres|mongodb|redis|amqp|http|https|ftp|sftp|s3):\/\/\S+z:\b(?:https?|ftp):\/\/(?:\S+\:\S+@)?(?:[a-zA-Z0-9.-]+\.\S+)z2\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b��z...)�re�match�group�sub�
IGNORECASE�strip�len)�self�cmdlinerZinitial_pathZremaining_cmdlineZsanitized_cmdline�r�A/root/tmp/pip-build-gzoz1_uw/agent360/agent360/plugins/process.py�sanitize_command_lines0
zPlugin.sanitize_command_linecGs:g}�x.tj�D�] }y�|jddddddddd	g	d
�}y |jdj|d�j��|d<WnYnXtjdkr�t|dtj	�d
d�j�|d<t|dtj	�d
d�|d<t|dtj	�d
d�|d<yt|dtj	�d
d�|d<WnYnXWn8tj
k
�rYqtjk
�rYqYqX|j|�qW|S)N�pid�nameZppidZexer�usernameZcpu_percentZmemory_percentZio_counters)�attrs� ��replace)�errors)r)
�psutilZprocess_iterZas_dictr�joinr�sys�version_info�unicode�getdefaultencodingZ
NoSuchProcessZAccessDenied�append)rZunusedr�procZpinforrr�run,s4 

z
Plugin.runN)�__name__�
__module__�__qualname__rr&rrrrrs!r�__main__)rZpluginsr r
Z
BasePluginrr'�executerrrr�<module>sD

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists