Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/php
- <?php
- set_time_limit(0);
- /* Author: Tux
- * Description: A combolist generator written in PHP
- */
- $ops = getopt("eh");
- if(isset($ops['h'])) {
- die(cout("Usage: vComboGen [-e]\n-e extended creation (much larger lists)\n"));
- }
- cout('# Welcome to vComboGen v1.0', 'blue');
- $fUsernames = cin('> Username List [file]: ');
- $fPasswords = cin('> Password List [file]: ');
- $fOutput = cin('> Cobmbo Output [file]: ');
- if(!file_exists($fUsernames) || !file_exists($fPasswords))
- die(cout('There was an error...', 'red'));
- cout('* Generating Combolist', 'blue');
- $details = array(
- 'usernames' => explode("\n", file_get_contents($fUsernames)),
- 'passwords' => explode("\n", file_get_contents($fPasswords))
- );
- $return = array();
- $count = count($details['passwords']) - 1;
- foreach($details['usernames'] as $user) {
- if(isset($ops['e'])) {
- foreach($details['passwords'] as $pass) {
- $return[] = "{$user}:{$pass}";
- }
- } else {
- $rand = rand(0, $count);
- while($details['passwords'][$rand] === '') {
- $rand = rand(0, $count);
- }
- $return[] = "{$user}:{$details['passwords'][$rand]}";
- ]
- }
- $list = implode("\n", $return);
- file_put_contents($fOutput, $list);
- cout("* Combolist generated and stored in '{$fOutput}'!", 'green');
- # functions
- function cin($prompt='') {
- echo $prompt;
- $handle = fopen("php://stdin","r");
- return str_replace("\n", '', fgets($handle));
- }
- function cout($text, $color = 'white') {
- $colors = array(
- 'white' => '[0m',
- 'red' => '[31m',
- 'green' => '[32m',
- 'blue' => '[34m',
- 'yellow' => '[33m'
- );
- echo "\033{$colors[$color]} {$text} \033[0m\n";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement