How to make use of the DES KPA mode - Printable Version +- hashcat Forum (https://hashcat.net/forum) +-- Forum: Misc (https://hashcat.net/forum/forum-15.html) +--- Forum: User Contributions (https://hashcat.net/forum/forum-25.html) +--- Thread: How to make use of the DES KPA mode (/thread-5832.html) |
How to make use of the DES KPA mode - atom - 09-03-2016 Just wanted to make a quick writeup how to use the new DES KPA cracking mode. An interessting example, I thought, would be how to retrieve the NTLM out of a captured NetNTLMv1 session. It doesn't matter if you were the server to enforce some challenge or if you sniffed it from the wire. Note: The way we do it here will also work for cracking MSCHAPv2 or WPA2 Enterprise. So, basically what we're looking in NetNTLMv1 is the challenge and a 24 byte bytestream. To get them you can use metasploit or other tools, but I don't want to focus that here. For details how to get them, check out this page: https://crack.sh/mschapv2.html You end up in a string that looks like the following: $99$ESIzRFVmd4hye041+UcSnqUrnN7a6Gk0WGw= First we need to decode the base64, remove the $99$ signature and do this: Code: root@et:~/hashcat# echo -n 'ESIzRFVmd4hye041+UcSnqUrnN7a6Gk0WGw=' | base64 -d | xxd
So we end up in the following information:
To make use of hashcat's DES KPA cracking with just need two informations. The ciphertext and the plaintext. Both must be exactly 8 byte. Both need to be given in hex notation. So the hashes look like this: Code: root@et:~/hashcat# cat hashes.txt And that's it basically. Now we can start hashcat with this: Code: root@et:~/hashcat# ./hashcat -m 14000 hashes.txt -o cracked.txt -a 3 -1 charsets/DES_full.charset --hex-charset ?1?1?1?1?1?1?1?1 -w 3 Some explanations about the commandline:
Code: root@et:~/hashcat# cat cracked.txt Now that we've cracked the DES key, we need to decode them back to plain data. I've written a small program "deskey_to_ntlm.pl" to do that, it's part of hashcat-utils now: https://github.com/hashcat/hashcat-utils/blob/master/src/deskey_to_ntlm.pl Code: root@et:~/hashcat-utils/src# perl deskey_to_ntlm.pl 8923bdfdaf753f63 Now you can put the substrings together to get the final NTLM: 8846f7eaee8fb117ad06bdd830b7586c As a proof, that all the above worked correctly, I knew that the NTLM password was "password": Code: root@ht:~/hashcat-utils/src# echo -n password | iconv -f utf8 -t utf16le | openssl dgst -md4 You know, once you have the NTLM hash, you can do all the funny things like PTH or generate a kerberos ticket out of it or simply crack the NTLM. - atom RE: How to make use of the DES KPA mode - mubix - 09-03-2016 Awesome stuff! Thanks for making this happen atom. Really appreciate it. |