0

I'm trying to attack LUKS header for an assignment. I have to use john and I need to crack the sha256 hash.

I made a virtual partition using dd to simulate a storage device on Kali. I encrypted it with LUKS1 using PBKDF2 as the PBKDF with force iterations and any other parameter as default.

This is my LUKS command:

cryptsetup luksFormat --type luks1 --pbkdf pbkdf2 --pbkdf-force-iterations 100000 image_file_name.img 

I try to extract the LUKS header with luks2john into a .txt file:

/usr/bin/luks2john image_file_name.img > txt_file_name.txt 

but I get the error:

.../(File path) : Only cbc-essiv:sha256 mode is supported. Used mode :b'xts-plain64\x00.......' 

So I try using the aes-cbc-essiv:sha256 as the cipher:

cryptsetup luksFormat --type luks1 --key-size 256 --cipher aes-cbc-essiv:sha256 --hash sha256 --pbkdf pbkdf2 --pbkdf-force-iterations 100000 image_file_name.img 

but I get the error:

.../(File path) : Only sha1 hash is supported. Used hash: b'sha256\x00......' 

I've tried to update John through git and clone it directly, but it still doesn't work.

7
  • Did you google this error? This was my top hit: gist.github.com/micxer/63b49e09558904dd64ef78400c6b9517 Did you look at the text file to see what the output might tell you? Do you need to use john or can you use other tools? Did you try --hash sha1? Commented Aug 28 at 8:55
  • My main problem is with luks2john because I need to use SHA-256 as the main hash, and apparently luks2john didn't support that. Yes I've tried googling the error and I still couldn't figure out why. For the .txt file it resulted with no text at all, and the --hash sha1 I did try that and it work completely fine, the hash string from LUKS header made it into the .txt file, but I need to use --hash sha256 for this research. And lastly I do need to use john as the main tools. @schroeder Commented Aug 28 at 14:03
  • Read the link I provided above. It explains that john might not be the best tool for LUKS. Commented Aug 28 at 14:09
  • and you made sure you have the most up-to-date luks2john? That's important because that's what's giving you the error. Do you have to use the settings you used for LUKS? Is the person who gave you this assignment sure that the LUKS settings work for luks2john? Commented Aug 28 at 14:13
  • for the luks2john update as far as I know, Yes, I've updated the latest john package which I assume must have also included the latest luks2john, I've tried updating using git to directly clone from https://github.com/openwall/john and also apt update && apt upgrade. For research purpose, Yes I have to use the settings Commented Aug 28 at 14:24

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.