Exemple #1
0
 /**
  * Enumerate the website's authors.
  * Output the obtained info.
  * Saves the authors into the output data.
  */
 private function enumerate()
 {
     $users = $this->bruteforcer->enumerate($this->limit, $this->fails);
     if (!empty($users)) {
         $this->output->writeln(' [i] <comment>' . count($users) . '</comment> user(s) found');
         $table = new Table($this->output);
         $table->setHeaders(array('Id', 'Login', 'Name'))->setRows($users);
         $table->render();
     } else {
         $this->output->writeln('<error> [!] No users found</error>');
     }
 }
Exemple #2
0
 /**
  * Load the usernames using enumeration or / and the provided username.
  *
  * @return bool
  */
 private function loadUsernames()
 {
     $this->users = [];
     // Enumerate
     if (!$this->noenum) {
         $this->output->writeln(' [+] Enumerating users...');
         $users = $this->bruteforcer->enumerate($this->max_enum);
         if (!empty($users)) {
             foreach ($users as $user) {
                 $this->users[] = $user['login'];
             }
         }
         $this->output->writeln(' [i] <comment>' . count($this->users) . '</comment> user(s) found');
     }
     // Single
     if ($this->username) {
         $this->users[] = $this->username;
     }
     // List
     if ($this->usernames) {
         // Check list
         if (!file_exists($this->usernames)) {
             $this->output->writeln('<error> [!] Usernames file not found. </error>');
             return false;
         }
         $this->users = array_merge($this->users, file($this->usernames, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
     }
     // Delete duplicated ones
     $this->users = array_unique($this->users);
     // Check
     if (empty($this->users)) {
         $this->output->writeln('<error> [!] No users to bruteforce.</error>');
         return false;
     }
     return true;
 }