Link to home
Start Free TrialLog in
Avatar of gplana
gplanaFlag for Spain

asked on

How to use Rainbow Tables

Hi.

I have this script in Linux which finds a password by using brute force:

#!/bin/bash

space="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 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 "Usage: " $0 SALT PASSWORD_CODED
	exit
fi

for i in $space
do
for j in $space
do
for k in $space
do

	variable=$(openssl passwd -crypt -salt "$1" "$i$j$k")
	if [ "$variable" = $2 ]
	    then
		echo password found: $i$j$k
		exit
	fi
done
done
done

Open in new window


If I execute it as:
 ./script ok okZdSfLRp/FqA

Open in new window

then I get the password "abc".

However, if I execute it as:
./script vt vt/4.cscQFn1M

Open in new window

then the program last a lot.

Is there a way to modify this script so it works quickly? Maybe using the Rainbow Tables technique? How can this be done?

Thank you
SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gplana

ASKER

Thank you, but by the way the goal is not to get the password by John the ripper, but to understand how can it be get, or how can I modify my code to get it faster than now (even if it's not as fast as John the ripper).

Thank you.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gplana

ASKER

Can you explain a little more what is "vectorize and parallelize" ?
Please read GCC or CLANG documentation on topic. Nothing of that fixes bash scripts