Skip to content

Instantly share code, notes, and snippets.

@ridingintraffic
Last active December 10, 2018 08:56
Show Gist options
  • Save ridingintraffic/f463838d21dc9bab3f4e6674ab58d4f9 to your computer and use it in GitHub Desktop.
Save ridingintraffic/f463838d21dc9bab3f4e6674ab58d4f9 to your computer and use it in GitHub Desktop.
luks and hashcat
$ dd if=/dev/urandom of=test bs=1M count=100
$ cryptsetup luksFormat test #use password password
$ cryptsetup luksOpen test tmp
$ xxd -l 512 /dev/mapper/tmp # is random data at this point
$ mkfs.ext4 /dev/mapper/tmp # use the same file system that is used by your system/device
$ xxd -l 512 /dev/mapper/tmp # should no longer be random data
$ cryptsetup luksClose tmp
$ cryptsetup luksDump test | grep "Payload offset" # add 1 to the offset value that comes back
$ dd if=test of=luks-header bs=512 count=4097 # grabs header
$ echo "password" >>list
$ hashcat -m 14600 -a 0 -w 3 luks-header list -o found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment