Description: Our first insider threat has lead to a second insider. We haven’t found any clues to the passphrase here, but given the vocabulary of the suspect, I don’t think you’ll have a hard time.
We don’t any more files so we need to actually brute force the passphrase, so let’s try using hashcat for this. But First of all we need to set up a loop device of our image, we need to check the partitions with parted and look at the offset:
1 2 3 4 5 6 7 8 9 10 11 12 13
$ sudo parted goodluks2.img GNU Parted 3.2 (parted) U Unit? [compact]? B (parted) print Model: (file) Disk ~/ctf/bsidectf/forensics/goodluks2/goodluks2.img: 34359738368B Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags:
Number Start End Size Type File system Flags 1 1048576B 34359738367B 34358689792B primary
We want to loop the primary partition so we want to use losetup at 1048576 offset:
Now that we have to extract the luks header which will contain the hash for us to crack, we can use dd but first we need to locate the offset to the header, we can do this with cryptsetup luksDump:
Now we just need to crack with hashcat, I used the password list named rockyou.txt you can find it easily on the internet it took approximately 14 minutes with both CPU and GPU running:
After cracking it (gaffer3) we just need decrypt and mount the disk to get the flag!
1 2 3 4 5 6 7
$ sudo cryptsetup luksOpen /dev/loop11 bkup Enter passphrase for ~/ctf/bsidectf/forensics/goodluks2/goodluks2.img: gaffer3 $ sudo mount /dev/mapper/bkup /mnt/ $ ls /mnt/ flag.txt JohnTheRipper.7z lost+found rockyou.7z $ cat /mnt/flag.txt CTF{lame_users_keys_suck}