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 : firewallUtilities.py
#!/usr/local/CyberCP/bin/python import os import os.path import sys import django sys.path.append('/usr/local/CyberCP') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings") try: django.setup() except: pass import plogical.CyberCPLogFileWriter as logging import argparse from plogical.processUtilities import ProcessUtilities class FirewallUtilities: @staticmethod def resFailed(res): if (ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20) and res != 0: return True elif (ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8) and res == 1: return True return False @staticmethod def doCommand(command): try: res = ProcessUtilities.executioner(command) if res == 0: logging.CyberCPLogFileWriter.writeToFile("Failed to apply rule: " + command + " Error #" + str(res)) return 0 except OSError as msg: logging.CyberCPLogFileWriter.writeToFile("Failed to apply rule: " + command + " Error: " + str(msg)) return 0 except ValueError as msg: logging.CyberCPLogFileWriter.writeToFile("Failed to apply rule: " + command + " Error: " + str(msg), 1) return 0 return 1 @staticmethod def addRule(proto,port,ipAddress): ruleFamily = 'rule family="ipv4"' sourceAddress = 'source address="' + ipAddress + '"' ruleProtocol = 'port protocol="' + proto + '"' rulePort = 'port="' + port + '"' command = "firewall-cmd --permanent --zone=public --add-rich-rule='" + ruleFamily + " " + sourceAddress + " " + ruleProtocol + " " + rulePort + " " + "accept'" ProcessUtilities.executioner(command) ruleFamily = 'rule family="ipv6"' sourceAddress = '' command = "firewall-cmd --permanent --zone=public --add-rich-rule='" + ruleFamily + " " + sourceAddress + " " + ruleProtocol + " " + rulePort + " " + "accept'" ProcessUtilities.executioner(command) command = 'firewall-cmd --reload' ProcessUtilities.executioner(command) return 1 @staticmethod def addSieveFirewallRule(): """Add Sieve port 4190 to firewall for all OS variants""" try: # Add Sieve port 4190 to firewall FirewallUtilities.addRule('tcp', '4190', '0.0.0.0/0') logging.CyberCPLogFileWriter.writeToFile("Sieve port 4190 added to firewall successfully") return 1 except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile("Failed to add Sieve port 4190 to firewall: " + str(msg)) return 0 @staticmethod def deleteRule(proto, port, ipAddress): ruleFamily = 'rule family="ipv4"' sourceAddress = 'source address="' + ipAddress + '"' ruleProtocol = 'port protocol="' + proto + '"' rulePort = 'port="' + port + '"' command = "firewall-cmd --permanent --zone=public --remove-rich-rule='" + ruleFamily + " " + sourceAddress + " " + ruleProtocol + " " + rulePort + " " + "accept'" ProcessUtilities.executioner(command) ruleFamily = 'rule family="ipv6"' sourceAddress = '' command = "firewall-cmd --permanent --zone=public --remove-rich-rule='" + ruleFamily + " " + sourceAddress + " " + ruleProtocol + " " + rulePort + " " + "accept'" ProcessUtilities.executioner(command) command = 'firewall-cmd --reload' ProcessUtilities.executioner(command) return 1 @staticmethod def saveSSHConfigs(type, sshPort, rootLogin): try: if type == "1": command = 'semanage port -a -t ssh_port_t -p tcp ' + sshPort ProcessUtilities.normalExecutioner(command) FirewallUtilities.addRule('tcp', sshPort, "0.0.0.0/0") if rootLogin == "1": rootLogin = "PermitRootLogin yes\n" else: rootLogin = "PermitRootLogin no\n" sshPort = "Port " + sshPort + "\n" pathToSSH = "/etc/ssh/sshd_config" data = open(pathToSSH, 'r').readlines() writeToFile = open(pathToSSH, "w") for items in data: if items.find("PermitRootLogin") > -1: if items.find("Yes") > -1 or items.find("yes"): writeToFile.writelines(rootLogin) continue elif items.find("Port") > -1: writeToFile.writelines(sshPort) else: writeToFile.writelines(items) writeToFile.close() command = 'systemctl restart sshd' ProcessUtilities.normalExecutioner(command) print("1,None") except BaseException as msg: print("0," + str(msg)) @staticmethod def addSSHKey(tempPath, path=None): try: key = open(tempPath, 'r').read() if path == None: sshDir = "/root/.ssh" pathToSSH = "/root/.ssh/authorized_keys" if os.path.exists(sshDir): pass else: os.mkdir(sshDir) else: pathToSSH = path if os.path.exists(pathToSSH): pass else: sshFile = open(pathToSSH, 'w') sshFile.writelines("#Created by CyberPanel\n") sshFile.close() presenseCheck = 0 try: data = open(pathToSSH, "r").readlines() for items in data: if items.find(key) > -1: presenseCheck = 1 except: pass if presenseCheck == 0: writeToFile = open(pathToSSH, 'a') writeToFile.writelines("#Added by CyberPanel\n") writeToFile.writelines("\n") writeToFile.writelines(key) writeToFile.writelines("\n") writeToFile.close() if os.path.split(tempPath): os.remove(tempPath) print("1,None") except BaseException as msg: print("0," + str(msg)) @staticmethod def deleteSSHKey(key, path=None): try: keyPart = key.split(" ")[1] if path == None: pathToSSH = "/root/.ssh/authorized_keys" else: pathToSSH = path data = open(pathToSSH, 'r').readlines() writeToFile = open(pathToSSH, "w") for items in data: if items.find("ssh-rsa") > -1 and items.find(keyPart) > -1: continue else: writeToFile.writelines(items) writeToFile.close() print("1,None") except BaseException as msg: print("0," + str(msg)) def main(): parser = argparse.ArgumentParser(description='CyberPanel Installer') parser.add_argument('function', help='Specific a function to call!') ## Litespeed Tuning Arguments parser.add_argument("--tempPath", help="Temporary path to file where PHP is storing data!") parser.add_argument("--type", help="Type") parser.add_argument("--sshPort", help="SSH Port") parser.add_argument("--rootLogin", help="Root Login") parser.add_argument("--key", help="Key") parser.add_argument("--path", help="Path to key file.") args = parser.parse_args() if args.function == "saveSSHConfigs": FirewallUtilities.saveSSHConfigs(args.type, args.sshPort, args.rootLogin) elif args.function == "addSSHKey": if not args.path: FirewallUtilities.addSSHKey(args.tempPath) else: FirewallUtilities.addSSHKey(args.tempPath, args.path) elif args.function == "deleteSSHKey": if not args.path: FirewallUtilities.deleteSSHKey(args.key) else: FirewallUtilities.deleteSSHKey(args.key, args.path) if __name__ == "__main__": main()
Close