You've already forked rsa-locksmith
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:
9
README.md
Normal file
9
README.md
Normal 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
26
rsa-locksmith.sh
Executable 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?"
|
Reference in New Issue
Block a user