generated from Estudanteseg/gpgdecrypt1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpgdecrypt2.sh
50 lines (41 loc) · 2 KB
/
gpgdecrypt2.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
39
40
41
42
43
44
45
46
47
48
49
50
# *********************************************************************************
# * Do not forget to enjoy my code in github estudentseg/feecode
# *********************************************************************************
# * Author: estudanteseg
# *********************************************************************************
# * Description: This simple program makes brute force into a gpg file
# * using a password dictionary generating a decrypted output file.
# *********************************************************************************
# * For use this version was necessary breaking rockyou.txt in parts of 4Gb with
# * the command: split -l 4000000 -d rockyou.txt rockyoup
# * and was generated files like rockyoup01, rockyoup02, rockyoup03,...
# *********************************************************************************
# * Example: $ ./decgpg myfile.gpg myfileout.txt /usr/share/wordlists/rockyoup01
# *********************************************************************************
#!/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/rockyoup1.txt
arqpass=$3
# I will mount the array with the passwords
echo "I will mount the array with the passwords !!!!"
readarray -t Senhas < $arqpass
# The array with the passwords is done !!!
echo "The array with the passwords is done !!!"
for pass in "${Senhas[@]}"
do
echo "Trying PWD: $pass"
gpg -d --batch --passphrase $pass -o $arqout $arqin 2>/dev/null
if [ -e $arqout ]
then
echo ""
echo "****************************************************************"
echo "* :D The pass "\"$pass\"" is the correct. Congrats !!!"
echo "* The file $arqout was successfully generated !!!"
echo "****************************************************************"
echo ""
break
fi
done