Register
It is currently Thu Apr 24, 2014 7:29 pm

generate list of possible pwds for partially forgotten one


All times are UTC - 6 hours


Post new topic Reply to topic  [ 6 posts ] 
Author Message
 PostPosted: Mon Jul 01, 2013 7:46 pm   

Joined: Mon Jul 01, 2013 7:24 pm
Posts: 16
ok I feel really dumb having to post this, but here goes.

I need to generate a list of possible password based on a specific set of characters and a order of the characters of a partially forgotton password?

To my surprise, I cannot open my keepassx dbase, but I am fairly certain of the passwrod. Perhaps I am inadvertently inverting an uppercase or lowercase letter where its opposite is required. All of the password generator tools I have been looking at, of course generate random lists of passwords. I was hoping to find an option to list specific characters and a specific order but have so far come up unlucky.

My first thought was to try a password generator, thiniking I could enter the characters I want and the order, but of course of the ones I looked into which did infact allow the user to specify certain characters, they still generated random passwords based on the characters; whereas I do not need a random ordering of the characters since I feel fairly confident about their order, just unsure of whether lower or uppercase or possibly a number substituted for a possible letter.

Generating the list of possibilities would be daunting to create manually. I am thinking a for loop might do the trick, but I cannot conceive of the details in my head.

If the password was in fact password, but the possibiulities for each letter were as follows:
pP
aA@
sS$
sS$
wW
oO0
rR
dD

then the first set of possibilities to generate if the first letter was 'p' (lowercase) would be:


For example, if I thought my password might be: p@ssw0Rd, I would want to generate a list of possible passwords, 8 character long from the following list of specific characters pPaA@sS$wWoO0rRdD. I would also need to specify that the first character could only be pP and the second aA@ and the third sS$ and the fourth sS$ and the fifth wW and the sixth oO0 and the seventh rR and the last charcter could only be one of dD, for a list something like:
p a s s w o r d
p A s s w o r d
p @ s s w o r d
p a S s w o r d
p a $ s w o r d
p a s S w o r d
p a s $ w o r d
p a s s W o r d
p a s s w O r d
p a s s w 0 r d
p a s s w o R d
p a s s w o r D

If anyone might be able to lend some guidance on how to accomplish this using a for loop (nested is all I can imagine) I would really appeciate it. I bet an array would come in handy, but I tried using a BASH array once and it didn't work out. I ended up wasting a lot of time trying to get it to work and it just never played nice for me.


Top
 Profile  
 PostPosted: Tue Jul 02, 2013 3:37 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 224
Location: London - UK
Not at all clever but should be sufficient for a throw away script;

Code:
for first in p P
do
  for second in a A @
  do
    for third in s S
    do
#repeat for each letter
      echo $first$second$third
    done
  done
done


Depending on the characters you've used tweaks such as quotes may be needed.

DW


Top
 Profile  
 PostPosted: Tue Jul 02, 2013 7:23 am   
User avatar

Joined: Fri Jul 22, 2011 5:39 pm
Posts: 46
I usually write down the possibilities and strike the ones that don't work.
There is only a minor variation on mine as well.

for example:
poodleesnotponies
PoodlesNotPonies
p00dlesNotPonies
P00dlesNotPonies
poodlesknotponies
...


Top
 Profile WWW  
 PostPosted: Tue Jul 02, 2013 1:12 pm   

Joined: Mon Jul 01, 2013 7:24 pm
Posts: 16
Quote:
Not at all clever but should be sufficient for a throw away script;

Well more clever than me. Worked like a charm. I did not imagine such a simple approach. DOH!

I am sure glad I asked before setting to the task myself. I was thinking counters for each letter position and variables would need to be used for each possible character. Gawd wouldn't that have been an overkilled mess?!

Thanks a lot DarthWavy.


Top
 Profile  
 PostPosted: Wed Jul 03, 2013 6:57 pm   

Joined: Mon Jul 01, 2013 7:24 pm
Posts: 16
well thanks again. One of the passwds generated by the script worked and I once more have access to all my info :)

whew!


Top
 Profile  
 PostPosted: Thu Jul 11, 2013 12:56 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 512
hi,

a little late:
Code:
printf '%s\n' {p,P}{a,A,@}{s,S}


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP