NineSec Team Shell
Server IP : 184.107.3.203  /  Your IP : 216.73.216.51
Web Server : Apache
System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64
User : adminteladeoro ( 1015)
PHP Version : 8.2.28
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/python.cpython-36.opt-1.pyc
3

~�g*�@szddlZddlZddlZddlmZmZmZmZmZddl	m
Z
Gdd�de�ZGdd�deee�ZGdd	�d	ee�Z
dS)
�N)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPlugin�	PluginOpt)�
RHELPolicyc@s,eZdZdZdZdZd	Zd
ZdZdd�Z	dS)�PythonznCaptures information on the installed python runtime(s), as well as
    python modules installed via pip.
    zPython runtime�python�systemz	python -VcCsX|j|jdd�|jd�}|ddkrTx,|dj�dd�D]}|j|�d��q<WdS)	Nzpython-version)Zsuggest_filenamezwhereis pip -bZstatusr�output�z -v list installed)�add_cmd_output�python_versionZexec_cmd�split)�selfZpipsZpip�r�/usr/lib/python3.6/python.py�setup!s
zPython.setupN)r
)r	)
�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofiles�packagesrrrrrrrsrc@seZdZdZdZdS)�UbuntuPythonz
python3 -V�python3N)r)rrrrrrrrrr.srcsDeZdZdZdZeddd	d
�gZ�fdd�Zd
d�Zdd�Z	�Z
S)�RedHatPythona In addition to the base information, on Red Hat family distributions the
    python plugin also supports the 'hashes' option. If enabled, this plugin
    will generate a json-formatted listing of all pyfiles within the
    distribution-standard python package installation locations.
    r	�python36�python2r�platform-python�hashesFz#collect hashes for all python files)�defaultZdesccs<|jddg�t|jt�r.|jj�dkr.d|_t�j�dS)Nz
python2 -Vz
python3 -V�z/usr/libexec/platform-python -V)r
�
isinstanceZpolicyrZdist_versionr�superr)r)�	__class__rrrAs
zRedHatPython.setupcCs<|jd�r8|jd��}|jtj|j�dd��WdQRXdS)Nrzdigests.json�)�indent)Z
get_optionZcollection_file�write�json�dumps�
get_hashes)rZhfilerrr�collectHs
zRedHatPython.collectcCs�dgi}ddddg}x�|D]�}x�tj|j|��D]�\}}}x�|D]�}|jd�sPq@|j||�}yft|d��R}	tj�}
|	jd�}x|r�|
j|�|	jd�}q~W|
j	�}
|dj
||
d	��Wd
QRXWq@tk
r�|jd|���Yq@Xq@Wq0WqW|S)z! Get the hashes for Python files �digestsz/usr/libz
/usr/lib64z/usr/local/libz/usr/local/lib64z.py�rbi)�filepath�sha256NzUnable to read python file at )
�os�walkZ	path_join�endswith�open�hashlibr/�read�updateZ	hexdigest�append�IOErrorZ
_log_error)rr,Zpy_pathsZpy_path�root�_�filesZ_filer.�fileZdigest�datarrrr*Ms2




"zRedHatPython.get_hashes)r	rrrr)rrrrrrZoption_listrr+r*�
__classcell__rr)r$rr4s
r)r4r(r0Zsos.report.pluginsrrrrrZsos.policies.distros.redhatrrrrrrrr�<module>s

NineSec Team - 2022