3 #==============================================================================
4 # Name : luks_dic_attack
8 # Description : Crack LUKS partion with hashcat with dictionary attack
9 #==============================================================================
12 # awk '$1~/[[:digit:]]/ && $3~/[[:alnum:]]/ && $4 == "";\
13 lsblk
--noheadings --raw -o NAME
,SIZE
,FSTYPE
,TYPE
,MOUNTPOINT |\
14 awk '$4 == "part" && $5 == "" && $3 == "crypto_LUKS"'|\
15 dmenu
-i -p "Mount volume" -l 10 )
17 partion
=$
(echo $chosen |
awk '{print $1}')
21 output_header_file
=luks_header
.001
22 # dictionary=/mnt/data/wordlist/rockyou.txt
23 dictionary
=/home
/hassan
/dic.txt
24 cracked_password
=cracked_password.txt
28 dmenu
-P -p "Get Partition header | sudo " |\
29 sudo
-S dd if=$dev of
=$output_header_file bs
=512 count
=4097 \
30 && notify-send
"Success" "Got header file"\
31 || notify-send
-u critical
"Error" "Getting header file"
34 # Case got header file -> crack with hashcat
35 if [ $luks_header ];then
36 hashcat
-m 14600 -a 0 -w 3\
37 $output_header_file $dictionary -o $cracked_password \
38 && notify-send
"Success" "Cracked"\
39 || notify-send
-u critical
"Error" "Crack failed"