Ver Mensaje Individual
  #1  
Antiguo 29-09-2012
dark_monk9 dark_monk9 is offline
Miembro
 
Registrado: ago 2007
Posts: 22
Reputación: 0
dark_monk9 Va por buen camino
como correr un script en openssl

Buenas, tengo la siguiente consulta, me encuentro aprendiendo a usar el openssl y tengo el siguiente archivo script:

#!/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

He intentado con el comando enc -d y muchas otras opciones y no logro ejecutarlo, y en internet no logro encontrar como cargarlo desde el openssl correrlo o ejecutarlo, ya que se supone que me debe pedir la entrada "Salt", pero no se como ejecutarlo. Por ejemplo se supone que al tener la entrada Salt=ok y al ingresar el siguiente hash=ok961FcL7R4oU me debe generar la salida "tst".

Muchas gracias!!!
Responder Con Cita