Script to generate passwd comb.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to generate passwd comb.
# 1  
Old 09-23-2011
Script to generate passwd comb.

Hi
I created a gnupg password which I later forgot clumsy enough (after a holiday). I can always create a new one but unfortunately I have some files on the computer that I encrypted with it and would like to access it. I remember parts of the password and was wondering what's the the best way to guess the password.

The password was in the format:
Code:
Abc1_EFG,HIJ,klm1

obs. klm1 (K L M "ONE")

now:
1st I remember "Abcd_" but "b" "c" and "1" may be in different order.

2nd As for ",EFG" (only letters, uppercase). I remember the "E" and want to guess what "F" and "G" can be (for example script to try different combinations), have my suspicions, however ...

3rd As for ",HIJ" (only letters, uppercase). I want the script tries different combinations of letters (CAPS)

4th As for ",klm1". I remember all the characters but one may be in a different order. All chars lower case

Is it possible that from these "criteria" write a script that generates different combination of passwords and try to decrypt a file with a command?


command to try different passwords script generates is:
Code:
echo $mypass | gpg --batch --passphrase-fd 0 --decrypt $1

$mypass is the variable that will holds the combinations

EDIT: gpg gives 2 as return value when the pass is wrong. So I guess I should use a while [ $? = 2 ] or something?

Last edited by zaonline; 09-23-2011 at 06:24 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need script to generate file.

Hi I have a file "test" with data as below 1,APRIL,NEW,"New market,delhi,pune,India",RECENT, 254664 2,MARCH,OLD,"New Area,Mumbai,UP,India",CURRENT, 152483 So I want a script which provides output as below 1,APRIL,RECENT,254664 2,MARCH,CURRENT,152483 I am aware we can use awk/sed... (9 Replies)
Discussion started by: sv0081493
9 Replies

2. AIX

When did AIX start using /etc/security/passwd instead of /etc/passwd to store encrypted passwords?

Does anyone know when AIX started using /etc/security/passwd instead of /etc/passwd to store encrypted passwords? (1 Reply)
Discussion started by: Anne Neville
1 Replies

3. Shell Programming and Scripting

generate a script that will do the following

I need to write a shell script that will do all this: Go to server directory, for example (/xyz/outbound) In the outbound folder, get the list of the (old) directories created or modified at least two days before the date when script is run. The list will have the names of directories, some... (2 Replies)
Discussion started by: chako_3
2 Replies

4. Shell Programming and Scripting

Modify /etc/passwd via script

We have a business need to modify the /etc/passwd file every time a new user gets added, because the user ID begins with a zero. When you create the new user in smit, even if you put the leading zero in, it does not retain it when the entry is added. That being said, I need to create a script... (11 Replies)
Discussion started by: mshilling
11 Replies

5. Solaris

passwd cmd reenables passwd aging in shadow entry

Hi Folks, I have Solaris 10, latest release. We have passwd aging set in /etc/defalut/passwd. I have an account that passwd should never expire. Acheived by emptying associated users shadow file entries for passwd aging. When I reset the users passwd using passwd command, it re enables... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

6. Shell Programming and Scripting

passwd on a simple script

hi guys I am working on a script which is basically a menu for some linux operators... I need on this menu for the operators the option to change the password... This are 2 linux servers using Linux heartbeat. what I need is to change change the password using passwd command and replica... (10 Replies)
Discussion started by: karlochacon
10 Replies

7. Shell Programming and Scripting

help....generate command script

Please help..... if i have a file list below : 1233743158.log 1233743410.log 1233744186.log 1233744462.log "1233743158" is a unix time format it's require to a script "convertime.sh" to convert unix time format to readable time format like 20090204183010 -- YYYYMMDDHHMMSS ... (10 Replies)
Discussion started by: bleach8578
10 Replies

8. UNIX for Advanced & Expert Users

setting passwd in script

HP-UX 11 I currently have a script that is running useradd and passwd commands to automate setting up new users. It was originally designed so that passwd was run with -d -f to delete a passwd and force user to set passwd at next login. Now mgmt wants instead to set a first-time passwd and have... (2 Replies)
Discussion started by: LisaS
2 Replies

9. Shell Programming and Scripting

passwd -l script

I need to lockout about 250 user accounts on a server. I figure on putting the user accounts to be locked out in a text file and the running a script to go through the file and run the "passwd -l useraccount" against the /etc/passwd file (yes, I am root as I do this). Here is what I have so... (3 Replies)
Discussion started by: antalexi
3 Replies

10. Programming

comb/shell sort

Hi all, Can someone explain to me how shell sort works and tell me why it can not be used on linked lists. Thanks (8 Replies)
Discussion started by: newbietoIT
8 Replies
Login or Register to Ask a Question