How i can execute a script

Hi everyone, I have the next quiestion, I am learning to use OPENSSL and I have the next SCRIPT
Code:
#!/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"
space2="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"
space3="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 : . ; , _ + < > ? = ( ) / % #"
space4="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 : . ; , _ + < > ? = ( ) / % # 0 1 2 3 4 5 6 7 8 9"

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
done

I tried enc -d command and many options but I dont got it, any idea how I can execute this script named "SCRIPT" in openssl??.

Thanks!!!
 
First off, spaces and tabs are free. Using them to indent scripts can greatly increase readability.

Next, bash scripts will not work unless the bash port is installed: shells/bash. Unlike Linux, FreeBSD does not install it by default.

Continuing, bash is unnecessary, because that script will run with good old sh(1), which is installed by default.

Finally, it often helps if you describe some information about the script, where it came from and what it is supposed to do.
 
Back
Top