2
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, Domain, UserName, Password)

If i pass a correct password in code snippet above, authentication works fine but suppose i do not have the password but i have been provided with the password hash, how would i use the hash only in the above line to authenticate with out ever knowing the real password string?

Lets assume the password hash is created using this class https://msdn.microsoft.com/en-us/library/system.security.cryptography.rngcryptoserviceprovider.aspx

Or if the above is not possible, is it possible to at-least get the password hash of a given account such that i can compare the password hash returned from AD with the hash supplied to check if they match?

StackTrace
  • 9,190
  • 36
  • 114
  • 202

0 Answers0