Linux cyberpanel 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
LiteSpeed
: 160.191.175.3 | : 216.73.216.114
Cant Read [ /etc/named.conf ]
8.2.29
aodai6801
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
local /
CyberCP /
plogical /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
.my.cnf.4370
0
B
-rw-r--r--
.mysql.4370
0
B
-rw-r--r--
Backupsv2.py
59.03
KB
-rw-r--r--
ClusterManager.py
17.68
KB
-rw-r--r--
CyberCPLogFileWriter.py
4.37
KB
-rw-r--r--
CyberPanelUpgrade.py
3.64
KB
-rw-r--r--
DockerSites.py
61.86
KB
-rw-r--r--
IncScheduler.py
88.07
KB
-rw-r--r--
SwitchOldAliasToNew.py
2.4
KB
-rw-r--r--
__init__.py
0
B
-rw-r--r--
acl.py
50.61
KB
-rw-r--r--
acl.py.backup_dns_fix
48.95
KB
-rw-r--r--
adminPass.py
2.41
KB
-rw-------
alias.py
647
B
-rw-r--r--
apiAccess.py
418
B
-rw-r--r--
applicationInstaller.py
352.05
KB
-rw-r--r--
backupSchedule.py
22.21
KB
-rw-r--r--
backupScheduleLocal.py
5.31
KB
-rw-r--r--
backupUtilities.py
110.15
KB
-rw-r--r--
bandwidthReset.py
7.25
KB
-rw-r--r--
cPanelImporter.py
41.33
KB
-rw-r--r--
childDomain.py
1.25
KB
-rw-r--r--
cronUtil.py
5.34
KB
-rw-r--r--
csf.py
48.63
KB
-rw-r--r--
customACME.py
51.55
KB
-rw-r--r--
dnsUtilities.py
38.7
KB
-rw-r--r--
domain.xml
0
B
-rw-r--r--
emergency_2fa_disable.py
1.24
KB
-rw-r--r--
filesPermsUtilities.py
6.17
KB
-rw-r--r--
filesPermsUtilities.py.bak
6.17
KB
-rw-r--r--
findBWUsage.py
4.6
KB
-rw-r--r--
firewallUtilities.py
8.18
KB
-rw-r--r--
ftpUtilities.py
7.56
KB
-rw-r--r--
getSystemInformation.py
5.29
KB
-rw-r--r--
hashPassword.py
1.22
KB
-rw-r--r--
httpProc.py
4.81
KB
-rw-r--r--
installUtilities.py
19.04
KB
-rw-r--r--
letsEncrypt.py
0
B
-rw-r--r--
mailUtilities.py
104.79
KB
-rw-r--r--
modSec.py
26.71
KB
-rw-r--r--
mysqlUtilities.py
41.46
KB
-rw-r--r--
phpUtilities.py
19.8
KB
-rw-r--r--
phpmyadminsignin.php
2.08
KB
-rw-r--r--
pluginManagerGlobal.py
813
B
-rw-r--r--
processUtilities.py
22.42
KB
-rw-r--r--
randomPassword.py
200
B
-rw-r--r--
rebuildQuotas.py
3.29
KB
-rw-r--r--
remoteBackup.py
14.81
KB
-rw-r--r--
remoteTransferUtilities.py
16.43
KB
-rw-r--r--
renew.py
5.64
KB
-rwxr-xr-x
restoreMeta.py
7.65
KB
-rw-r--r--
serverLogs.py
735
B
-rw-r--r--
sslUtilities.py
49.26
KB
-rw-r--r--
sslv2.py
26.18
KB
-rw-r--r--
test.py
0
B
-rw-r--r--
test1.py
0
B
-rw-r--r--
tuning.py
18.08
KB
-rw-r--r--
upgrade.py
213.62
KB
-rw-r--r--
upgrade.py.bak
97.03
KB
-rw-r--r--
upgradeCritical.py
1.15
KB
-rwx------
vhost.py
47
KB
-rw-r--r--
vhostConfs.py
14.41
KB
-rw-r--r--
virtualHostUtilities.py
92.31
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : renew.py
#!/usr/local/CyberCP/bin/python import os import os.path import sys import django from typing import Union, Optional from datetime import datetime, timedelta import time sys.path.append('/usr/local/CyberCP') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings") django.setup() from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging from websiteFunctions.models import Websites, ChildDomains import OpenSSL from plogical.virtualHostUtilities import virtualHostUtilities from plogical.processUtilities import ProcessUtilities class Renew: def _check_and_renew_ssl(self, domain: str, path: str, admin_email: str, is_child: bool = False) -> None: """Helper method to check and renew SSL for a domain.""" try: logging.writeToFile(f'Checking SSL for {domain}.', 0) file_path = f'/etc/letsencrypt/live/{domain}/fullchain.pem' if not os.path.exists(file_path): logging.writeToFile(f'SSL does not exist for {domain}. Obtaining now..', 0) virtualHostUtilities.issueSSL(domain, path, admin_email) return logging.writeToFile(f'SSL exists for {domain}. Checking if SSL will expire in 15 days..', 0) with open(file_path, 'r') as cert_file: x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert_file.read()) expire_data = x509.get_notAfter().decode('ascii') final_date = datetime.strptime(expire_data, '%Y%m%d%H%M%SZ') now = datetime.now() diff = final_date - now ssl_provider = x509.get_issuer().get_components()[1][1].decode('utf-8') logging.writeToFile(f'Provider: {ssl_provider}, Days until expiration: {diff.days}', 0) # Check if certificate is expired or needs renewal needs_renewal = diff.days < 15 # This handles both negative (expired) and soon-to-expire certs if not needs_renewal and ssl_provider != 'Denial': logging.writeToFile(f'SSL exists for {domain} and is not ready to renew, skipping..', 0) return # Handle expired certificates (negative days) with higher priority if diff.days < 0: logging.writeToFile(f'SSL for {domain} is EXPIRED ({abs(diff.days)} days ago). Forcing renewal..', 0) logging.writeToFile(f'Attempting SSL renewal for expired certificate: {domain}..', 0) result = virtualHostUtilities.issueSSL(domain, path, admin_email) if result[0] == 0: logging.writeToFile(f'SSL renewal FAILED for {domain}: {result[1]}', 1) else: logging.writeToFile(f'SSL renewal SUCCESSFUL for {domain}', 0) elif ssl_provider == 'Denial' or ssl_provider == "Let's Encrypt": logging.writeToFile(f'SSL exists for {domain} and ready to renew (expires in {diff.days} days)..', 0) logging.writeToFile(f'Attempting SSL renewal for {domain}..', 0) result = virtualHostUtilities.issueSSL(domain, path, admin_email) if result[0] == 0: logging.writeToFile(f'SSL renewal FAILED for {domain}: {result[1]}', 1) else: logging.writeToFile(f'SSL renewal SUCCESSFUL for {domain}', 0) elif ssl_provider != "Let's Encrypt": logging.writeToFile(f'Custom SSL exists for {domain} and ready to renew..', 1) except OpenSSL.crypto.Error as e: logging.writeToFile(f'OpenSSL error for {domain}: {str(e)}', 1) except Exception as e: logging.writeToFile(f'Error processing SSL for {domain}: {str(e)}', 1) def _restart_services(self) -> None: """Helper method to restart required services.""" try: logging.writeToFile('Restarting mail services for them to see new SSL.', 0) commands = [ 'postmap -F hash:/etc/postfix/vmail_ssl.map', 'systemctl restart postfix', 'systemctl restart dovecot', 'systemctl restart lscpd' ] for cmd in commands: ProcessUtilities.normalExecutioner(cmd) # Add a small delay between restarts time.sleep(2) except Exception as e: logging.writeToFile(f'Error restarting services: {str(e)}', 1) def SSLObtainer(self): try: logging.writeToFile('Running SSL Renew Utility') # Process main domains for website in Websites.objects.filter(state=1): self._check_and_renew_ssl( website.domain, f'/home/{website.domain}/public_html', website.adminEmail ) # Process child domains for child in ChildDomains.objects.all(): self._check_and_renew_ssl( child.domain, child.path, child.master.adminEmail, is_child=True ) self._restart_services() except Exception as e: logging.writeToFile(f'Error in SSLObtainer: {str(e)}', 1) @staticmethod def FixMailSSL(): try: for website in Websites.objects.all(): virtualHostUtilities.setupAutoDiscover(1, '/home/cyberpanel/templogs', website.domain, website.admin) except Exception as e: logging.writeToFile(f'Error in FixMailSSL: {str(e)}', 1) if __name__ == "__main__": sslOB = Renew() sslOB.SSLObtainer()
Close