LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-03-2011, 04:36 AM   #1
noony123
Member
 
Registered: Oct 2010
Posts: 167

Rep: Reputation: 0
wordlist generator !


Hi all.

Is there any sort of wordlist generator. Like i want to create words containing lower case and digits of 8 characters. Is there any tool available in linux to do it ? also can the tool in advance tell me how much space shall be required to store the file.

Kindly guide me
 
Old 10-03-2011, 05:23 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

After some digging I found an old script I found on-line that creates random words based on some criteria:
Code:
 #!/bin/bash
## word generator : random 'words'
##   with given length, or range
##   with choice of wharacters to be used

chars0="a b c d e f g h i j k l m n o p q r s t u v w x y z"
chars1="A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
chars2="0 1 2 3 4 5 6 7 8 9"
chars3="& | é @ ⬠\" # ' ( § ^ è ! ç { à } ) - _ ° ^ \" \$ [ ] % ù £ µ = + ~ : / ; . , ? "

function increment {
     INPUT=$1
     [[ ${#INPUT} -ge $minlen ]]  && echo $1
     if [[ ${#INPUT} -lt $maxlen ]]; then
          for c in $chars; do
               increment $1$c
          done
     fi
}

function showUsage {
     echo "$0 MAXLEN [MINLEN] [a [A [n [p]]]]"
     echo
     echo "    MAXLEN    integer   Maximum lenght, or specific lengt if MINLEN is omitted"
     echo "    MINLEN    integer   Minimum lenght, equals MAXLEN if omitted"
     echo ""
     echo "    characters:"
     echo "    a    lower case     a-z"
     echo "    A    Uppercase      A-Z"
     echo "    n    numeric        0-9"
     echo "    p    punctuation    . ?" 
}

## argument handler
[[ "$1" = "" ]] && showUsage && exit
maxlen=$1
[[ $2 -eq 0 ]] && minlen=$maxlen || minlen=$2

for arg in "$@"; do
     case $arg in
          a) chars="$chars $chars0" ;;
          A) chars="$chars $chars1" ;;
          n) chars="$chars $chars2" ;;
          p) chars="$chars $chars3" ;;
     esac;
done

#fallback
[[ "$chars" = "" ]] && chars="$chars0"

## kickof

for i in $chars; do
     increment $i
done

exit 0
If you run the script (./word.generator.sh 8 8 a n > 8.char.words.list), you'll get all the permutations.

I don't have a clue how large the created file will be (I'm guessing several hundred Mb, possibly a few Gb). I do know that it will take a long time to generate the output....

Hope this helps.
 
Old 10-03-2011, 05:31 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Well assuming something like 'aaaaaaaa' is acceptable for all lower case and numbers and also assuming that one line per word would mean 10 characters per line (2 for \n),
then I would say about ... 11Tib (give or take)
 
Old 10-03-2011, 08:06 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi grail,

Quote:
Originally Posted by grail View Post
Well assuming something like 'aaaaaaaa' is acceptable for all lower case and numbers and also assuming that one line per word would mean 10 characters per line (2 for \n),
then I would say about ... 11Tib (give or take)
Man, my estimate is way off!!

How do you calculate this? I know there are 36 possibilities at each position and you need 10 chars per permutation (assuming 8 positions). But how to calculate all this to a accurate number?

Thanks in advance.
 
Old 10-03-2011, 01:30 PM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Well my math was a little rusty, but I used the following:
Code:
((36! / 28!)*10)/1024^4 ~ 11.1Tib
 
Old 10-03-2011, 03:50 PM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by grail View Post
Well my math was a little rusty, but I used the following:
Code:
((36! / 28!)*10)/1024^4 ~ 11.1Tib
I've been playing with the above and cannot get correct numbers when creating tests. I think it has got to do with XY! not using aaaaaaaa bbbbbbbb etc

0-9 on 2 positions => 100 (10^2) combo's, not (10!/8!) => 90
0-9 on 3 positions => 1000 (10^3) combo's, not (10!/7!) => 720

Took me a while, but after trail and error I came up with this:
Code:
((36^8) * (8+1)) / 1024^4 ~= 23 Tb
Not that the OP will be happier with that number

Using: 4 positions, using a-z + 0-9:
Code:
$ ./word.generator.sh 4 4 a n > 4pos.36
$ ls -l 4pos.36 
-rw-r----- 1 druuna internet 8398080 Oct  3 22:27 4pos.36
 $ wc -c 4pos.36 
8398080 4pos.36
$ echo "((36^4) * (4+1))" | bc
8398080
 
1 members found this post helpful.
Old 10-03-2011, 04:13 PM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Sorry ... my bad .. was thinking about combinations instead of repeating permutations ... good catch

So more than double ... ouch
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Generate SPECIAL alphanumeric WORDLIST - no repeating characters side-by-side Stanley_212 Programming 33 10-13-2022 06:06 PM
wordlist/hex generator without repeating letters. jumpingj Programming 3 05-18-2011 07:44 AM
How to create permutations for a wordlist ? frenchn00b Programming 5 08-18-2009 06:03 PM
log Generator tommytomato Linux - General 2 07-06-2007 07:32 PM
Traffic Generator Bugger Linux - Software 3 02-20-2006 05:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration