Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for SourceGuardian Encoder)
- *
- * @ Version : 4.1.0.1
- * @ Author : DeZender
- * @ Release on : 29.08.2020
- * @ Official site : http://DeZender.Net
- *
- */
- function get_request($url)
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $response = curl_exec($ch);
- curl_close($ch);
- return trim($response);
- }
- function real_execute($cmd)
- {
- $a = popen($cmd, 'r');
- while ($b = fgets($a, 2048)) {
- echo $b;
- ob_flush();
- flush();
- }
- pclose($a);
- }
- function exec_output($cmd)
- {
- exec($cmd, $output, $return_var);
- if (1 < count($output)) {
- return join("\r\n", $output);
- }
- return $output[0];
- }
- function get_http_response_code($domain1)
- {
- $ch = curl_init($domain1);
- curl_setopt($ch, CURLOPT_HEADER, true);
- curl_setopt($ch, CURLOPT_NOBODY, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 30);
- $output = curl_exec($ch);
- $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- curl_close($ch);
- return $httpcode;
- }
- function get_number_rule($ip, $rule = 'INPUT')
- {
- while (true) {
- $firewall_numbers = exec_output('iptables -t nat -L \'' . $rule . '\' -n --line-numbers | grep -E ' . $ip);
- $firewall_numbers = explode("\r\n", $firewall_numbers)[0];
- if ($firewall_numbers == '') {
- break;
- }
- yield $firewall_numbers;
- }
- yield 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 firewall_accept($force = false)
- {
- global $firewall_stop;
- global $firewall_stop_1;
- global $plesk;
- global $current_ip;
- $license = '34.231.236.27';
- $license2 = '167.99.112.67';
- $license3 = '34.213.2.224';
- foreach (get_number_rule($license, 'OUTPUT') as $data_1) {
- $currentID = exec_output(' echo \'' . $data_1 . '\' | head -n1 | awk \'{print $1;}\' ');
- if ($currentID != '') {
- system('/sbin/iptables -t nat -D OUTPUT ' . $currentID);
- }
- }
- foreach (get_number_rule($license2, 'OUTPUT') as $data_2) {
- $currentID = exec_output(' echo \'' . $data_2 . '\' | head -n1 | awk \'{print $1;}\' ');
- if ($currentID != '') {
- system('/sbin/iptables -t nat -D OUTPUT ' . $currentID);
- }
- }
- foreach (get_number_rule($license3, 'OUTPUT') as $data_3) {
- $currentID = exec_output(' echo \'' . $data_3 . '\' | head -n1 | awk \'{print $1;}\' ');
- if ($currentID != '') {
- system('/sbin/iptables -t nat -D OUTPUT ' . $currentID);
- }
- }
- if ($plesk) {
- foreach (get_number_rule('127.0.0.1', 'OUTPUT') as $data_3) {
- if (preg_match('/dpt:80/', $data_3)) {
- $currentID = exec_output(' echo \'' . $data_3 . '\' | head -n1 | awk \'{print $1;}\' ');
- if ($currentID != '') {
- system('/sbin/iptables -t nat -D OUTPUT ' . $currentID);
- }
- }
- }
- }
- 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;
- global $IP_SERVER;
- global $plesk;
- global $current_ip;
- $license = '34.231.236.27';
- $license2 = '167.99.112.67';
- $license3 = '34.213.2.224';
- $firewall = exec_output(' iptables -t nat -L OUTPUT -n --line-numbers ');
- if ($plesk) {
- if (!preg_match('/127.0.0.1.*\\sto:' . $current_ip . '/', $firewall)) {
- system('iptables -t nat -A OUTPUT -p tcp --dport 80 -d \'127.0.0.1\' -j DNAT --to-destination \'' . $current_ip . '\' ');
- }
- }
- if (!preg_match('/' . $license . '/', $firewall)) {
- system('iptables -t nat -A OUTPUT -p tcp --dport 80 -d \'' . $license . '\' -j DNAT --to-destination \'127.0.0.1\' ');
- system('iptables -t nat -A OUTPUT -p tcp --dport 443 -d \'' . $license . '\' -j DNAT --to-destination \'127.0.0.1\' ');
- .......................................................................
- ................................................
- ..................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement