Server IP : 104.244.120.118  /  Your IP : 216.73.216.198
Web Server : Apache
System : Linux ded5817.inmotionhosting.com 5.14.0-741.22.1.el9_9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 12 14:34:46 UTC 2026 x86_64
User : persoanlinjuryla ( 1006)
PHP Version : 8.5.13
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /../../opt/dedrads/python/../python/../python/../python/../__pycache__/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //../../opt/dedrads/python/../python/../python/../python/../__pycache__/cms_check.cpython-313.pyc
�

�i�ja&����SSKJr SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	J
r
JrJrJ
r
Jr "SS5r"SS5r"SS	5rS
rSr\S:Xa\"5 gg)
�)�PathN)�green�yellow�bold�blue�redc�*�\rSrSrSrSrSrSrSrg)�Fingerprint�
z'Fingerprint to find a CMS installation.c��XlX lURS5UlURS5UlS/S/S.Ul/Ulg)N�file�	signature�softaculous�
quarantine)��)�cms�fp_data�get�filenamer�excludes�paths_found)�selfrrs   �/opt/dedrads/cms_check.py�__init__�Fingerprint.__init__sD���������F�+��
� ���[�1���*�O���?��
����c
�H�SSSUR/n[R"U[R[RSS9nUR
GH!nUR
5n[RRU5(aURU5(aMPUR(a�[USS9n[R"URUR55nU(aUR R#U5 O=UR$R&R)[+URSU355 SSS5 GMUR R#U5 GM$ SSS5 g!,(df   GM?=f!,(df   g=f)	z.Uses mlocate to search for the file signature.z/bin/locatez-d�/var/lib/mlocate/mlocate.db�utf-8)�stdout�stderr�encoding�r#z not found within N)r�
subprocess�Popen�PIPE�DEVNULLr!�strip�os�path�exists�should_excluder�open�re�search�readr�appendr�main�print_debugr)r�cmd�proc�out_line�line�stream�matchs       rr0�Fingerprint.searchs5��
��)��M�M�	
���
�
���?�?��%�%��	
�
� �K�K���~�~�'���w�w�~�~�d�+�+�t�/B�/B�4�/H�/H���>�>��d�W�5�� "�	�	�$�.�.�&�+�+�-� H�� � �,�,�3�3�D�9� �H�H�M�M�5�5� #�t�~�~�&6�6H���$O� P��6�5��$�$�+�+�D�1�(�

�
�6�5��
�
�s&�A8F�<BF�+F�
F�
	F�
F!c	�>�URRRSU35 [U5nSUR;a[URU;aJURRR[SURSURS355 gOdURUR:waJURRR[SURSURS355 g[UR5Hhup4X0R;dMX@RU;dM*URRR[SUSUR355  g URRRR(d9URRRHnXRR;dM g	 Og	URRR[S
U355 g)z�Determines whether or not the path should be excluded.

Args:
    path (str): found path

Returns:
    bool: True if should be excluded, else False
zChecking excludes on �/z
excluded: z does not match �.Tzexcluded: excluded part, z in Fz4excluded: didn't determine if we shouldn't exclude: )rr3r4rrr�name�	enumerate�partsr�args�include_all�document_roots�parents)rr+�pos_path�index�part�docroot_paths      rr-�Fingerprint.should_exclude6s���	
���
�
�!�!�$9�$��"@�A���:���$�-�-���}�}�D�(����
�
�)�)��$�X�]�]�O�3C��=�=�/��,����)��}�}��
�
�-����
�
�)�)��$�X�]�]�O�4!�!%����q�2����$�X�^�^�4�K�E��
�
�%��=�=��/�/��H�H�M�M�-�-��7��v�>"�"*�.�.�!1�3��� �5��x�x�}�}�!�!�-�-� $���
�
� <� <���#3�#3�3� �!=�����
�
�!�!��F�t�f�M�N�	
�r)rrrrrrN)	�__name__�
__module__�__qualname__�__firstlineno__�__doc__rr0r-�__static_attributes__�rrr
r

