1
mirror of https://github.com/jakejarvis/rsa-locksmith.git synced 2025-06-27 15:25:40 -04:00

Initial commit

This commit is contained in:
2018-06-02 09:02:40 -04:00
commit 288f91ad6b
2 changed files with 35 additions and 0 deletions

9
README.md Normal file
View File

@ -0,0 +1,9 @@
# rsa-locksmith
Teeny tiny script to brute-force passphrases of RSA private keys
**Usage:**
./rsa-locksmith.sh id_rsa
[Great collection of wordlists to use can be found here.](https://github.com/danielmiessler/SecLists/tree/master/Passwords)

26
rsa-locksmith.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
# rsa-locksmith.sh: Teeny tiny script to brute-force passphrases of RSA private keys
# https://github.com/jakejarvis/rsa-locksmith
WORDLIST="/Users/jake/passwords.txt"
# check if path to key was entered as argument
if [ -z "$1" ]
then
echo -n "Enter path to the private key: "
read KEY
else
KEY=$1
fi
for PASSPHRASE in $(cat $WORDLIST)
do
if [[ -n $(echo -n $PASSPHRASE | openssl rsa -passin stdin 2>&1 -in $KEY | grep -v error | grep -v unable) ]]
then
echo -e "\nFOUND PASSPHRASE:" $PASSPHRASE "\n"
echo -n $PASSPHRASE | openssl rsa -passin stdin 2>&1 -in $KEY
exit
fi
done
echo "No match found, maybe try a different wordlist?"