Guest User

Juno

a guest
Jul 23rd, 2010
2,851
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2. #NBTDOTM
  3. my $NumArgs = $#ARGV + 1;#Determine the number of arguments the user has given us
  4. if ((($NumArgs == 0) or ($NumArgs == 2)) or ($NumArgs >= 4)) {
  5.     #Our user hasn't entered anything. Display help screen.
  6.     header();
  7.     exit();}
  8. if (($NumArgs == 1) or ($NumArgs == 3)) {
  9.     #Our user has entered a list. Time to split it!
  10.     my $comboloc = $ARGV[0]; #Combo location is the first argument
  11.     my $userloc = $ARGV[1]; #Userlist location is the 2nd argument
  12.     my $passloc = $ARGV[2]; #Passlist location is 3rd argument
  13.     #Set up output file location
  14.     if ($userloc eq '') {
  15.         $userloc = 'users.txt';}
  16.     if ($passloc eq '') {
  17.         $passloc = 'passwords.txt';}
  18.     print qq{
  19. ----------------------------------------------------------------------
  20.                    Combo Splitter            
  21.                 Custom Built by Juno             
  22.                               NBTDOTM                                
  23. ----------------------------------------------------------------------
  24. };
  25.     print "\nYour combolist is: $comboloc.";
  26.     print "\nYour user list is: $userloc.";
  27.     print "\nYour password list is: $passloc.";
  28.     print "\n\nThe program is now generating your lists...\n";
  29.     #Go line by line and separate the lists
  30.     open COMBOLIST, $comboloc or die$!;
  31.     my @COMBOS = COMBOLIST;
  32.         while (my $COMBO = <COMBOLIST>) {
  33.             chomp($COMBO);
  34.             $position = rindex($COMBO, ":") + 1;
  35.             $username = substr($COMBO, 0, ($position - 1));
  36.             $password = substr($COMBO, $position);
  37.             #Now write each element to their respective lists
  38.             #User list
  39.             open(OUTUSER, ">>$userloc");
  40.             print OUTUSER "$username\n";
  41.             close(OUTUSER);
  42.             #Password list
  43.             open(OUTPASS, ">>$passloc");
  44.             print OUTPASS "$password\n";
  45.             close(OUTPASS);
  46.         } # Done with the current comboline
  47.     print "\nYour lists have been successfully created.\n";
  48. exit();
  49. }
  50. sub header{
  51. print qq{
  52. ----------------------------------------------------------------------
  53.                    Combo Splitter            
  54.                 Custom Built by Juno             
  55.                               NBTDOTM                                
  56. ----------------------------------------------------------------------
  57. Usage: ComboCreator.pl [combo file] (output userlist] (output passwords.txt)
  58.  
  59. Example: ComboCreator.pl combo.txt users.txt passwords.txt
  60.  
  61. The program will take the supplied combo list and split them into two
  62. separate lists.  The output argument is optional; the program will
  63. output users.txt and passwords.txt if left blank.
  64. Happy Hacking!
  65. }; 
  66. }
RAW Paste Data