Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added SamrUnicodeChangePasswordUser2 request and response classes for… #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emrahozel
Copy link

@emrahozel emrahozel commented Feb 18, 2024

Description

To implement the SamrUnicodeChangePasswordUser2 method I need a set of encryption operations. I need some suggestions on how to create them. For example in python impacket project:

def hSamrUnicodeChangePasswordUser2(dce, serverName='\x00', userName='', oldPassword='', newPassword='', oldPwdHashLM = '', oldPwdHashNT = ''):
  oldPwdHashNT = ntlm.NTOWFv1(oldPassword)
  newPwdHashNT` = ntlm.NTOWFv1(newPassword)
  samUser` = SAMPR_USER_PASSWORD()
  samUser['Length'] = len(newPassword)*2
  pwdBuff = samUser.getData()
  rc4 = ARC4.new(oldPwdHashNT)
  encBuf = rc4.encrypt(pwdBuff)
  request['NewPasswordEncryptedWithOldNt']['Buffer'] = encBuf
  request['OldNtOwfPasswordEncryptedWithNewNt'] = crypto.SamEncryptNTLMHash(oldPwdHashNT, newPwdHashNT)
  request['LmPresent'] = 0
  request['NewPasswordEncryptedWithOldLm'] = NULL
  request['OldLmOwfPasswordEncryptedWithNewNt'] = NULL

For example, I could not create the SamEncryptNTLMHash method, which has the LMOWFv1 method in the NtlmV1Functions class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant