[GH-ISSUE #1844] Support for Azure AD password sync. hashes #1224

Open
opened 2026-10-14 03:39:44 +07:00 by bsakaguchi · 17 comments
Owner

Originally created by @kholia on GitHub (Oct 21, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1844

Originally assigned to: @magnumripper on GitHub.

http://www.openwall.com/lists/john-users/2015/10/18/3

Originally created by @kholia on GitHub (Oct 21, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1844 Originally assigned to: @magnumripper on GitHub. http://www.openwall.com/lists/john-users/2015/10/18/3
Author
Owner

@kholia commented on GitHub (Oct 21, 2015):

Please feel free to grab this ticket.

<!-- gh-comment-id:149867417 --> @kholia commented on GitHub (Oct 21, 2015): Please feel free to grab this ticket.
Author
Owner

@jfoug commented on GitHub (Nov 2, 2015):

Added to pass_gen.pl:

6a48df3

An example (taken right from the page https://www.dsinternals.com/en/how-azure-active-directory-connect-syncs-passwords/

$ ../run/pass_gen.pl azuread

Enter words to hash, one per line.
Pa$$w0rd
u0:v1;PPH1_MD4,317ee9d1dec6508fa510,100,f4a257ffec53809081a605ce8ddedfbc9df9777b80256763bc0a6dd895ef404f;:0:0:Pa$$w0rd:
<!-- gh-comment-id:153063747 --> @jfoug commented on GitHub (Nov 2, 2015): Added to pass_gen.pl: 6a48df3 An example (taken right from the page https://www.dsinternals.com/en/how-azure-active-directory-connect-syncs-passwords/ ``` $ ../run/pass_gen.pl azuread Enter words to hash, one per line. Pa$$w0rd u0:v1;PPH1_MD4,317ee9d1dec6508fa510,100,f4a257ffec53809081a605ce8ddedfbc9df9777b80256763bc0a6dd895ef404f;:0:0:Pa$$w0rd: ```
Author
Owner

@jfoug commented on GitHub (Nov 2, 2015):

github.com/magnumripper/JohnTheRipper@504471bb33

The set_key could be 'optimized' some, but my tests show that the speed is almost exactly 200x raw-sha256, so I really think there is little to be gained by optimizing that function (much less than 1%), AND the readability of the 'reference' implementation of set_key makes it very easy to see just wtf is happening. When we move this code to GPU, we certainly will need to look at optimization of that code. With just 100 iterations of PBKDF2, if we did this type stuff in oSSL in the CPU, we would see a much larger impact. In the GPU code, we likely would make a 'keys_dirty' if block in the crypt_all call, to load the 64 byte utf-16 nt hex string.

<!-- gh-comment-id:153119303 --> @jfoug commented on GitHub (Nov 2, 2015): https://github.com/magnumripper/JohnTheRipper/commit/504471bb331fa5ad07e2a00755a710c5bf261343 The set_key could be 'optimized' some, but my tests show that the speed is almost exactly 200x raw-sha256, so I really think there is little to be gained by optimizing that function (much less than 1%), AND the readability of the 'reference' implementation of set_key makes it very easy to see just wtf is happening. When we move this code to GPU, we certainly will need to look at optimization of that code. With just 100 iterations of PBKDF2, if we did this type stuff in oSSL in the CPU, we would see a much larger impact. In the GPU code, we likely would make a 'keys_dirty' if block in the crypt_all call, to load the 64 byte utf-16 nt hex string.
Author
Owner

@jfoug commented on GitHub (Nov 2, 2015):

WootWoot ! Works on BE without modifications :)

<!-- gh-comment-id:153124417 --> @jfoug commented on GitHub (Nov 2, 2015): WootWoot ! Works on BE without modifications :)
Author
Owner

@magnumripper commented on GitHub (Nov 2, 2015):

Fixed algo name in 5afa94e

<!-- gh-comment-id:153124489 --> @magnumripper commented on GitHub (Nov 2, 2015): Fixed algo name in 5afa94e
Author
Owner

@magnumripper commented on GitHub (Nov 2, 2015):

Hmmm actually the algo name should be PBKDF2-SHA256, no?

<!-- gh-comment-id:153124862 --> @magnumripper commented on GitHub (Nov 2, 2015): Hmmm actually the algo name should be PBKDF2-SHA256, no?
Author
Owner

@jfoug commented on GitHub (Nov 2, 2015):

Yes, probably PBKDF2-HMACSHA256+MD4

<!-- gh-comment-id:153139581 --> @jfoug commented on GitHub (Nov 2, 2015): Yes, probably PBKDF2-HMACSHA256+MD4
Author
Owner

@jfoug commented on GitHub (Nov 2, 2015):

They use all sorts of strange mixed stuff. MD4, UTF-16 (twice), Hexing, Upcasing, etc, and then a PBKDF2-hmacSHA256, but with too few iterations to really be safe.

Look at setkey for the algorithm (or better yet, the new code in pass_gen.pl). The function is easy, but it does a few things that dynamic could not have done. The way I wrote it, it should be somewhat easy to port to GPU. Also, the layout, where the 'real' type hash has the iteration count, and a version number in it, makes it look like this will quickly transform into a v2 hash.

<!-- gh-comment-id:153140406 --> @jfoug commented on GitHub (Nov 2, 2015): They use all sorts of strange mixed stuff. MD4, UTF-16 (twice), Hexing, Upcasing, etc, and then a PBKDF2-hmacSHA256, but with too few iterations to really be safe. Look at setkey for the algorithm (or better yet, the new code in pass_gen.pl). The function is easy, but it does a few things that dynamic could not have done. The way I wrote it, it should be somewhat easy to port to GPU. Also, the layout, where the 'real' type hash has the iteration count, and a version number in it, makes it look like this will quickly transform into a v2 hash.
Author
Owner

@jfoug commented on GitHub (Nov 2, 2015):

But 99% of the time (or more), is spent in the pbkdf2 code, so that really 'should' be the algorithm listed. It is like mscash2 It uses NT hash also, BUT that is just an insignificant part of the whole overall function time.

<!-- gh-comment-id:153140901 --> @jfoug commented on GitHub (Nov 2, 2015): But 99% of the time (or more), is spent in the pbkdf2 code, so that really 'should' be the algorithm listed. It is like mscash2 It uses NT hash also, BUT that is just an insignificant part of the whole overall function time.
Author
Owner

@kholia commented on GitHub (Nov 23, 2015):

@magnumripper @jfoug can we close this issue now?

<!-- gh-comment-id:158824513 --> @kholia commented on GitHub (Nov 23, 2015): @magnumripper @jfoug can we close this issue now?
Author
Owner

@magnumripper commented on GitHub (Nov 23, 2015):

I guess

<!-- gh-comment-id:158824662 --> @magnumripper commented on GitHub (Nov 23, 2015): I guess
Author
Owner

@jfoug commented on GitHub (Nov 23, 2015):

Are we not going to have a GPU version?

<!-- gh-comment-id:158987497 --> @jfoug commented on GitHub (Nov 23, 2015): Are we not going to have a GPU version?
Author
Owner

@magnumripper commented on GitHub (Nov 23, 2015):

I haven't ever heard of Azure AD so I have no incentive to write one. OTOH it looks simple enough - we have all the bits needed.

<!-- gh-comment-id:159023812 --> @magnumripper commented on GitHub (Nov 23, 2015): I haven't ever heard of Azure AD so I have no incentive to write one. OTOH it looks simple enough - we have all the bits needed.
Author
Owner

@kholia commented on GitHub (Nov 23, 2015):

I can take this one, @jfoug has a bigger fish to fry ;)

<!-- gh-comment-id:159024070 --> @kholia commented on GitHub (Nov 23, 2015): I can take this one, @jfoug has a bigger fish to fry ;)
Author
Owner

@jfoug commented on GitHub (Nov 23, 2015):

It's Micro$oft cloud active directory. It is possible this may be a 'big' thing.

<!-- gh-comment-id:159025346 --> @jfoug commented on GitHub (Nov 23, 2015): It's Micro$oft cloud active directory. It is possible this may be a 'big' thing.
Author
Owner

@magnumripper commented on GitHub (Nov 23, 2015):

@kholia if you base it on krb5pa-md5-opencl, you'll get full encoding support for free.

<!-- gh-comment-id:159027524 --> @magnumripper commented on GitHub (Nov 23, 2015): @kholia if you base it on krb5pa-md5-opencl, you'll get full encoding support for free.
Author
Owner

@kholia commented on GitHub (Jan 11, 2017):

I am returning this issue back to the queue. Azure AD GPU support needs to be implemented to fix this issue.

<!-- gh-comment-id:271797902 --> @kholia commented on GitHub (Jan 11, 2017): I am returning this issue back to the queue. Azure AD GPU support needs to be implemented to fix this issue.
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#1224
No description provided.