SHA512crypt Hash Error in notepad file, not in Unix file nor quotes
#1
Hello.
I am remote SSHing to Ubuntu v12 to test password cracking, so in a Putty remote shell (with a test accout, of course) I do:

Code:
luis@bt:~/Temporal/passwords$ sudo more /etc/shadow | grep "test" -i
test:$6$gFe63P5R$WjoBBzHKpY/8WZy2nm8NTKX5MMDqmetAfy1MuDz2Nk1KuT2HM6lTu0gK/fROSc9GHK8v0.9B8JHwx/CSTG2wD.:15788:0:99999:7:::

Then I copy the corresponding part in the line to a text file in Windows using notepad:

Code:
$6$gFe63P5R$WjoBBzHKpY/8WZy2nm8NTKX5MMDqmetAfy1MuDz2Nk1KuT2HM6lTu0gK/fROSc9GHK8v0.9B8JHwx/CSTG2wD.

And this is what happens:

Code:
PS F:\Crackeo en Proceso\Pruebas\Ubuntu> oclHashcat-plus64.exe -m 1800 Hash.txt -a 3 test
WARNING: Hashfile 'Hash.txt' in line 1 ( ■$): Line-length exception
ERROR: No hashes loaded

This other way goes OK:

Code:
more /etc/shadow | grep "test" > Hash.txt

[I send the file to my Windows machine via SFTP...]

PS F:\Crackeo en Proceso\Pruebas\Ubuntu> oclHashcat-plus64.exe -m 1800 Hash.txt-a 3 test

$6$gFe63P5R$WjoBBzHKpY/8WZy2nm8NTKX5MMDqmetAfy1MuDz2Nk1KuT2HM6lTu0gK/fROSc9GHK8v0.9B8JHwx/CSTG2wD.:test
Session.Name...: oclHashcat-plus
Status.........: Cracked

And this one goes fine too (using single quote, not double quote):

Code:
PS F:\Crackeo en Proceso\Pruebas\Ubuntu> oclHashcat-plus64.exe -m 1800 '$6$1HQ40OJz$jYLABZr4SaTAnym3.r8.mqTFwaEYacSV3XIyVVRxrIWqxQu3DubfkRaz84F4tncKCSyDoPpWmam5JKV/x1T1/0' -a 3 prueba

$6$1HQ40OJz$jYLABZr4SaTAnym3.r8.mqTFwaEYacSV3XIyVVRxrIWqxQu3DubfkRaz84F4tncKCSyDoPpWmam5JKV/x1T1/0:prueba

Session.Name...: oclHashcat-plus
Status.........: Cracked

I have tested this behavior with v0.12 and v0.13.
Why is this happening, and how could this be solved?

Thanks.
#2
Windows notepad is awful, use Notepad++
#3
(03-24-2013, 02:36 PM)undeath Wrote: Windows notepad is awful, use Notepad++

Yep. Same problem if I do from Windows console:

Code:
echo '$6$1HQ40OJz$jYLABZr4SaTAnym3.r8.mqTFwaEYacSV3XIyVVRxrIWqxQu3DubfkRaz84F4tncKCSyD​oPpWmam5JKV/x1T1/0' > Hash.txt

I have solved it using UltraEdit.

Thanks for your suggestion, Undeath.