How to: Unlock the encryption of your /home if you don't know your lock code (Bruteforce)

So out of interest, I tried this on my own lockcode (which is more random and 6 digits long) using the following commands:

dd if=/dev/disk/by-id/dm-name-sailfish-home of=/home/defaultuser/hashcat.luks bs=512 count=4097

Then hashcat on my desktop:

hashcat -a 3 -m 14600 hashcat-xperia10.luks '?d?d?d?d?d?d'

(I.e. bruteforce luksheader with an input mask of 6 digits)

On my Linux desktop with a partially broken rocm install (so probably low performance), this took 6 minutes and 23 seconds:

hashcat-xperia10.luks:xxxxxx                                                                                                                       

Session..........: hashcat
Status...........: Cracked
Hash.Name........: LUKS
Hash.Target......: hashcat-xperia10.luks
Time.Started.....: Wed Sep 15 16:51:33 2021 (6 mins, 23 secs) 
Time.Estimated...: Wed Sep 15 16:57:56 2021 (0 secs)
Guess.Mask.......: ?d?d?d?d?d?d [6]
Guess.Queue......: 1/1 (100.00%) 
Speed.#1.........:     1044 H/s (1.96ms) @ Accel:128 Loops:32 Thr:64 Vec:1
Recovered........: 1/1 (100.00%) Digests
Progress.........: 400000/1000000 (40.00%) 
Rejected.........: 0/400000 (0.00%)
Restore.Point....: 0/100000 (0.00%) 
Restore.Sub.#1...: Salt:0 Amplifier:3-4 Iteration:1399936-1399966
Candidates.#1....: xxxxxx -> xxxxxx
Hardware.Mon.#1..: Temp: 76c Fan:  0% Core:1630MHz Mem: 945MHz Bus:16

                                                        
Started: Wed Sep 15 16:50:58 2021
Stopped: Wed Sep 15 16:57:57 2021

So yeah, it doesn’t take long.

8 Likes