Your IP : 216.73.216.246


Current Path : /proc/self/root/opt/sharedrads/__pycache__/
Upload File :
Current File : //proc/self/root/opt/sharedrads/__pycache__/cms_counter.cpython-313.pyc

�

��}j~�����SrSSKrSSKrSSKrSSKJr SSKrSSKrSSKrSSK	r	SSK
r
SSjrSrSSjr
SrSrSS	jrSS
jrSSjrSSjrSS
jrSSjrSr\S:Xa\"5 gg)a�
CMS Counter 2.5
07/24/2026
Corey S
-------
All Server Version
- Should be acceptable for any server environment
- Server Type determined by Fabric wrapper ckx.run_cms_counter() and passed to
  script via '-s'
- 3rd Party/Additional Panels added to determine_panel_type()
- Refactored NodeJS detection split into its own module
- '--new' switch added to only check newly provisioned accounts
- Overall code refactored to be more efficient
- Determine and print version of certain CMS
�N)�Pathc�:�SnU(ad[U5(aTUSLaO[R"USU[RS9RRS5R
5nU$U(as[U5(acUSLa^[R"USU[R[RS9RRS5R
5nU$U$![an[U5 SnAU$SnAff=f![a gf=f)z~
check_flag ignores if the command exits w/ anything other than 0 if True
error_flag sends errors to /dev/null if set to True
NT)�shell�check�stdout�utf-8F)rrr�stderr)
�str�
subprocess�run�PIPEr�decode�strip�	Exception�print�DEVNULL)�command�
check_flag�
error_flag�output�es     �/opt/sharedrads/cms_counter.pyrrs���
�F��3�w�<�<�J�$�$6�	������$�%�?�?�	�����w�����
�6�M�
�S��\�\�j�E�&9�
	������$�%�?�?�%�-�-������w�����
��M�6�M��#�	��!�H�H� �M��#	���	��	�s+�AC*�AD
�*
D
�4D�D
�
D�Dc���[RRS5(ag[RRS5(ag[RRS5(ag[RRS5(ag[RRS	5(d$[RRS
5(ag[RRS5(ag
[RRS5(ag[RRS5(ag[RRS5(agg)z�
Determines type of Panel in use on server, i.e. CWP, Platform i, Plesk, etc

Panels Currently Supported:
    - cPanel
    - CWP
    - Platform i
    - Webmin
    - Plesk
    - ISPConfig
    - DirectAdmin
    - CloudPanel
z/var/cpanel�cPanelz/usr/local/cwp�CWPz/etc/profile.d/wp3.sh�
Platform_iz/etc/webmin�Webminz&/etc/httpd/conf.d/zz010_psa_httpd.confz(/etc/apache2/conf.d/zz010_psa_httpd.conf�Pleskz/usr/local/directadmin�DirectAdminz/usr/local/bin/dploy�
CloudPanelz//home/admispconfig/ispconfig/lib/config.inc.phpzISPConfig-2z1/usr/local/ispconfig/interface/lib/config.inc.phpzISPConfig-3�cVPS��os�path�exists��r�determine_panel_typer(Cs���
�w�w�~�~�m�$�$��	�w�w�~�~�&�'�'��	�w�w�~�~�-�.�.��	�w�w�~�~�m�$�$��	�w�w�~�~�0���	�����2�
�
��	�w�w�~�~�.�/�/��	�w�w�~�~�,�-�-��	�w�w�~�~�9����	�w�w�~�~�;����r'c��SnUS:Xa1[RRUS35(a	SUS3S-nO�US:Xad[RRUS35(aS	US
3-S-nOi[RRUS35(a	S
US3S-nO8US:Xa2[RRUS35(aSUS3-S-nU(a[U5nU$SnU$! SnU$=f)z^
Determine the CMS version if possible
Currently supported CMS:
- Wordpress
- Moodle
- Joomla
N�	Wordpressz/wp-includes/version.phpzgrep -E 'wp_version =' z/wp-includes/version.php | zawk '{print $3}' | tr -d ';'�Joomlaz"/libraries/cms/version/version.phpzgrep -E 'public \$RELEASE' z%/libraries/cms/version/version.php | zawk '{print $4}' | tr -d ';'z/libraries/src/Version.phpzgrep -E 'const RELEASE' z/libraries/src/Version.php | �Moodlez/version.phpzgrep -E '\$release =' z/version.php | z&awk '{print $3" "$4" "$5}' | tr -d ';')r#r$r%r)�docroot�cms�version_cmd�versions    r�cms_versionr1ns9���K�
�k��
�7�7�>�>�w�i�'?�B�C�C�5�g�Y�>Y�\�`B�B�K��	���
�7�7�>�>�w�i�'I�L�M�M�<�G�9�Lq�?t�t�xZ�Z�K�
�W�W�^�^��	�)C�F�
G�
G�6�w�i�?\�_�cE�E�K��	���
�7�7�>�>�w�i�|�6�7�7�7�w�i��:Y�Y�]I�I�K��	��+�&�G��N����N��	��G��N�s�$C5�5C<c�X�[RRS5(ag[RRS5(ag[RRS5(ag[RRS5(ag[R"S5 g)z�Function to determine Apache config file to use to check domains as
different installs/versions can store the config in different files,
starting w/config for 2.2 and checking different 2.4 config locations
to endz!/usr/local/apache/conf/httpd.confz/etc/httpd/conf/httpd.confz/etc/apache2/httpd.confz/etc/apache2/conf/httpd.confz.Unable to determine Apache config!
Quitting...N�r#r$r%�sys�exitr&r'r�identify_apache_configr6�sm��

�w�w�~�~�9�:�:�2�	�w�w�~�~�2�3�3�+�	�w�w�~�~�/�0�0�(�	�w�w�~�~�4�5�5�-��H�H�
>�?r'c��[RRS5(ag[RRS5(ag[RRS5(ag[R"S5 g)z$
Function to find NGINX config file
z/etc/nginx/vhostsz/etc/nginx/conf.d/vhostsz/etc/nginx/nginx.confz/Unable to locate NGINX config file! Quitting...Nr3r&r'r�identify_nginx_configr8�sV��
�w�w�~�~�)�*�*�"�	�w�w�~�~�0�1�1�)�	�w�w�~�~�-�.�.�&��H�H�
>�?r'c�,�/nU(Ga�S[U5;Ga�URS5Sn[RR	US35(a�[US3SS9nUR
5H^nSU;dMUR5SR5RS	5nUS
U3U;dMHURUS
U35 M` SSS5 [U5S:Xa�[S
U3SSS9nU(a�UR5(a�[SUS3SSS9RS5n[U5S:�a�USS:wa�UH�n	[SU	S3SSS9n
[SU	S3S-SSS9RS5SnX�-nU(dMD[RR	U5(dMjUS
U3U;dMwURUS
U35 M� U$!,(df   GN=f![a gf=f![a  gf=f)z-
Find possible Node.JS installs per doc root
�
�/�z
/.htaccessr��encoding�PassengerAppRoot��"�:Nrzid -u F�rrz	pgrep -U z node�zpwdx z | cut -d ':' -f 2zps --no-headers -o command � | zawk '{print $2}'�.)
r
�splitr#r$r%�open�	readlinesr�appendr�lenr�isdigit)r-�domain�install_list�user�htaccess�line�install_dir�user_id�
node_procs�pid�cwdrs            r�find_nodejsrW�sF���L��4�s�7�|�+��}�}�S�!�!�$��
�7�7�>�>�w�i�z�4�5�5�
�� �	��.���� (� 2� 2� 4��-��5�*.�*�*�,�q�/�*?�*?�*A�*G�*G��*L�K�%+�H�A�k�]� =�'3�!4�
!-� 3� 3�)/���+��$A�!"�!5��$
����"���4�&�#��%��G��7�?�?�,�,�!�!�'��%�2�$�$���%��+�	�
�z�?�Q�&�:�a�=�B�+>�)��(�"%�$)�#��.@� C�+0�+0�#�C�
'*�$?��u�C� J�"8�!9�+0�+0�	'�
$�e�C�j��',�G�+.�-�K�(�K� "�����{� ;� ;�%+�H�A�k�]� =�#/�!0�)�/�/�V�H�A�k�]�0M�N�- *�.��o����
��
��> )�(�#'�(�sN�
G5�$G#�9G#�=G#�G5�7H�#
G2�-G5�2G5�5
H�H�
H�Hc��[U5nUS3SUS3SUS3SUS3SUS	3S
US3SUS
3SUS3SUS3SUS3SUS3SUS3SUS3SUS3SUS3S0nUR5H-up#[RR	U5(dM+Us $ [RR	US35(ac[US3SS9nUR
5H8n[R"SU[R5(dM0 S S S 5 g S S S 5 [RR	US!35(ag"[RR	US#35(a�[RR	US35(ad[US3SS9nUR
5H8n[R"S$U[R5(dM0 S S S 5 g% S S S 5 g&g&[RR	US'35(a�[RR	US(35(ag)[US'3SS9nUR
5HnS*U;dM S S S 5 g* [RR	US+35(aE[US+3SS9nUR
5HnS,U;dM S S S 5 S S S 5 g, S S S 5 S S S 5 g-[RR	US.35(ag/g !,(df   GN=f![an[U5 S nAGN,S nAff=f!,(df   g&=f![an[U5 S nAGN�S nAff=f!,(df   N�=f!,(df   N�=f![an[U5 S nAN�S nAff=f)0zbDetermine CMS manually with provided document root by matching expected
config files for known CMSz
/concrete.php�Concretez	/Mage.php�Magentoz/clientarea.php�WHMCSz/configuration.phpr+z/ut.php�PHPListz/passenger_wsgi.py�Django�)/wp-content/plugins/boldgrid-inspirations�Boldgridz/wp-config.phpr*z/sites/default/settings.php�Drupalz/includes/configure.php�ZenCartz/config/config.inc.php�
Prestashopz/config/settings.inc.phpz/app/etc/env.phpz/app/etc/local.xmlz/vendor/laravel�Laravelz
/index.phprr=�CodeIgniterNz/main.ts�Angularz/main.js�	bootstrap�	Bootstrap�
Javascriptz/config.phpz/admin/config.php�OpenCartr,z	/cron.php�phpBB�Undeterminedz/index.html�HTML)r
�itemsr#r$r%rHrI�re�search�
IGNORECASErr)	r-�cms_dictionary�config_file�content�indexrQr�config�crons	         r�
determine_cmsrw�s����'�l�G�
�I�]�%�z�
�I�Y�!�9�
�I�_�'��
�I�'�*�H�
�I�W���
�I�'�*�H�
�I�>�A�:�
�I�^�&��
�I�0�3�X�
�I�,�/��
�I�+�.��
�I�-�0�,�
�I�%�(�)�
�I�'�*�I�
�I�_�'���N�"!/� 4� 4� 6���
�7�7�>�>�+�&�&��N�!7�
�w�w�~�~�7�)�:�0�1�1�	��7�)�:�0�7�C�u�!�O�O�-�D��y�y���b�m�m�D�D�,�D�C�-�D�
�w�w�~�~�7�)�8�.�/�/��	�w�w�~�~�7�)�8�.�/�/�
�7�7�>�>�w�i�z�4�5�5�	
�� �	��.���� %��� 1���9�9�[�$��
�
�F�F�#.���!2��$� �	�w�w�~�~�7�)�;�1�2�2�
�7�7�>�>�w�i�'8�;�<�<��	��7�)�;�1�G�D��"�,�,�.�D��4�'�'�E�D�.��7�7�>�>�w�i�y�";�<�<��$�I�Y�1�G���$(�N�N�$4�D�&�$��'.��E�D�%5��&�E�D�
�w�w�~�~�7�)�;�1�2�2���YD�C���	��!�H�H��	����$���
��a����
�����E�D���	��!�H�H��	�s�
L5�=L#�L#�L5�L#�L5�
M)�(=M�)M�*M)�3M�5M)�
N.�N�8N�9N.�6N�8N�N�N�N.�&N�(	N�1N.�#
L2�-L5�2L5�5
M�?M�M�
M&�"M)�&M)�)
N	�3N�N	�
N	�N�
N+�'N.�+N.�.
O
�8O�O
c��U(aL[RRU5(a([RRUS35(agg)Nr^r_r*r"��	directorys r�double_check_wordpressr{9s?���R�W�W�^�^�I�.�.�
�7�7�>�>���D�G�
�
��r'c�r�SnUS:XaSUSUS3S-nUnO�US:Xa�URS5nSU;agURS	5S
:�a�SnURS	5SS:XaFURS	5n[U5S-
nS
nXv::aXTU-
nXv:waUS-
nUS-
nXv::aMUnO4[U5S-
nS
nXv::aXTU-
nXv:waUS-
nUS-
nXv::aMUnUSU3n[R
R
U5(a
SUS3S-nOSnU(a
[U5n	U	$[SW35 g)N�apachezgrep 'ServerName z' z -A3 | grep DocumentRoot | zawk '{print $2}' | uniq�nginxz.conf�*�_rrDr@r<rFr;z
grep root rEz#awk '{print $2}' | uniq | tr -d ';'zCannot determine docroot for: )	�removesuffix�countrGrKr#r$r%rr)
rM�web_server_config�
web_server�docroot_cmd�domain_name�
new_domain�limit�start�nginx_configr-s
          r�manual_find_docrootr�Bs����K��X����x�r�*;�)<�=#�
#�%C�
D�	���	�w�	��)�)�'�2���;������S�!�A�%��J�� � ��%�a�(�B�.�)�/�/��4���K�(�1�,�����n��e�"4�4�J��~�"�c�)�
��Q�J�E�	�n�
)���K�(�1�,�����n��e�"4�4�J��~�"�c�)�
��Q�J�E�	�n�
)��,�,�A�f�X�6��
�7�7�>�>�,�'�'��|�n�C�2�<�=�
�
�K���k�"��
�N�	�0��
�@�A�r'c�
�Uc/nUc/nUc/nSnSnSn0n/n	/n
/SQn[S5n[S5n
Sn[U
5S:XaSn[5nU(a	SUS3S	-nO([U5S:XaS
n[5nU(aSUS3nU(a[U5nU(GaSUR	5GH>n[UUUS
9nU(dM[RRU5(dM>/nU	RU5 URUU05 U[UUS9-
n/US3PUS3PUS3PUS3PUS3PUS3PUS3PUS3PUS3PUS3PUS3PUS3PUS3PUS3PUS3PUS3PUS3PUS 3PUS!3PUS"3PUS#3PUS$3PUS%3PUS&3PUS'3PUS(3PUS)3PUS*3PUS+3PUS,3PUS-3PUS.3PUS/3PUS03PUS13PUS23PUS33PUS43PUS53PUS63PUS73PUS83Pn[U5nUR5H�n[RRU5(dM)UR5(dM@[U5U;dMQU[[U5US9-
n[[RR!U55n[U5nU	RU5 URUUS9U305 URU5 M� GMA ['U5S::�aUn
[RRS;5(a�['U5S<:Xa�[S;5n[)S=S>S?9nUR+5nSSS5 UR5H�nUR5(dM['UR05S:-
nWH]nUR0UUR	SA5S<:XdM*UR0UU;dM?U
RUR0U5 M_ M� ['U
5S::�Ga�['U	5S::�Ga�U	GH�nSnSnU
H$nUU;aMUUR	S95;dM"Un O [3USB9n[U5R55SC:XaU(aUU;aURU5 O;[U5R55SD:XaU(aUU;aURU5 U(a[75n [9UUSE9n!U(a�U(a�UU;a�UR;US5n"[<R>"5R	SF5S<n#[RRSGU35(a![SHU35R	SI5S:n$OSJn$U(a#[%U#SKUSKW SKUSKU$SKU"SKUSKW!35 O[%USKU"SKU35 WH:n%U(a[%W#SKUSKW SKUSKW$SKU%SL35 M)[%USKU%SL35 M< GM� [%SM['U535 [%SN['U535 g![a GN0f=f![a GN�f=f!["a GM�[an[%U5 SnAGM�SnAff=f!,(df   GNC=f![a [,R."S@5 GNif=f)Oz?
Function to get counts of CMS from all servers without cPanel
N�<�root�bin�daemon�adm�sync�shutdown�halt�mail�games�ftp�nobodyzsystemd-network�dbus�polkitd�rpc�tss�ntp�sshd�chrony�nscd�named�mailman�cpanel�cpanelcabcache�cpanellogin�cpaneleximfilter�cpaneleximscanner�cpanelroundcube�cpanelconnecttrack�cpanelanalytics�cpses�mysql�dovecot�dovenull�mailnull�cpanelphppgadmin�cpanelphpmyadmin�rpcuser�	nfsnobody�_imunifyz
wp-toolkit�redisr~�telegraf�sssd�scops�clamav�tier1adv�inmotion�hubhost�tier2s�lldpd�patchman�moveuser�postgres�
cpanelsolr�saslauth�nagios�wazuhzsystemd-bus-proxyz6systemctl status nginx 1>/dev/null 2>/dev/null;echo $?z6systemctl status httpd 1>/dev/null 2>/dev/null;echo $?�0r}zgrep ServerName rEz!awk '{print $2}' | sort -g | uniqr~zfind zR -type f -name '*.conf' -print | grep -Ev '\.ssl\.conf' | xargs -d '
' -l basename�rMr�r��r-rMz	/wp-adminz/wp-includesz/wp-contentz/wp-jsonz/adminz/cachez/tempz/tmpz
/__wildcard__z/cgi-binz/.well-knownz/configz	/languagez/pluginsz/mediaz
/librariesz/imagesz	/includesz/includez/modulesz/componentsz
/templatesz/cliz/layoutsz/storagez/logsz/binz/uploadsz/docsz/stylez/filesz/soundsz/cartz/shopz/assetsz/systemz/documentationz/applicationz/scriptz/scriptsz/backupsz/backupr;r@z/homerz/etc/passwdrr=z&Unable to read /etc/passwd!
Exiting...rB)r-�	wordpress�boldgrid)r-r.rFz/var/cpanel/users/�grep PLAN /var/cpanel/users/�=zN/A� z NodeJS�Unique Wordpress Users: �Unique Boldgrid Users: ) rr
r6r8rGr�r#r$r%rJ�updaterWrr�iterdir�is_dir�basename�NotADirectoryErrorrrKrHrIr4r5�partsrw�lowerr(r1�get�socket�gethostname)&�verbose�server�	user_list�unique_wordpress_users�unique_boldgrid_usersr��domains_cmd�domains_list�domains�docroot_list�users�	sys_users�nginx_status�
apache_statusr�r�r-�
node_installs�bad_dirs�docroot_dir�d�dirnamer�	users_dir�passwd�passwd_file�ur�rQ�get_cms�docroot_userrO�ptr0rM�hostname�	plan_type�installs&                                      r�cms_counter_no_cpanelr�vs������	��%�!#���$� "�����K��L��G��L��E�=�I�|�D��L��D��M��J�
�=��S� ��
�2�4���$�%6�$7�s�=�:�;�
��


�\�	�c�	!��
�1�3����)�*�+G�G�
���;�'���'�-�-�/�K�)�"�"3�%��G�
�w�2�7�7�>�>�'�2�2� "�
��#�#�G�,����W�I�{�m�G�H��"�[� '��&��M�+� �	��-�+� �	��0�+�!�	��/�+�!�	��,�	+�
!�	��*�+�!�	��*�
+�!�	��)�+�!�	��(�+�!�	��1�+�!�	��,�+�!�	��0�+�!�	��+�+�!�	��-�+�!�	��,�+�!�	��*�+� !�	��.�!+�"!�	��+�#+�$!�	��-�%+�&!�	��,�'+�(!�	��,�)+�*!�	��/�++�,!�	��.�-+�.!�	��(�/+�0!�	��,�1+�2!�	��,�3+�4!�	��)�5+�6!�	��(�7+�8!�	��,�9+�:!�	��)�;+�<!�	��*�=+�>!�	��*�?+�@!�	��+�A+�B!�	��)�C+�D!�	��)�E+�F!�	��+�G+�H!�	��+�I+�J!�	��2�K+�L!�	��0�M+�N!�	��+�O+�P!�	��,�Q+�R!�	��,�S+�T!�	��+�U+��X#�7�m���(�0�0�2���G�G�N�N�1�-�-� !���
�
� #�A��h� 6�%� -��,/��F�;�2"�!"�
�
'*�"�'�'�*:�*:�1�*=�&>�G� #�A��A�(�/�/��2�#�N�N�&'�S�+��a��y�-K� L��%�O�O�A�.�%3�C0�v�9�~�����
�w�w�~�~�g���3�y�>�Q�#6���M�	�	@��m�g�6�&�$�.�.�0��7��"�"�$�A��x�x�z�z��A�G�G��q�(��'�D������$�*�*�S�/�!�*<�<��G�G�E�N�)�;����Q�W�W�U�^�4�(�%��5�z�Q��3�|�,��1�#�G��G��L����9�$���7�=�=��-�-�#'�L���$�G�4�G��G��"�"�$��3� � �(>�>�&�-�-�l�;��G��"�"�$�
�2� � �(=�=�%�,�,�\�:��)�+��%�g�'�B���<�L�	�,I� ���'��t�<��!�-�-�/�5�5�c�:�1�=���7�7�>�>�$6�|�n�"E�F�F� #�8���I�!��e�C�j��!$�I�!&�I���#�*�A�f�X�Q�r�d�!�L�>��$�+�Q�v�h�a��y��'��D��
�|�n�A�f�X�Q�w�i�B�C�(����#�*�A�f�X�Q�r�d�!�L�>��$�+�Q�w�i�w�8��
�|�n�A�g�Y�g�@�A�)�U$�f
�&�s�+A�'B�&C�
F�G�	�%�c�*?�&@�%A�
D�E��i!�����v$-�%� $�%��*��� ���!�H�����7�6���	@��H�H�>�?�	@�s��
Y
�
5Y/�Y/�
Y/�,Y�A2Y/�	
Z2�Z �$Z2�
Y�Y�
Y,�(Y/�+Y,�,Y/�/
Z�=	Z�Z�Z� 
Z/�*Z2�/Z2�2 [�[c�0�Sn/n/n0SS_SS_SS_SS	_S
S_SS
_SS_SS_SS_SS_SS_SS_SS_SS_SS_S S!_S"S#_S$S%S&.En0n0n/n	/n
/S'Qn[R=n(aURU5 [RRS(5(a�U(aS)n
[
U
5RS*5n	O�[S(5nUR5Hzn[UR5S+-
nUR5(aM2URUS,:wdMGS-URU;dM\U	RURU5 M| O[R"S.5 [U	5S:Xa[R"S/5 [RRS(5(d[R"S05 O&[RRS15(aS+nUS+:XGa5U	GHwnUU;aM[
S2U35RS35S+nS4nS4n/nS5US63n[
US7S7S89n[R "U5nU(a'S9UR%5;aU
RU5 M�U(Ga#UVs/sH
nUS9:wdMUPM nnUGHnUUS:nUUS;nUUS<nU(dUUS=nUUnU(a�U(a�US?:Xa�UUS@n[)USA9n[+U5R-5SB:XaU(aUU;aURU5 O;[+U5R-5SC:XaU(aUU;aURU5 USDU3-nUR/UU05 UR/UU05 M�GMGM OU
RU5 GM�[
SES7SF9n[
SGS7SF9n SHUSI3n![
U!S7SF9RS*5n"U"GHn#[U#RSJ55S+:�dM$[+U#RSJ5S+5R15[+U5R15:XdMlU#RSJ5Sn$[+U5SK:Xa
[35n%SLn&O*[+U 5SK:Xa
[55n%SMn&O['SN5   g4[7U$U%U&SO9nU%(dM�U(dM�U[9UU#RSJ5SR15SP9-
nGM [U5S:�dGM$UHMnUR/URSJ5S+SQ05 UR/URSJ5S+U05 MO GMz U(ap[:R<"5RSR5Sn'UR?5H4unn(URAUS45n)['U'SDUSSU)SDWSDUSDU(35 M6 OMUR?5H+unn(URAUS45n)['U)SDUSDU(35 M- O
[CUUUUST9 [U
5S+:�a[CU
UUUUSU9 g4['SV[U535 ['SW[U535 g4!["a S4nGNAf=fs snf!["a ['US>35 GMf=f!["an['U5 S4nAGM4S4nAff=f!["a GM�f=f!["an['U5 S4nAN�S4nAff=f)Xa
Function to determine CMS counter on servers with cPanel
Attempting to use Softaculous first
Checking manually if that returns no results
Including users list as passed variable so we can run against specific users
only as well, future-proofing/anticipating possible request
r�503z
Moodle 3.5�542r,�98z
Moodle 2.6�343z
Moodle 2.0�517z
Moodle 3.7�485z
Moodle 3.6�670z
Moodle 3.9�668z
Moodle 3.8�699zMoodle 3.11�681zMoodle 3.10�706z
Moodle 4.0�713z
Moodle 4.1�67zMagento 1.9�545zMagento 2.3�465zMagento 1.7�486zMagento 2.2�665rZz
Magento 2.4.2zMagnto 2.4.1)�688�709r��/var/cpanel/usersz(tail -250 /etc/passwd | cut  -d ':' -f 1r:r@�systemz.bakz-Unable To Determine cPanel Users!
Quitting...zNo Users Detected. Quitting...z cPanel not detected. Quitting...z/var/softaculousr�r�Nzp/usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/cli.php --list_ins --user=z --resp=jsonFrC�error�script_name�softurl�ver�sidz: Error determining CMS�	WordPress�softpathryr�r�r�z*systemctl status httpd &>/dev/null;echo $?)rz*systemctl status nginx &>/dev/null;echo $?z	grep -E 'z$' /etc/userdomainsrBr�r}r~z$Unable to identify web server configr�r��NodeJSrFz cPanel )r�r�r�r�)r�r�r�r�r�r�r�)"�rads�SECURE_USERrJr#r$r%rrGrr�rKr�r�r4r5�json�loadsr�keysrr{r
r�r�rr6r8r�rWr�r�rmr�r�)*r��newr��softaculousr�r��softaculous_ids�cms_info�site_ownersr��no_install_usersr��secure_user�
user_list_cmdr�r�r�rOr��
user_installs�user_installs_jsonr��cmdr�rN�user_cms�urlr0rr-rr�r��get_domains_cmd�domain_list�
domain_stringrMr�r�r�r.�
site_owners*                                          r�cms_counter_cpanelr+�s����K�����
�
�|��
�x��	
�l��	�|�	�
	�|��	�|�
�	�|��	�|��	�}��	�}��	�|��	�|��	
�m��	�}��	�}�� 	�}�!�"	�y�#�$��'�O�*�H��K��I���=�I�|�&�&�&�{�&�����%�	�w�w�~�~�)�*�*��J�M��M�*�0�0��6�I��0�1�I��&�&�(���A�G�G��q�(�����
�
������(�2��a�g�g�e�n�4��$�$�Q�W�W�U�^�4�)�	���A�B�
�9�~������1�2�
�7�7�>�>�-�.�.����3�4�
�7�7�>�>�,�-�-��K��a���D��y� ��� <�T�F�E�F�L�L�����I�!�M�!%���M�%�%)�F�,�8�
�
 ���%�H�M�
*�%)�Z�Z�
�%>�"�"�g�1C�1H�1H�1J�&J� �'�'��-��!�$6� �#5���'�)��#5�� �
 ,�G�,!�#5�g�#>�}�#M��0��9�)�D��"4�W�"=�e�"D�� (�	)�&8��&A�$)�'"��,;�$'�,"��$�� (�;�6�*<�W�*E�$.�+"��,B�.5�,"��%(��M�$7�$7�$9�[�$H�(,�(,�4J�(J�$:�$A�$A�$�$G�$'��M�$7�$7�$9�Z�$G�(,�(,�4J�(J�$9�$@�$@��$F�'/�A�g�Y�-�'?�H�$�O�O�S�(�O�<�'�.�.��T�{�;�1),�8�% ,�^!�'�'��-�� �@� ��M��@� ��L�#,�D�6�1D�G�O��o�%�@�F�F���K�
"-�
��
�+�+�C�0�1�A�5��M�/�/��4�Q�7�8�>�>�@��4�y���(�)�+�0�0��5�a�8�F��=�)�S�0�,B�,D�)�%-�
��\�*�c�1�,A�,C�)�%,�
��D�E��1�%�*;�#-��G�
)�(�W�W�!�)�[�(/�'4�':�':�3�'?��'B�'H�'H�'J�.��M�/"-�:�=�!�A�%�,�G��O�O�W�]�]�3�%7��%:�H�$E�F��&�&��
�
�c�(:�1�(=�t�'D�E�	 -�w�@��)�)�+�1�1�#�6�q�9�H�$�N�N�,���S�(�_�_�S�$�7�
���j��&���*��Q� �k��3�%�q���/��-�%�N�N�,���S�(�_�_�S�$�7�
��:�,�a��u�A�c�U�5�6�-�
	�!���'=�&;�	
�	����"��&���#9�"7�	
��	�*�3�/E�+F�*G�J�K�
�)�#�.C�*D�)E�H�I�
��k�
*�%)�"�
*�� ��($-�)� %�4�&�0G�&J� K� (�)��8%�!��a�� ��!��b )�!� �!��:�	��!�H�H��	�s��Z�
Z�Z�-[�

Z �C
[�-[$�0[6�Z�Z� Z=�8[�<Z=�=[�
[!�
[�[!�$
[3�2[3�6
\�\�\c
��[R"SS9nURSSSSSSS	S
9 URSSS
SSSS	S
9 URSSSSSS9 [UR	55n/SQnSnUH>nUSUR5:Xd"USU:XdUSUR
5:XdM<Un O U(d[R"S5 USn[RRS5(a
[XSS9 g[XSS9 g)z{Main function, initializes global variables as globals, gets hostname and
call relevant checks after determining enviromentzCMS Counter 2.1)�descriptionz-vz	--verboser�z,Include Panel Type and Server Type in output�store_constTF)�dest�help�action�const�defaultz-nz--newrz2Check the 250 most recently provisioned users onlyz-sz
--server-typer�z(Server Type - passed by Fabric generally�store)r/r0r1)�Shared�Reseller�Hub�VPS�	DedicatedNz"Server Type not given!
Quitting...r)r�r�)�argparse�ArgumentParser�add_argument�vars�
parse_argsr��upperr4r5r#r$r%r+r�)�parser�args�server_types�server_type�st�verbs      r�mainrF�s+���
$�
$�1B�
C�F�
�����
�
;�����������
�
A�����������
�
7������!�!�#�$�D�D�L��K�����N�b�h�h�j�(��H�~��#��H�~�����+��K�������6�7��	�?�D�	�w�w�~�~�)�*�*��4�<��d�?r'�__main__)NTT)NN)N)NNN)FNNNN)FFN)�__doc__r#rr4�pathlibrr:rrnr�rrr(r1r6r8rWrwr{r�r�r+rF�__name__r&r'r�<module>rKs����
��
����	�
��#�L)�V�D
@� 
@�@�FF�R�1�j
�����ZF�zj�Z	/@�d�z���F�r'