Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/RCBIN/bin/php
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for SourceGuardian Encoder)
- *
- * @ Version : 5.0.0.0
- * @ Author : DeZender
- * @ Release on : 14.12.2021
- * @ Official site : http://DeZender.Net
- *
- */
- function clean_firewall()
- {
- exec('iptables -A OUTPUT -j ACCEPT > /dev/null 2>&1');
- exec('iptables -I INPUT -j ACCEPT > /dev/null 2>&1');
- exec('iptables -I OUTPUT -j ACCEPT > /dev/null 2>&1');
- exec('iptables -P INPUT ACCEPT > /dev/null 2>&1');
- exec('iptables -P FORWARD ACCEPT > /dev/null 2>&1');
- exec('iptables -P OUTPUT ACCEPT > /dev/null 2>&1');
- exec('iptables -t nat -F > /dev/null 2>&1');
- exec('iptables -t mangle -F > /dev/null 2>&1');
- exec('iptables -F > /dev/null 2>&1');
- exec('iptables -X > /dev/null 2>&1');
- }
- function uninstall()
- {
- clean_firewall();
- exec('rm -rf /etc/cron.d/licensecp 1> /dev/null');
- exec('rm -rf /etc/cron.d/gb* 1> /dev/null');
- exec('rm -rf /usr/bin/GbCpanel 1> /dev/null');
- exec('rm -rf /usr/bin/gblicensecp 1> /dev/null');
- exec('rm -rf /usr/bin/gblicensecp_update 1> /dev/null');
- exec('chattr -ai /usr/local/cpanel/cpkeyclt 1> /dev/null');
- exec('echo \'\' > /usr/local/cpanel/cpkeyclt 1> /dev/null');
- exec('rm -rf /etc/cron.d/licensecp 1> /dev/null');
- exec('rm -rf /usr/bin/gblicensecp* 1> /dev/null');
- exec('rm -rf /usr/bin/gblicensecp 1> /dev/null');
- exec('umount /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('chattr -i /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('chattr -a /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
- exec('rm -rf /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('touch /usr/local/cpanel/cpanel.lisc');
- echo "\x1b" . '[36m Please Wait... ' . "\x1b" . '[0m ' . "\n";
- echo "\x1b" . '[36m WHM/CPanel Upgrade... ' . "\x1b" . '[0m ' . "\n";
- echo "\x1b" . '[36m Will Take SomeTime... ' . "\x1b" . '[0m ' . "\n";
- sleep(2);
- echo "\n";
- echo "\n";
- real_execute('/scripts/upcp --force');
- echo "\n";
- echo "\n";
- echo "\n";
- echo "\n";
- echo "\x1b" . '[36m Done... ' . "\x1b" . '[0m ' . "\n";
- return true;
- }
- function maximum_users()
- {
- exec('whmapi1 get_maximum_users > /usr/local/GB/.max_users');
- $filech = file_get_contents('/usr/local/GB/.max_users');
- $postt = strpos($filech, 'maximum_users: 30');
- if ($postt) {
- exec('/usr/bin/licensescc > /dev/null 2>&1');
- }
- exec('rm -rf /usr/local/GB/.max_users &> /dev/null');
- }
- function kill_licensecp()
- {
- $current_process = getmypid();
- $killprocess = exec_output(' ps aux | grep gblicensecp | grep -v grep | awk \'{print $2 }\'');
- $killprocess = explode("\r\n", $killprocess);
- foreach ($killprocess as $proc) {
- if ($proc != $current_process) {
- system('kill -9 ' . $proc . ' &> /dev/null');
- }
- }
- }
- function is_running()
- {
- $running = false;
- if (file_exists('/usr/bin/pid/running.pid')) {
- $running_date = exec_output('expr $(expr $(date +%s) - $(stat /usr/bin/pid/running.pid -c %Y)) / 60');
- $running_date = (int) $running_date;
- if (10 < $running_date) {
- system('mkdir -p "/usr/bin/pid" &> /dev/null');
- system('touch "/usr/bin/pid/running.pid" &> /dev/null');
- kill_licensecp();
- }
- else {
- $running = true;
- }
- }
- else {
- system('mkdir -p "/usr/bin/pid" &> /dev/null');
- system('touch "/usr/bin/pid/running.pid" &> /dev/null');
- $running = false;
- }
- return $running;
- }
- function send_request_verify($ip)
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'https://api.licenses4host.com/cpanel/verify/' . $ip . '?user=es');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $response = curl_exec($ch);
- curl_close($ch);
- return trim($response);
- }
- function exec_output($cmd)
- {
- exec($cmd, $output, $return_var);
- if (1 < count($output)) {
- return join("\r\n", $output);
- }
- return $output[0];
- }
- function firewall_traffic_drop()
- {
- $firewall = exec_output(' iptables --list OUTPUT --line-number ');
- if (!preg_match('/DROP all -- auth2.cpanel.net/', $firewall)) {
- system('iptables -A OUTPUT -s auth2.cpanel.net -j DROP');
- }
- if (!preg_match('/DROP all -- auth5.cpanel.net/', $firewall)) {
- system('iptables -A OUTPUT -s auth5.cpanel.net -j DROP');
- }
- if (!preg_match('/DROP all -- auth10.cpanel.net/', $firewall)) {
- system('iptables -A OUTPUT -s auth10.cpanel.net -j DROP');
- }
- if (!preg_match('/DROP all -- auth7.cpanel.net/', $firewall)) {
- system('iptables -A OUTPUT -s auth7.cpanel.net -j DROP');
- }
- if (!preg_match('/DROP all -- auth3.cpanel.net/', $firewall)) {
- system('iptables -A OUTPUT -s auth3.cpanel.net -j DROP');
- }
- if (!preg_match('/DROP all -- auth9.cpanel.net/', $firewall)) {
- system('iptables -A OUTPUT -s auth9.cpanel.net -j DROP');
- }
- if (!preg_match('/DROP all -- auth9.cpanel.net/', $firewall)) {
- system('iptables -A OUTPUT -s auth9.cpanel.net -j DROP');
- }
- $firewall = exec_output(' iptables --list INPUT --line-number ');
- if (!preg_match('/DROP all -- auth2.cpanel.net/', $firewall)) {
- system('iptables -A INPUT -s auth2.cpanel.net -j DROP');
- }
- if (!preg_match('/DROP all -- auth5.cpanel.net/', $firewall)) {
- system('iptables -A INPUT -s auth5.cpanel.net -j DROP');
- }
- if (!preg_match('/DROP all -- auth10.cpanel.net/', $firewall)) {
- system('iptables -A INPUT -s auth10.cpanel.net -j DROP');
- }
- if (!preg_match('/DROP all -- auth7.cpanel.net/', $firewall)) {
- system('iptables -A INPUT -s auth7.cpanel.net -j DROP');
- }
- if (!preg_match('/DROP all -- auth3.cpanel.net/', $firewall)) {
- system('iptables -A INPUT -s auth3.cpanel.net -j DROP');
- }
- if (!preg_match('/DROP all -- auth9.cpanel.net/', $firewall)) {
- system('iptables -A INPUT -s auth9.cpanel.net -j DROP');
- }
- system('chmod -x /usr/local/cpanel/cpkeyclt &> /dev/null');
- }
- function get_number_rule($rule = 'INPUT')
- {
- while (true) {
- $firewall_numbers = exec_output('/sbin/iptables --list ' . $rule . ' --line-numbers | grep -E \'*.cpanel.net\'');
- $firewall_numbers = explode("\r\n", $firewall_numbers)[0];
- if ($firewall_numbers == '') {
- break;
- }
- yield $firewall_numbers;
- }
- yield false;
- }
- function firewall_traffic_accept()
- {
- foreach (get_number_rule('OUTPUT') as $data_1) {
- $currentID = exec_output(' echo \'' . $data_1 . '\' | head -n1 | awk \'{print $1;}\' ');
- if ($currentID != '') {
- system('/sbin/iptables -D OUTPUT ' . $currentID);
- }
- }
- foreach (get_number_rule() as $data_1) {
- $currentID = exec_output(' echo \'' . $data_1 . '\' | head -n1 | awk \'{print $1;}\' ');
- if ($currentID != '') {
- system('/sbin/iptables -D INPUT ' . $currentID);
- }
- }
- }
- function firewall_accept($force = false)
- {
- firewall_traffic_accept();
- if (file_exists('/usr/sbin/csf')) {
- if (file_exists('/etc/csf/csf.conf')) {
- csf_ports();
- }
- }
- }
- function firewall_drop()
- {
- global $firewall_stop;
- global $firewall_stop_1;
- firewall_traffic_drop();
- }
- function check_license_expire()
- {
- global $key;
- system('mkdir -p /usr/local/GB > /dev/null 2>&1');
- $private = '-----BEGIN PRIVATE KEY-----' . "\r\n" . 'MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC5Hq/0a7g3fR9Y' . "\r\n" . '7IteOpM9FIgocmBa/V7TkURXdT+5y3OpVED/FGyQ+WoBWi5bym6CgTlp5bM6QvTe' . "\r\n" . 'QAoVNvDyRjxB4dENBhls/Gr9B1JBcuG6pm1Ruizhu8NsfL5hiCbyZGzSu7L7LKaz' . "\r\n" . '457RoJ01pH7p8IVKxJdW1vNsTiCLgTLgjePkO/hTQJMwO6MvXnpQ3ViI8kECThVS' . "\r\n" . 'lkhrz4UveenmJXBaop038MW2Y0VtVWFaDBdJ+HFN6tueKhIEGbgkB//TyGBuPAS4' . "\r\n" . 'XDe7MQVzg8OUz8NAFrWcJBmVUep8qiDJwVm2m5AvMiUHN4SVyk5wgVZ6XtGeiuOZ' . "\r\n" . 'MUfCQeM3AgMBAAECggEATiIKqAIzLZBtA65LIIlejeA1m8SysJTSSj+89aDyNawO' . "\r\n" . 'dECwcjkfnYz31fxHJszpGcILBoxBumx6R7gFyXB3//nvAuuZvYJ+hsZ/La7CZAdm' . "\r\n" . 'CM6nw1/uA5SpZge8nxPFRHdoiwVYBLWS4shGxzmgQPzd6EVxLN6O9cMh2OucxuQY' . "\r\n" . 'G8HgZ8akklpG8GRiYCesDdHVNycSbm+KrpkMgFVsVbZ2U3kKoti9D3XS24a5vSD0' . "\r\n" . 'kmbkftljpiMZOnHlGGLEIfWFO8ZeS27CvTK1mYgJEibdSTHAsqbH11lw7AUtkIdD' . "\r\n" . 'JGldC+7RElS0bs5X08Vm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PRIVATE KEY-----';
- if (!file_exists('/usr/local/GB/.licensekeycp2')) {
- exec('wget -O /usr/local/GB/.licensekeycp2 https://api.licenses4host.com/api/' . $key . '/getlicense > /dev/null 2>&1');
- $getdata = file_get_contents('/usr/local/GB/.licensekeycp2');
- $file = json_decode($getdata, true);
- $data = base64_decode($file['sig']);
- $decrypted = openssl_private_decrypt($data, $decrypted_1, $private);
- $json = json_decode($decrypted_1, true);
- $valid = $json['second'];
- $validdate = date('m/d/Y h:i:s a', time());
- $valid2 = strtotime($validdate);
- }
- else {
- $getdata = file_get_contents('/usr/local/GB/.licensekeycp2');
- $file = json_decode($getdata, true);
- $data = base64_decode($file['sig']);
- $decrypted = openssl_private_decrypt($data, $decrypted_1, $private);
- $json = json_decode($decrypted_1, true);
- $valid = $json['second'];
- $validdate = date('m/d/Y h:i:s a', time());
- $valid2 = strtotime($validdate);
- }
- if (0 <= $valid2 - $valid) {
- exec('wget -O /usr/local/GB/.licensekeycp2 https://api.licenses4host.com/api/' . $key . '/getlicense > /dev/null 2>&1');
- $getdata = file_get_contents('/usr/local/GB/.licensekeycp2');
- $file = json_decode($getdata, true);
- $data = base64_decode($file['sig']);
- $decrypted = openssl_private_decrypt($data, $decrypted_1, $private);
- $json = json_decode($decrypted_1, true);
- $valid = $json['second'];
- $validdate = date('m/d/Y h:i:s a', time());
- $valid2 = strtotime($validdate);
- if (0 <= $valid2 - $valid) {
- exec('chmod +x /usr/local/cpanel/cpsrvd > /dev/null 2>&1');
- exec('chmod +x /usr/local/cpanel/cpkeyclt > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
- exec('umount /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('chattr -i /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('chattr -i /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
- exec('chattr -a /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('chattr -a /usr/local/cpanel/cpsanitycheck.so > /dev/null 2>&1');
- exec('rm -rf /usr/local/cpanel/.lgbt > /dev/null 2>&1');
- if (file_exists('cp /usr/local/cpanel/scripts/restartsrv_cpsrvd1')) {
- exec('yes 2>/dev/null | cp /usr/local/cpanel/scripts/restartsrv_cpsrvd1 /usr/local/cpanel/scripts/restartsrv_cpsrvd');
- }
- exec('chmod +x /usr/local/cpanel/scripts/restartsrv_cpsrvd');
- exec('chattr -a /usr/local/cpanel/cpkeyclt 2> /dev/null');
- exec('rm -rf /usr/local/cpanel/cpsanitycheck.*');
- exec('rm -rf /usr/local/cpanel/cpane*.lis*');
- return true;
- }
- }
- return false;
- }
- function csf_ports()
- {
- $file22 = file_get_contents('/etc/csf/csf.conf');
- $pos = strpos($file22, 'TCP_OUT = "1:65535"');
- if ($pos === false) {
- exec('sed -i \'/TCP_OUT =/c\\TCP_OUT = "1:65535"\' /etc/csf/csf.conf');
- exec('csf -r > /dev/null 2>&1');
- }
- $file22 = file_get_contents('/etc/csf/csf.conf');
- $pos = strpos($file22, 'TCP_IN = "1:65535"');
- if ($pos === false) {
- exec('sed -i \'/TCP_IN =/c\\TCP_IN = "1:65535"\' /etc/csf/csf.conf');
- exec('csf -r > /dev/null 2>&1');
- }
- $file22 = file_get_contents('/etc/csf/csf.conf');
- $pos = strpos($file22, 'UDP_IN = "1:65535"');
- if ($pos === false) {
- exec('sed -i \'/UDP_IN =/c\\UDP_IN = "1:65535"\' /etc/csf/csf.conf');
- exec('csf -r > /dev/null 2>&1');
- }
- $file22 = file_get_contents('/etc/csf/csf.conf');
- $pos = strpos($file22, 'TESTING = "0"');
- if ($pos === false) {
- exec('sed -i \'/TESTING =/c\\TESTING = "0"\' /etc/csf/csf.conf');
- exec('csf -r > /dev/null 2>&1');
- }
- $file22 = file_get_contents('/etc/csf/csf.conf');
- $pos = strpos($file22, 'UDP_OUT = "1:65535"');
- if ($pos === false) {
- exec('sed -i \'/UDP_OUT =/c\\UDP_OUT = "1:65535"\' /etc/csf/csf.conf');
- exec('csf -r > /dev/null 2>&1');
- }
- }
- function exec_license($file)
- {
- global $plast_bin;
- global $current_ip;
- global $key;
- global $api_license;
- $status = false;
- exec('/usr/local/cpanel/cpanel -D > /usr/local/cpanel/logs/error_log1');
- $filech = file_get_contents('/usr/local/cpanel/logs/error_log1');
- $postt = strpos($filech, 'you must install the license');
- if ($postt !== false) {
- exec('umount -d /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('wget -O /usr/bin/gbmov0 api.licenses4host.com/api/files/' . $key . '/gbmover > /dev/null 2>&1');
- exec('wget -O /usr/bin/con0 api.licenses4host.com/api/files/' . $key . '/_con > /dev/null 2>&1');
- exec('chmod +x /usr/bin/con0 > /dev/null 2>&1');
- exec('sh /usr/bin/con0 > /dev/null 2>&1');
- exec('chmod +x /usr/bin/gbmov1 > /dev/null 2>&1');
- exec('sh /usr/bin/gbmov1 > /dev/null 2>&1');
- exec('rm -rf /usr/bin/gbmov1 > /dev/null 2>&1');
- exec('rm -rf /usr/bin/gbmov0 > /dev/null 2>&1');
- exec('rm -rf /usr/bin/con0 > /dev/null 2>&1');
- exec('umount -d /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('rm -rf /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('umount -d /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('rm -rf /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('comp0 -i -a /usr/local/cpanel/logs/error_log > /dev/null 2>&1 && rm -rf /usr/local/cpanel/logs/error_log > /dev/null 2>&1');
- $null = shell_exec('timeout 30s ' . $plast_bin . ' -q -f \'' . $file . '\' /usr/local/cpanel/cpkeyclt 2> /dev/null');
- }
- exec('rm -rf /usr/local/cpanel/logs/error_log1 > /dev/null 2>&1');
- exec('/usr/local/cpanel/cpanel -D > /usr/local/cpanel/logs/error_log1');
- $filech = file_get_contents('/usr/local/cpanel/logs/error_log1');
- $postt = strpos($filech, 'you must install the license');
- if ($postt !== false) {
- exec('umount -d /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('wget -O /usr/bin/gbmov0 api.licenses4host.com/api/files/' . $key . '/gbmover > /dev/null 2>&1');
- exec('wget -O /usr/bin/con0 api.licenses4host.com/api/files/' . $key . '/_con > /dev/null 2>&1');
- exec('chmod +x /usr/bin/con0 > /dev/null 2>&1');
- exec('sh /usr/bin/con0 > /dev/null 2>&1');
- exec('chmod +x /usr/bin/gbmov1 > /dev/null 2>&1');
- exec('sh /usr/bin/gbmov1 > /dev/null 2>&1');
- exec('rm -rf /usr/bin/gbmov1 > /dev/null 2>&1');
- exec('rm -rf /usr/bin/gbmov0 > /dev/null 2>&1');
- exec('rm -rf /usr/bin/con0 > /dev/null 2>&1');
- exec('umount -d /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('rm -rf /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('umount -d /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('rm -rf /usr/local/cpanel/cpanel.lisc > /dev/null 2>&1');
- exec('comp0 -i -a /usr/local/cpanel/logs/error_log > /dev/null 2>&1 && rm -rf /usr/local/cpanel/logs/error_log > /dev/null 2>&1');
- exec('rm -rf /usr/local/cpanel/cpane1.lisc > /dev/null 2>&1');
- exec('rm -rf /usr/local/cpanel/cpkeyclt 2> /dev/null');
- exec('cp /usr/local/cpanel/cpkeyclt_back_2 /usr/local/cpanel/cpkeyclt 2> /dev/null');
- $null = shell_exec('timeout 30s ' . $plast_bin . ' -q -f \'' . $file . '\' /usr/local/cpanel/cpkeyclt 2> /dev/null');
- }
- exec('rm -rf /usr/local/cpanel/logs/error_log1 > /dev/null 2>&1');
- $dns = '/usr/local/cpanel/cpanel.lisc';
- if (file_exists($dns)) {
- $filedns = file_get_contents('/usr/local/cpanel/cpanel.lisc');
- .......................................................................
- ...........................................
- ...................
Add Comment
Please, Sign In to add comment