in reply to Attempting to create a brute-force wordlist

How you "continue the script" will depend on how far you want your "word list" to continue. The nature of your "word list" seems so basic that I wonder if you really need to store it as a file at all. What will it be used for? (And wouldn't that use be better served by writing a loop to iterate over a series of numbers, rather than reading a list of numbers from a file?)

Anyway, if your question is really "how do I create numbers with leading zeros?", the answer is sprintf (and its cousin "printf"):

my $begin = sprintf( "%03d", 0 ); my $end = sprintf( "%03d", 79 ); print "make a list that runs from $begin to $end\n";
Have fun with that.

Replies are listed 'Best First'.
Re^2: Attempting to create a brute-force wordlist
by Anonymous Monk on Sep 20, 2009 at 16:22 UTC
    I'm sorry, but I think you misunderstood my question a bit. Although it might have a simple solution, it isn't as simple as printing a list of numbers with zeros in front of them. (That I could do myself). No, the purpose of the file is to act as a dictionary for a password cracking program (don't worry, I'm not going to do anything illegal ;-) ).

    Therefore this should work with letters as well as numbers. The reason I started with numbers is because there are less combinations with 10 different numbers, than with 26 different letters. This was supposed to be a first try to see if I could get it to work. The goal is to print all possible combinations of the numbers 0-9 (for now) until they reach the point of 10 characters (again, for now.) I hope this explains it a bit clearer, I'm sorry if it was poorly explained before.

      There are 36^10=3656158440062976 different 10 character words if you will use [0-9a-z] characters, and that would require quite a lot of disk space.

        True, but that is why I want to limit the numbers of characters to between 8 and 12. That would reduce the number considerably, and still make a pretty good dictionary.