patternbashMinor
Making this password search more intelligent
Viewed 0 times
thissearchintelligentmorepasswordmaking
Problem
In a homework, there is an exercise in which I have a script that is used to search for a password.
One of the questions is if is possible to make it "more intelligent", and I'm stuck on it.
If it is possible, I prefer only a clue to help me to discover the answer correct, not the answer itself. I promise to post the result when I get the answer for myself.
One of the questions is if is possible to make it "more intelligent", and I'm stuck on it.
#!/bin/bash
space1="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"
if [ $# -le 1 ]
then
echo "Ussage: " $0 SALT PASSWORD_CODED
exit
fi
for i in $space1
do
for j in $space1
do
for k in $space1
do
variable=$(openssl passwd -crypt -salt "$1" "$i$j$k")
if [ "$variable" = $2 ]
then
echo password found: $i$j$k
exit
fi
done
done
doneIf it is possible, I prefer only a clue to help me to discover the answer correct, not the answer itself. I promise to post the result when I get the answer for myself.
Solution
There's no real way to speed up the brute-force enumeration of all possible 3-letter passwords.
Perhaps you could use the dictionary. There's a finite list of 3-letter English words. They may be slightly more common.
Also, if you google for "most common passwords", some kind of 3-letter version of that list could be tried before anything else.
Perhaps you could use the dictionary. There's a finite list of 3-letter English words. They may be slightly more common.
Also, if you google for "most common passwords", some kind of 3-letter version of that list could be tried before anything else.
Context
StackExchange Code Review Q#5226, answer score: 3
Revisions (0)
No revisions yet.