Open 0xAugust opened 3 years ago
Quick&Dirty-Fix: diff --git a/ntds/dsencryption.py b/ntds/dsencryption.py index 5a5aaeb..55bb470 100755 --- a/ntds/dsencryption.py +++ b/ntds/dsencryption.py @@ -64,5 +64,5 @@ def dsDecryptSingleHash(rid, enc_hash): (des_k1,des_k2) = sid_to_key(rid) d1 = DES.new(des_k1, DES.MODE_ECB) d2 = DES.new(des_k2, DES.MODE_ECB) - hash = d1.decrypt(enc_hash[:8]) + d2.decrypt(enc_hash[8:]) - return hash \ No newline at end of file + hash = d1.decrypt(enc_hash[:8]) + d2.decrypt(enc_hash[8:16]) + return hash[:16]
Quick&Dirty-Fix:
diff --git a/ntds/dsencryption.py b/ntds/dsencryption.py index 5a5aaeb..55bb470 100755 --- a/ntds/dsencryption.py +++ b/ntds/dsencryption.py @@ -64,5 +64,5 @@ def dsDecryptSingleHash(rid, enc_hash): (des_k1,des_k2) = sid_to_key(rid) d1 = DES.new(des_k1, DES.MODE_ECB) d2 = DES.new(des_k2, DES.MODE_ECB) - hash = d1.decrypt(enc_hash[:8]) + d2.decrypt(enc_hash[8:]) - return hash \ No newline at end of file + hash = d1.decrypt(enc_hash[:8]) + d2.decrypt(enc_hash[8:16]) + return hash[:16]
This works perfect!!!Thanks
Originally posted by @0pa9ue in https://github.com/csababarta/ntdsxtract/issues/30#issuecomment-717089099
Hello, this can extract the hash value, but the extracted hash is wrong. How can I solve it.... :)
This works perfect!!!Thanks
Originally posted by @0pa9ue in https://github.com/csababarta/ntdsxtract/issues/30#issuecomment-717089099