-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpgdecrypt1.sh
38 lines (32 loc) · 1.52 KB
/
gpgdecrypt1.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# *********************************************************************************
# * Do not forget to enjoy my code in github estudanteseg/gpgdecrypt1
# *********************************************************************************
# * Author: estudanteseg
# *********************************************************************************
# * Description: This simple program makes brute force into a gpg file
# * using a password dictionary generating a decrypted output file.
# *********************************************************************************
# * Example: $ ./gpgdecrypt1 myfile.gpg myfileout.txt /usr/share/wordlists/rockyou.txt
# *********************************************************************************
#!/bin/bash
# arqin is your file .gpg, eg. myfile.gpg
arqin=$1
# arqout is your output file, eg. myfileout.txt
arqout=$2
# arqpass is your password file to break the passphrase of gpg file. eg. /usr/share/wordlists/rockyou.txt
arqpass=$3
while TRATASENHA='' read -r line || [[ -n "$line" ]]; do
gpg -d --batch --passphrase $line -o $arqout $arqin 2>/dev/null
if [ -e $arqout ]
then
echo ""
echo "****************************************************************"
echo "* :D The pass $line is the correct. Congrats !!!"
echo "* The file $arqout was successfully generated !!!"
echo "****************************************************************"
echo ""
break
else
echo ":( Wrong pass $line It's bad !!!"
fi
done < $arqpass