s��1��2�<4rr
c�*�\rSrSrSSjrSrSrSrg)�CMS�mc�P�XlX lX0lX l/Ul/Ulg�N)r3r?�data�actual_name�fingerprints�versions)r�
cms_searchr?rWs    rr�CMS.__init__ns&���	��	��	��������
rc��URRS5UlURRS/5H9n[X5nUR	5 UR
R
U5 M; g)zHLoads the actual name and the fingerprints from the CMS Signature
data.
r?rYN)rWrrXr
r0rYr2)r�fingerprint�fps   r�load�CMS.loadvsY�� �9�9�=�=��0����9�9�=�=���<�K��T�/�B��I�I�K����$�$�R�(�=rc���0nURHPn[UR5S:�dMURH nURR	U5X'M" Us $ U$)z�Returns all installation paths found for the first fingerprint that
found an installation.

Returns:
    dict: key, value dictionary of path and docroot domain.
r)rY�lenrr3�find_docroot_domain)r�	all_pathsr_r+s    r�found_installations�CMS.found_installations�s\���	��#�#�B��2�>�>�"�Q�&��N�N�D�&*�i�i�&C�&C�D�&I�I�O�+� � �	$�
�r)rXrWrYr3r?rZN)r[�	CMSSearch)rKrLrMrNrr`rfrPrQrrrSrSms���)�
rrSc�J�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
g)
rh�c�,�0UlXl0UlgrV)rDrB�installs)rrBs  rr�CMSSearch.__init__�s�� ����	���
rc�d�UR5 UR5 UR5 g)z&Primary run entry to begin CMS search.N)�collect_docroots�
load_cms_data�display_results)rs r�run�
CMSSearch.run�s&�������������rc�d�URR(a[[U55 gg)z]Prints a debug message if verbose is enabled.

Args:
    message (str): the message to print
N)rB�verbose�printr)r�messages  rr4�CMSSearch.print_debug�s"���9�9����$�w�-� �rc��S00nURR5GH,up#UR5nURn[	U5S:�dM3UR
RS:Xa
[X$5 MZUR
RS:XaO[[[U555 UH n[XF5n[USU35 M" [5 M�UR
RS:XdM�UHGnXFnXQS;a0USU'XqSU;a/USUU'USUURU5 MI GM/ UR
RS:Xa [[R"U55 gg)zILists all found installations in a specific format based on given
flags.
rr�simple�normalz: �jsonN)rl�itemsrfrXrcrB�outputrvrrrr2r|�dumps)r�out_json�cms_name�cms_objrlrX�install�domains        rrq�CMSSearch.display_results�s_���2�;��!%���!4�!4�!6��H��2�2�4�H�!�-�-�K��8�}�q� ��9�9�#�#�x�/��(�-��Y�Y�%�%��1��$�v�k�2�3�4�#+��!&�x�'8�!9������7�)�4�5�$,��G��Y�Y�%�%��/�#+��!)�!2��&�u�o�=�;=�H�U�O�K�8�!�%���)E�E�CE�H�U�O�K�8��@� ����4�V�<�C�C�F�K�
$,�"7�*�9�9���v�%��$�*�*�X�&�'�&rc�V�[SSS9n[R"U[RS9nUH/n[	XX#5nUR5 X@R
U'M1 SSS5 g![Ran[U5 SnAN-SnAff=f!,(df   g=f)z1Safely loads the CMS signatures from a yaml file.z'/opt/dedrads/extras/cms_signatures.yamlr r$)�LoaderN)r.�yamlr`�
SafeLoaderrSrl�	YAMLErrorrv)r�infile�cms_yamlr�r�errs      rrp�CMSSearch.load_cms_data�s���
�5��
�
�
��9�9�V�D�O�O�D�� (�H��d�h�.@�A�C��H�H�J�.1�M�M�(�+�	!)�
�
���>�>�
��c�
�
��
��
�
�s/�B�AA.�.B�B�
B�B�B�
B(c��URR5H"up#U[U5R;dM Us $ g)z�Returns a domain for the document root that the provided
path belongs to.

Args:
    path (str): path of the installation

Returns:
    str: domain of the document root
z	no-domain)rDr}rrE)rr+rIr�s    rrd�CMSSearch.find_docroot_domain�s=��%)�$7�$7�$=�$=�$?� �L��t�D�z�1�1�1��
�%@�rc�2�[S5RS5H�n[U5RS5H�n[USS9nSnSnUR5H|nUR	S5(a*[UR5SR
55nUR	S5(dM[UR5SR
5nM~ U(aU(aXPRU'S	S	S	5 M� M� g	!,(df   M�=f)
z(Collects all document roots from cPanel.z/var/cpanel/userdata/�*r r$�z
documentroot:�zservername:N)r�globr.�	readlines�
startswith�splitr)rD)r�user_folder�	user_itemr9�docroot�
servernamer8s       rro�CMSSearch.collect_docroots�s���� 7�8�=�=�c�B�K�!�+�.�3�3�C�8�	��)�g�6�&� �G�!#�J� &� 0� 0� 2���?�?�?�;�;�&*�4�:�:�<��?�+@�+@�+B�&C�G��?�?�=�9�9�)-����a��)>�)>�)@�J�!3��:�7A�+�+�G�4�7�6�9�C�6�6�s�A,D�5AD�
Dc��[RRS5n[R"5U-
nUS:�a?URR
S:wa[
[S55 UR5 gg)zV
Checks the mlocate database modification age and runs update if
older than 24 hours.
ri�Qr|z%Locate DB is too old, running update.N)	r*r+�getmtime�timerBr~rvr�	update_db)r�mtime�diffs   r�check_db_age�CMSSearch.check_db_age�s_��
��� � �!>�?���y�y�{�U�"���%�<��y�y���6�)��f�D�E�F��N�N��rc���[R"S/5nURRS:XagU(a[	[S55 g[	[
S55 g)zUpdates the mlocate database.z
/bin/updatedbr|Nz"Failed to update mlocate database.zUpdated mlocate database.)r%�callrBr~rvrr)r�ret_codes  rr��CMSSearch.update_db�sG���?�?�O�#4�5���9�9���v�%����#�:�;�<��%�3�4�5r)rBrDrlN)rKrLrMrNrrrr4rqrprdror�r�rPrQrrrhrh�s0���
�!�(�:
�
�B� 
�	6rrhc��[R"SS9n/SQnURSSSUSS9 URS	S
SS9 URS
S
SS9 UR5$)NzPUses signatures to determine what CMS installations are installed on the server.)�description)r|rzr{z--output�?ztype of outputr{)�nargs�help�choices�defaultz
--include-all�
store_truezCIncludes all installations, including those not in a document root.)�actionr�z	--verbosezVerbose output.)�argparse�ArgumentParser�add_argument�
parse_args)rB�output_choicess  rr�r�s����"�"�
'��D�2�N������
�����	�����
�	��	���k�,�=N��O��?�?��rc�n�[5n[U5nUR5 UR5 grV)r�rhr�rr)rB�cms_searchers  rr3r3$s*���<�D��T�?�L��������r�__main__)�pathlibrr�r|r%r*r�r/r��
rads.colorrrrrrr
rSrhr�r3rKrQrr�<module>r�sf������	��	��5�5�]�]�@ � �Fu6�u6�p�8��z���F�r