LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 05: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, 06:23 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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, 06:31 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

Rep: Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825Reputation: 2825
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, 09:06 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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, 02:30 PM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

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

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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, 05:13 PM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

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

So more than double ... ouch
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 30 08-17-2013 12:39 PM
wordlist/hex generator without repeating letters. jumpingj Programming 3 05-18-2011 08:44 AM
How to create permutations for a wordlist ? frenchn00b Programming 5 08-18-2009 07:03 PM
log Generator tommytomato Linux - General 2 07-06-2007 08:32 PM
Traffic Generator Bugger Linux - Software 3 02-20-2006 06:17 AM


All times are GMT -5. The time now is 10:11 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration