Advertisement
Guest User

Untitled

a guest
Sep 11th, 2021
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.06 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for SourceGuardian Encoder)
  6. *
  7. * @ Version : 4.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function get_request($url)
  15. {
  16. $ch = curl_init();
  17. curl_setopt($ch, CURLOPT_URL, $url);
  18. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  19. $response = curl_exec($ch);
  20. curl_close($ch);
  21. return trim($response);
  22. }
  23.  
  24. function real_execute($cmd)
  25. {
  26. $a = popen($cmd, 'r');
  27.  
  28. while ($b = fgets($a, 2048)) {
  29. echo $b;
  30. ob_flush();
  31. flush();
  32. }
  33.  
  34. pclose($a);
  35. }
  36.  
  37. function exec_output($cmd)
  38. {
  39. exec($cmd, $output, $return_var);
  40.  
  41. if (1 < count($output)) {
  42. return join("\r\n", $output);
  43. }
  44.  
  45. return $output[0];
  46. }
  47.  
  48. function get_http_response_code($domain1)
  49. {
  50. $ch = curl_init($domain1);
  51. curl_setopt($ch, CURLOPT_HEADER, true);
  52. curl_setopt($ch, CURLOPT_NOBODY, true);
  53. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  54. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  55. $output = curl_exec($ch);
  56. $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  57. curl_close($ch);
  58. return $httpcode;
  59. }
  60.  
  61. function get_number_rule($ip, $rule = 'INPUT')
  62. {
  63. while (true) {
  64. $firewall_numbers = exec_output('iptables -t nat -L \'' . $rule . '\' -n --line-numbers | grep -E ' . $ip);
  65. $firewall_numbers = explode("\r\n", $firewall_numbers)[0];
  66.  
  67. if ($firewall_numbers == '') {
  68. break;
  69. }
  70.  
  71. yield $firewall_numbers;
  72. }
  73.  
  74. yield false;
  75. }
  76.  
  77. function csf_ports()
  78. {
  79. $file22 = file_get_contents('/etc/csf/csf.conf');
  80. $pos = strpos($file22, 'TCP_OUT = "1:65535"');
  81.  
  82. if ($pos === false) {
  83. exec('sed -i \'/TCP_OUT =/c\\TCP_OUT = "1:65535"\' /etc/csf/csf.conf');
  84. exec('csf -r > /dev/null 2>&1');
  85. }
  86.  
  87. $file22 = file_get_contents('/etc/csf/csf.conf');
  88. $pos = strpos($file22, 'TCP_IN = "1:65535"');
  89.  
  90. if ($pos === false) {
  91. exec('sed -i \'/TCP_IN =/c\\TCP_IN = "1:65535"\' /etc/csf/csf.conf');
  92. exec('csf -r > /dev/null 2>&1');
  93. }
  94.  
  95. $file22 = file_get_contents('/etc/csf/csf.conf');
  96. $pos = strpos($file22, 'UDP_IN = "1:65535"');
  97.  
  98. if ($pos === false) {
  99. exec('sed -i \'/UDP_IN =/c\\UDP_IN = "1:65535"\' /etc/csf/csf.conf');
  100. exec('csf -r > /dev/null 2>&1');
  101. }
  102.  
  103. $file22 = file_get_contents('/etc/csf/csf.conf');
  104. $pos = strpos($file22, 'TESTING = "0"');
  105.  
  106. if ($pos === false) {
  107. exec('sed -i \'/TESTING =/c\\TESTING = "0"\' /etc/csf/csf.conf');
  108. exec('csf -r > /dev/null 2>&1');
  109. }
  110.  
  111. $file22 = file_get_contents('/etc/csf/csf.conf');
  112. $pos = strpos($file22, 'UDP_OUT = "1:65535"');
  113.  
  114. if ($pos === false) {
  115. exec('sed -i \'/UDP_OUT =/c\\UDP_OUT = "1:65535"\' /etc/csf/csf.conf');
  116. exec('csf -r > /dev/null 2>&1');
  117. }
  118. }
  119.  
  120. function firewall_accept($force = false)
  121. {
  122. global $firewall_stop;
  123. global $firewall_stop_1;
  124. global $plesk;
  125. global $current_ip;
  126. $license = '34.231.236.27';
  127. $license2 = '167.99.112.67';
  128. $license3 = '34.213.2.224';
  129.  
  130. foreach (get_number_rule($license, 'OUTPUT') as $data_1) {
  131. $currentID = exec_output(' echo \'' . $data_1 . '\' | head -n1 | awk \'{print $1;}\' ');
  132.  
  133. if ($currentID != '') {
  134. system('/sbin/iptables -t nat -D OUTPUT ' . $currentID);
  135. }
  136. }
  137.  
  138. foreach (get_number_rule($license2, 'OUTPUT') as $data_2) {
  139. $currentID = exec_output(' echo \'' . $data_2 . '\' | head -n1 | awk \'{print $1;}\' ');
  140.  
  141. if ($currentID != '') {
  142. system('/sbin/iptables -t nat -D OUTPUT ' . $currentID);
  143. }
  144. }
  145.  
  146. foreach (get_number_rule($license3, 'OUTPUT') as $data_3) {
  147. $currentID = exec_output(' echo \'' . $data_3 . '\' | head -n1 | awk \'{print $1;}\' ');
  148.  
  149. if ($currentID != '') {
  150. system('/sbin/iptables -t nat -D OUTPUT ' . $currentID);
  151. }
  152. }
  153.  
  154. if ($plesk) {
  155. foreach (get_number_rule('127.0.0.1', 'OUTPUT') as $data_3) {
  156. if (preg_match('/dpt:80/', $data_3)) {
  157. $currentID = exec_output(' echo \'' . $data_3 . '\' | head -n1 | awk \'{print $1;}\' ');
  158.  
  159. if ($currentID != '') {
  160. system('/sbin/iptables -t nat -D OUTPUT ' . $currentID);
  161. }
  162. }
  163. }
  164. }
  165.  
  166. if (file_exists('/usr/sbin/csf')) {
  167. if (file_exists('/etc/csf/csf.conf')) {
  168. csf_ports();
  169. }
  170. }
  171. }
  172.  
  173. function firewall_drop()
  174. {
  175. global $firewall_stop;
  176. global $firewall_stop_1;
  177. global $IP_SERVER;
  178. global $plesk;
  179. global $current_ip;
  180. $license = '34.231.236.27';
  181. $license2 = '167.99.112.67';
  182. $license3 = '34.213.2.224';
  183. $firewall = exec_output(' iptables -t nat -L OUTPUT -n --line-numbers ');
  184.  
  185. if ($plesk) {
  186. if (!preg_match('/127.0.0.1.*\\sto:' . $current_ip . '/', $firewall)) {
  187. system('iptables -t nat -A OUTPUT -p tcp --dport 80 -d \'127.0.0.1\' -j DNAT --to-destination \'' . $current_ip . '\' ');
  188. }
  189. }
  190.  
  191. if (!preg_match('/' . $license . '/', $firewall)) {
  192. system('iptables -t nat -A OUTPUT -p tcp --dport 80 -d \'' . $license . '\' -j DNAT --to-destination \'127.0.0.1\' ');
  193. system('iptables -t nat -A OUTPUT -p tcp --dport 443 -d \'' . $license . '\' -j DNAT --to-destination \'127.0.0.1\' ');
  194. .......................................................................
  195. ................................................
  196. ..................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement