How to crack CMIYC hash files?
#1
I recently discovered the CMIYC contests and for practise, I want to crack previous contest hashes on my machine. I have downloaded the 2012 file from here
[url=https://contest-2012.korelogic.com/cmiyc_2012_password_hash_files.tar.bz2][/url]
When I open the first text file in there (hashes-1.sha512crypt.txt) I notice the hashes are not easily read by hashid or hashcat, I assume due to the usernames and trailing ::0::: characters in it. They look like this:

Code:
rahmanj:$6$gjxgtlzspT2wzWJW$61tKBfooVrQC6/hYZ3TXKpFuLmNnAHomE/Ccf.dRWDo87W2MeoeOSPGSYNlAGfDwYugiV.KGWJGSEzXEjT4OI0:1::::::
garcias:$6$gOpi1hk1MNE9/Pvv$9V6PTndHdlxu3ro9faPWscCK63mgei3wdwZlqKjpPvjutZO9QuUtvkUVF.LyDUla3PZL4.X0xaBsH1cj84JML0:1::::::
bsharma:$6$kZ5CEnqse5xgF9EY$MBg9YBlyBBBX/uJBs5hqEYFhPgQUHYkfxNnQu7T5PHAY7T5dUaTlYSGMRmqAXJbg5SU6pEs/ckI4qdjcjs7Tz.:1::::::
barba.collins:$6$EZuYSrVqGLMH/1NB$pURWdPcqbXENNXtTLH59vskyQUAMeRvd5Je45rBlztW6HyJ.EkqKwM1FXkkvFC/ZPOZ9Qrm5/rVTe1xkNX93o/:1::::::


I try to run a hashcat instance with the --username flag, however it still doesn't "work". When I run JUST the hash values into hashid, they are recognized just fine, however I'm looking for a way to parse these files automatically without me having to go into the text files and manually replacing the prepended usernames and the appended "::0:::" stuff with nothing.

Can I get some guidance on how to "read" these hashes using hashcat??
Reply
#2
well you have to do some manual work here, hashcat will always throw a token lenght exeption for this lines, even when using --username

i did a fast test with the following command

Code:
while read -r line; do echo $line | awk -F [:] {'print $2}'; done < hashes-1.sha512crypt.txt > hashes-only.txt

resulting in a file with the hashes only 

Code:
$6$gjxgtlzspT2wzWJW$61tKBfooVrQC6/hYZ3TXKpFuLmNnAHomE/Ccf.dRWDo87W2MeoeOSPGSYNlAGfDwYugiV.KGWJGSEzXEjT4OI0
$6$gOpi1hk1MNE9/Pvv$9V6PTndHdlxu3ro9faPWscCK63mgei3wdwZlqKjpPvjutZO9QuUtvkUVF.LyDUla3PZL4.X0xaBsH1cj84JML0
$6$kZ5CEnqse5xgF9EY$MBg9YBlyBBBX/uJBs5hqEYFhPgQUHYkfxNnQu7T5PHAY7T5dUaTlYSGMRmqAXJbg5SU6pEs/ckI4qdjcjs7Tz.
$6$EZuYSrVqGLMH/1NB$pURWdPcqbXENNXtTLH59vskyQUAMeRvd5Je45rBlztW6HyJ.EkqKwM1FXkkvFC/ZPOZ9Qrm5/rVTe1xkNX93o/

if you want username:hash use

Code:
while read -r line; do echo $line | awk -F [:] {'print $1":"$2}'; done < hashes-1.sha512crypt.txt > hashes-only.txt

working also on windows with windows subshell for linux
Reply
#3
Thanks a lot, this will work. Was just curious if hashcat had some options to parse this that I was just missing or if we had to do it ourselves. Thanks a lot!
Reply