[GH-ISSUE #2194] --format=ntlmv2-opencl possible failure #1465

Closed
opened 2026-10-15 04:18:03 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @nuartvision on GitHub (Aug 2, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2194

Hi, came across an issue on the Internet where user claims that he has problems with opencl format for ntlmv2 - some passwords fail to be found despite the fact that they are present in wordlist. Can you please have a look? Also asked the user to provide additional input here.

image

Для меня оказалось откровением то, что популярные утилиты — Hashcat (-legacy) и John The Ripper (OpenCL-реализация) — неправильно взламывают NTLMv2-хеши. Просто не могут подобрать пароль, хотя он гарантированно есть в словаре. С oclHashcat и Hashcat 3.0, вроде бы, все в порядке. Остается только догадываться, сколько паролей не было взломано из-за этих ошибок…

https://habrahabr.ru/post/306810/

image

valdikss::MicrosoftAccount:1122334455667788:F74ECC1AECC1D113782C823BB330772E:010100000000000039B063751BECD1017BAAF43DFFEEB51D0000000002000E004E004F004D00410054004300480001000A0053004D0042003100320004000A0053004D0042003100320003000A0053004D0042003100320005000A0053004D0042003100320008003000300000000000000001000000001000007A91E6D78F02D98EB60F535074AB74D9FA5E62D85D40CB60DC5510339F9537450A001000000000000000000000000000000000000900340063006900660073002F00770069007400630068002E00760061006C00640069006B00730073002E006F00720067002E00720075000000000000000000

password is 123qq

Originally created by @nuartvision on GitHub (Aug 2, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2194 Hi, came across an issue on the Internet where user claims that he has problems with opencl format for ntlmv2 - some passwords fail to be found despite the fact that they are present in wordlist. Can you please have a look? Also asked the user to provide additional input here. ![image](https://cloud.githubusercontent.com/assets/1858405/17319248/16ff7d3c-5895-11e6-8a27-4a1d3cfa6aea.png) > Для меня оказалось откровением то, что популярные утилиты — Hashcat (-legacy) и John The Ripper (OpenCL-реализация) — неправильно взламывают NTLMv2-хеши. Просто не могут подобрать пароль, хотя он гарантированно есть в словаре. С oclHashcat и Hashcat 3.0, вроде бы, все в порядке. Остается только догадываться, сколько паролей не было взломано из-за этих ошибок… https://habrahabr.ru/post/306810/ ![image](https://cloud.githubusercontent.com/assets/1858405/17319343/b230c338-5895-11e6-8401-9397811ba9a2.png) > valdikss::MicrosoftAccount:1122334455667788:F74ECC1AECC1D113782C823BB330772E:010100000000000039B063751BECD1017BAAF43DFFEEB51D0000000002000E004E004F004D00410054004300480001000A0053004D0042003100320004000A0053004D0042003100320003000A0053004D0042003100320005000A0053004D0042003100320008003000300000000000000001000000001000007A91E6D78F02D98EB60F535074AB74D9FA5E62D85D40CB60DC5510339F9537450A001000000000000000000000000000000000000900340063006900660073002F00770069007400630068002E00760061006C00640069006B00730073002E006F00720067002E00720075000000000000000000 password is 123qq
Author
Owner

@nuartvision commented on GitHub (Aug 2, 2016):

Unfortunately currently I have only "contest" version available. The password is successfully found there.
image

<!-- gh-comment-id:236818039 --> @nuartvision commented on GitHub (Aug 2, 2016): Unfortunately currently I have only "contest" version available. The password is successfully found there. ![image](https://cloud.githubusercontent.com/assets/1858405/17319623/87d97240-5897-11e6-999c-eb081333c56a.png)
Author
Owner

@ValdikSS commented on GitHub (Aug 2, 2016):

Seems to be working fine with git version but not on 1.8.0-jumbo-1 release version (the one from 2014) which is in ArchLinux repository.

<!-- gh-comment-id:236819413 --> @ValdikSS commented on GitHub (Aug 2, 2016): Seems to be working fine with git version but not on 1.8.0-jumbo-1 release version (the one from 2014) which is in ArchLinux repository.
Author
Owner

@nuartvision commented on GitHub (Aug 2, 2016):

yes, it fails on "1.8.0-jumbo-1"
image

<!-- gh-comment-id:236828756 --> @nuartvision commented on GitHub (Aug 2, 2016): yes, it fails on "1.8.0-jumbo-1" ![image](https://cloud.githubusercontent.com/assets/1858405/17320867/606965ec-589e-11e6-8543-ae7ac7965bf6.png)
Author
Owner

@magnumripper commented on GitHub (Aug 2, 2016):

So this is fixed already.

<!-- gh-comment-id:237081613 --> @magnumripper commented on GitHub (Aug 2, 2016): So this is fixed already.
Author
Owner

@solardiz commented on GitHub (Aug 3, 2016):

I'm not sure what the problem was and what fixed it, but possibly it's fffeee5928 "NETNTLM buffer overflow. Fix #1405 Fix #1406".

Anyway, I was about to suggest that we have JtR print a warning for all OpenCL/CUDA fast hash formats that do not support GPU mask mode, as well as for all OpenCL/CUDA fast hash formats when GPU mask mode is not used, suggesting that the CPU format or GPU mask (where supported) be used instead. It is generally pointless to run those hashes on GPU w/o on-GPU mask.

However, it turns out that our netntlmv2 CPU format does not use SIMD, so it actually is a lot slower than ntlmv2-opencl for me, even though both produce shamefully low speeds for this non-iterated hash and for their respective devices (that's no surprise: no SIMD for one format, and no on-GPU mask for the other). Specifically, the speeds I got on "super" for netntlmv2 are 8.35M OpenMP (32 threads), 395K_32 = 12.6M "--fork=32", 63M for ntlmv2-opencl on Titan X (nvidia-smi shows GPU util of 25%), 4_59M = 236M for "--fork=4" on Titan X (using the same GPU four times, from four separate CPU processes, for GPU util 74%), 55M_6 = 330M for "--fork=6" on Titan X (92%), 52M_8 = 416M for "--fork=8" on Titan X (finally 98%, 185W). All of this is for running against one hash with --mask='?a?a?a?a?a?a'. So the GPU format does make some sense for the time being, even if its reasonable use is hackish like this.

I still think the warnings are a good idea, but maybe we should make them selective or/and adjust the wording depending on our own speed measurements for each pair of CPU vs. GPU formats. magnum, feel free to open a separate issue for tracking this, if you feel we should proceed to add such warnings. We do have some warnings of this kind (grep the tree for "inefficient"), but I think they're not connected to GPU mask mode support (and making use of it in a given invocation) or lack thereof.

<!-- gh-comment-id:237103953 --> @solardiz commented on GitHub (Aug 3, 2016): I'm not sure what the problem was and what fixed it, but possibly it's fffeee59286eb85d68179ef40abeed1658ba2c3b "NETNTLM buffer overflow. Fix #1405 Fix #1406". Anyway, I was about to suggest that we have JtR print a warning for all OpenCL/CUDA fast hash formats that do not support GPU mask mode, as well as for all OpenCL/CUDA fast hash formats when GPU mask mode is not used, suggesting that the CPU format or GPU mask (where supported) be used instead. It is generally pointless to run those hashes on GPU w/o on-GPU mask. However, it turns out that our netntlmv2 CPU format does not use SIMD, so it actually is a lot slower than ntlmv2-opencl for me, even though both produce shamefully low speeds for this non-iterated hash and for their respective devices (that's no surprise: no SIMD for one format, and no on-GPU mask for the other). Specifically, the speeds I got on "super" for netntlmv2 are 8.35M OpenMP (32 threads), 395K_32 = 12.6M "--fork=32", 63M for ntlmv2-opencl on Titan X (nvidia-smi shows GPU util of 25%), 4_59M = 236M for "--fork=4" on Titan X (using the same GPU four times, from four separate CPU processes, for GPU util 74%), 55M_6 = 330M for "--fork=6" on Titan X (92%), 52M_8 = 416M for "--fork=8" on Titan X (finally 98%, 185W). All of this is for running against one hash with --mask='?a?a?a?a?a?a'. So the GPU format does make some sense for the time being, even if its reasonable use is hackish like this. I still think the warnings are a good idea, but maybe we should make them selective or/and adjust the wording depending on our own speed measurements for each pair of CPU vs. GPU formats. magnum, feel free to open a separate issue for tracking this, if you feel we should proceed to add such warnings. We do have some warnings of this kind (grep the tree for "inefficient"), but I think they're not connected to GPU mask mode support (and making use of it in a given invocation) or lack thereof.
Author
Owner

@solardiz commented on GitHub (Aug 3, 2016):

ntlmv2-opencl also makes sense on CPU, where it can take advantage of OpenCL "driver"'s (auto-)vectorization and thereby make use of SIMD where our CPU format does not. On super, getting 27.1M with this format using Intel's "driver", or more than twice faster than our CPU format did with "--fork=32". Looks like there's room for more speedup through vectorization of ntlmv2_nthash, though:

Kernel <ntlmv2_nthash> was not vectorized
Kernel <ntlmv2_final> was successfully vectorized

(only matters when running on no or few different "salts"?)

<!-- gh-comment-id:237106825 --> @solardiz commented on GitHub (Aug 3, 2016): ntlmv2-opencl also makes sense on CPU, where it can take advantage of OpenCL "driver"'s (auto-)vectorization and thereby make use of SIMD where our CPU format does not. On super, getting 27.1M with this format using Intel's "driver", or more than twice faster than our CPU format did with "--fork=32". Looks like there's room for more speedup through vectorization of ntlmv2_nthash, though: ``` Kernel <ntlmv2_nthash> was not vectorized Kernel <ntlmv2_final> was successfully vectorized ``` (only matters when running on no or few different "salts"?)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1465
No description provided.