Advertisement
Guest User

Untitled

a guest
Jan 4th, 2021
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.69 KB | None | 0 0
  1. #!/usr/share/goba/php/71-sg/bin/php
  2. <?php
  3. /**
  4. *
  5. * @ This file is created by http://DeZender.Net
  6. * @ deZender (PHP7 Decoder for SourceGuardian Encoder)
  7. *
  8. * @ Version : 4.1.0.1
  9. * @ Author : DeZender
  10. * @ Release on : 29.08.2020
  11. * @ Official site : http://DeZender.Net
  12. *
  13. */
  14.  
  15. function get_request($url)
  16. {
  17. $ch = curl_init();
  18. curl_setopt($ch, CURLOPT_URL, $url);
  19. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  20. $response = curl_exec($ch);
  21. curl_close($ch);
  22. return trim($response);
  23. }
  24.  
  25. function uninstall()
  26. {
  27. $cmd = ' rm -rf "/usr/bin/*licensecx" &> /dev/null' . "\r\n" . ' rm -rf "/etc/cron.d/licensecx" &> /dev/null' . "\r\n";
  28. system($cmd);
  29. return true;
  30. }
  31.  
  32. function enable($key_cmd)
  33. {
  34. $cronjob = 'PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin' . "\r\n\r\n" . '*/2 * * * * root /usr/bin/' . $key_cmd . 'licensecx \'only-check\' >/dev/null 2>&1' . "\r\n";
  35. system('printf \'' . $cronjob . '\' > /etc/cron.d/licensecx');
  36. system('sed -i -e "s/\\r//g" /etc/cron.d/licensecx');
  37. return true;
  38. }
  39.  
  40. function disable()
  41. {
  42. system('rm -rf /etc/cron.d/licensecx &> /dev/null');
  43. return true;
  44. }
  45.  
  46. function real_execute($cmd)
  47. {
  48. $a = popen($cmd, 'r');
  49.  
  50. while ($b = fgets($a, 2048)) {
  51. echo $b;
  52. ob_flush();
  53. flush();
  54. }
  55.  
  56. pclose($a);
  57. }
  58.  
  59. function exec_output($cmd)
  60. {
  61. exec($cmd, $output, $return_var);
  62. return $output[0];
  63. }
  64.  
  65. function get_http_response_code($domain1)
  66. {
  67. $ch = curl_init($domain1);
  68. curl_setopt($ch, CURLOPT_HEADER, true);
  69. curl_setopt($ch, CURLOPT_NOBODY, true);
  70. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  71. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  72. $output = curl_exec($ch);
  73. $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  74. curl_close($ch);
  75. return $httpcode;
  76. }
  77.  
  78. function firewall_accept($force = false)
  79. {
  80. if (file_exists('/usr/sbin/csf')) {
  81. if (file_exists('/etc/csf/csf.conf')) {
  82. csf_ports();
  83. }
  84. }
  85. }
  86.  
  87. function csf_ports()
  88. {
  89. $file22 = file_get_contents('/etc/csf/csf.conf');
  90. $pos = strpos($file22, 'TCP_OUT = "1:65535"');
  91.  
  92. if ($pos === false) {
  93. exec('sed -i \'/TCP_OUT =/c\\TCP_OUT = "1:65535"\' /etc/csf/csf.conf');
  94. exec('csf -r > /dev/null 2>&1');
  95. }
  96.  
  97. $file22 = file_get_contents('/etc/csf/csf.conf');
  98. $pos = strpos($file22, 'TCP_IN = "1:65535"');
  99.  
  100. if ($pos === false) {
  101. exec('sed -i \'/TCP_IN =/c\\TCP_IN = "1:65535"\' /etc/csf/csf.conf');
  102. exec('csf -r > /dev/null 2>&1');
  103. }
  104.  
  105. $file22 = file_get_contents('/etc/csf/csf.conf');
  106. $pos = strpos($file22, 'UDP_IN = "1:65535"');
  107.  
  108. if ($pos === false) {
  109. exec('sed -i \'/UDP_IN =/c\\UDP_IN = "1:65535"\' /etc/csf/csf.conf');
  110. exec('csf -r > /dev/null 2>&1');
  111. }
  112.  
  113. $file22 = file_get_contents('/etc/csf/csf.conf');
  114. $pos = strpos($file22, 'TESTING = "0"');
  115.  
  116. if ($pos === false) {
  117. exec('sed -i \'/TESTING =/c\\TESTING = "0"\' /etc/csf/csf.conf');
  118. exec('csf -r > /dev/null 2>&1');
  119. }
  120.  
  121. $file22 = file_get_contents('/etc/csf/csf.conf');
  122. $pos = strpos($file22, 'UDP_OUT = "1:65535"');
  123.  
  124. if ($pos === false) {
  125. exec('sed -i \'/UDP_OUT =/c\\UDP_OUT = "1:65535"\' /etc/csf/csf.conf');
  126. exec('csf -r > /dev/null 2>&1');
  127. }
  128. }
  129.  
  130. function firewall_drop()
  131. {
  132. global $firewall_stop;
  133. global $firewall_stop_1;
  134.  
  135. if (file_exists('/usr/sbin/csf')) {
  136. if ($firewall_stop_1) {
  137. system('service csf -e &> /dev/null');
  138. system('rm -rf /etc/csf/csf.error &> /dev/null');
  139. }
  140.  
  141. if ($firewall_stop) {
  142. system('service csf start &> /dev/null');
  143. system('rm -rf /etc/csf/csf.error &> /dev/null');
  144. }
  145. }
  146. }
  147.  
  148. function exec_license($file, $key)
  149. {
  150. global $status;
  151. global $plast_bin;
  152. exec('chattr -i /var/lve/lveinfo.ver > /dev/null 2>&1; rm -rf /var/lve/lveinfo.ver > /dev/null');
  153. firewall_accept(true);
  154. system('chmod +x /usr/sbin/rhnreg_ks &> /dev/null');
  155. $output_check_license = exec_output(' ' . $plast_bin . ' -q -f \'' . $file . '\' /usr/bin/cldetect --update-new-key \'' . $key . '\' ');
  156.  
  157. if (checkLicense()) {
  158. $status = true;
  159. }
  160. else {
  161. $status = false;
  162. }
  163.  
  164. if ($status) {
  165. exec('sed -i -e \'s/enabled=0/enabled=1/g\' /etc/yum.repos.d/cloudlinux.repo');
  166. system('yum reinstall htop -y &> /dev/null');
  167. }
  168.  
  169. system('rm -rf \'' . $file . '\' &> /dev/null');
  170. return $status;
  171. }
  172.  
  173. function checkLicense()
  174. {
  175. global $status;
  176. system('chmod +x /usr/bin/cldetect &> /dev/null ');
  177. $output_check_license = exec_output(' /usr/bin/cldetect --check-license ');
  178.  
  179. if (preg_match('/OK/', $output_check_license)) {
  180. $status = true;
  181. }
  182. else {
  183. $status = false;
  184. }
  185.  
  186. return $status;
  187. }
  188.  
  189. $RED = '\\033[31m';
  190. $Green = '\\033[32m';
  191. $NC = '\\033[0m';
  192. $key = 'cloudlinux';
  193. ...............................................................
  194. ........................................
  195. .........................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement