C# Класс SharpCifs.Smb.NtlmPasswordAuthentication

This class stores and encrypts NTLM user credentials.
This class stores and encrypts NTLM user credentials. The default credentials are retrieved from the jcifs.smb.client.domain, jcifs.smb.client.username, and jcifs.smb.client.password properties.

Read jCIFS Exceptions and NtlmAuthenticator for related information.

Наследование: Principal
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Anonymous NtlmPasswordAuthentication
additionalData Object

Открытые методы

Метод Описание
Equals ( object obj ) : bool

Compares two NtlmPasswordAuthentication objects for equality.

Compares two NtlmPasswordAuthentication objects for equality. Two NtlmPasswordAuthentication objects are equal if their caseless domain and username fields are equal and either both hashes are external and they are equal or both internally supplied passwords are equal. If one NtlmPasswordAuthentication object has external hashes (meaning negotiated via NTLM HTTP Authentication) and the other does not they will not be equal. This is technically not correct however the server 8 byte challage would be required to compute and compare the password hashes but that it not available with this method.

GetAnsiHash ( byte challenge ) : byte[]

Computes the 24 byte ANSI password hash given the 8 byte server challenge.

Computes the 24 byte ANSI password hash given the 8 byte server challenge.

GetDomain ( ) : string

Returns the domain.

Returns the domain.

GetHashCode ( ) : int

Return the upcased username hash code.

Return the upcased username hash code.

GetLMv2Response ( byte responseKeyLm, byte serverChallenge, byte clientChallenge ) : byte[]
GetLMv2Response ( string domain, string user, string password, byte challenge, byte clientChallenge ) : byte[]

Creates the LMv2 response for the supplied information.

Creates the LMv2 response for the supplied information.

GetName ( ) : string

Return the domain and username in the format: domain\\username.

Return the domain and username in the format: domain\\username. This is equivalent to toString().

GetNtlMv2Response ( byte responseKeyNt, byte serverChallenge, byte clientChallenge, long nanos1601, byte targetInfo ) : byte[]
GetNtlm2Response ( byte nTowFv1, byte serverChallenge, byte clientChallenge ) : byte[]
GetNtlmResponse ( string password, byte challenge ) : byte[]

Generate the Unicode MD4 hash for the password associated with these credentials.

Generate the Unicode MD4 hash for the password associated with these credentials.

GetPassword ( ) : string

Returns the password in plain text or null if the raw password hashes were used to construct this NtlmPasswordAuthentication object which will be the case when NTLM HTTP Authentication is used.

Returns the password in plain text or null if the raw password hashes were used to construct this NtlmPasswordAuthentication object which will be the case when NTLM HTTP Authentication is used. There is no way to retrieve a users password in plain text unless it is supplied by the user at runtime.

GetPreNtlmResponse ( string password, byte challenge ) : byte[]

Generate the ANSI DES hash for the password associated with these credentials.

Generate the ANSI DES hash for the password associated with these credentials.

GetSigningKey ( byte challenge ) : byte[]
GetUnicodeHash ( byte challenge ) : byte[]

Computes the 24 byte Unicode password hash given the 8 byte server challenge.

Computes the 24 byte Unicode password hash given the 8 byte server challenge.

GetUserSessionKey ( byte challenge ) : byte[]

Returns the effective user session key.

Returns the effective user session key.

GetUsername ( ) : string

Returns the username.

Returns the username.

NtlmPasswordAuthentication ( string userInfo ) : System

Create an NtlmPasswordAuthentication object from the userinfo component of an SMB URL like "domain;user:pass".

Create an NtlmPasswordAuthentication object from the userinfo component of an SMB URL like "domain;user:pass". This constructor is used internally be jCIFS when parsing SMB URLs.

NtlmPasswordAuthentication ( string domain, string username, byte challenge, byte ansiHash, byte unicodeHash ) : System

Create an NtlmPasswordAuthentication object with raw password hashes.

Create an NtlmPasswordAuthentication object with raw password hashes. This is used exclusively by the jcifs.http.NtlmSsp class which is in turn used by NTLM HTTP authentication functionality.

NtlmPasswordAuthentication ( string domain, string username, string password ) : System

Create an NtlmPasswordAuthentication object from a domain, username, and password.

Create an NtlmPasswordAuthentication object from a domain, username, and password. Parameters that are null will be substituted with jcifs.smb.client.domain, jcifs.smb.client.username, jcifs.smb.client.password property values.

NtowFv1 ( string password ) : byte[]
NtowFv2 ( string domain, string username, string password ) : byte[]
ToString ( ) : string

Return the domain and username in the format: domain\\username.

Return the domain and username in the format: domain\\username. This is equivalent to getName().

Приватные методы

Метод Описание
ComputeResponse ( byte responseKey, byte serverChallenge, byte clientData, int offset, int length ) : byte[]
E ( byte key, byte data, byte e ) : void
GetUserSessionKey ( byte challenge, byte dest, int offset ) : void

Calculates the effective user session key.

Calculates the effective user session key.

InitDefaults ( ) : void
Unescape ( string str ) : string

Описание методов

Equals() публичный Метод

Compares two NtlmPasswordAuthentication objects for equality.
Compares two NtlmPasswordAuthentication objects for equality. Two NtlmPasswordAuthentication objects are equal if their caseless domain and username fields are equal and either both hashes are external and they are equal or both internally supplied passwords are equal. If one NtlmPasswordAuthentication object has external hashes (meaning negotiated via NTLM HTTP Authentication) and the other does not they will not be equal. This is technically not correct however the server 8 byte challage would be required to compute and compare the password hashes but that it not available with this method.
public Equals ( object obj ) : bool
obj object
Результат bool

GetAnsiHash() публичный Метод

Computes the 24 byte ANSI password hash given the 8 byte server challenge.
Computes the 24 byte ANSI password hash given the 8 byte server challenge.
public GetAnsiHash ( byte challenge ) : byte[]
challenge byte
Результат byte[]

GetDomain() публичный Метод

Returns the domain.
Returns the domain.
public GetDomain ( ) : string
Результат string

GetHashCode() публичный Метод

Return the upcased username hash code.
Return the upcased username hash code.
public GetHashCode ( ) : int
Результат int

GetLMv2Response() публичный статический Метод

public static GetLMv2Response ( byte responseKeyLm, byte serverChallenge, byte clientChallenge ) : byte[]
responseKeyLm byte
serverChallenge byte
clientChallenge byte
Результат byte[]

GetLMv2Response() публичный статический Метод

Creates the LMv2 response for the supplied information.
Creates the LMv2 response for the supplied information.
public static GetLMv2Response ( string domain, string user, string password, byte challenge, byte clientChallenge ) : byte[]
domain string The domain in which the username exists.
user string The username.
password string The user's password.
challenge byte The server challenge.
clientChallenge byte The client challenge (nonce).
Результат byte[]

GetName() публичный Метод

Return the domain and username in the format: domain\\username.
Return the domain and username in the format: domain\\username. This is equivalent to toString().
public GetName ( ) : string
Результат string

GetNtlMv2Response() публичный статический Метод

public static GetNtlMv2Response ( byte responseKeyNt, byte serverChallenge, byte clientChallenge, long nanos1601, byte targetInfo ) : byte[]
responseKeyNt byte
serverChallenge byte
clientChallenge byte
nanos1601 long
targetInfo byte
Результат byte[]

GetNtlm2Response() публичный статический Метод

public static GetNtlm2Response ( byte nTowFv1, byte serverChallenge, byte clientChallenge ) : byte[]
nTowFv1 byte
serverChallenge byte
clientChallenge byte
Результат byte[]

GetNtlmResponse() публичный статический Метод

Generate the Unicode MD4 hash for the password associated with these credentials.
Generate the Unicode MD4 hash for the password associated with these credentials.
public static GetNtlmResponse ( string password, byte challenge ) : byte[]
password string
challenge byte
Результат byte[]

GetPassword() публичный Метод

Returns the password in plain text or null if the raw password hashes were used to construct this NtlmPasswordAuthentication object which will be the case when NTLM HTTP Authentication is used.
Returns the password in plain text or null if the raw password hashes were used to construct this NtlmPasswordAuthentication object which will be the case when NTLM HTTP Authentication is used. There is no way to retrieve a users password in plain text unless it is supplied by the user at runtime.
public GetPassword ( ) : string
Результат string

GetPreNtlmResponse() публичный статический Метод

Generate the ANSI DES hash for the password associated with these credentials.
Generate the ANSI DES hash for the password associated with these credentials.
public static GetPreNtlmResponse ( string password, byte challenge ) : byte[]
password string
challenge byte
Результат byte[]

GetSigningKey() публичный Метод

public GetSigningKey ( byte challenge ) : byte[]
challenge byte
Результат byte[]

GetUnicodeHash() публичный Метод

Computes the 24 byte Unicode password hash given the 8 byte server challenge.
Computes the 24 byte Unicode password hash given the 8 byte server challenge.
public GetUnicodeHash ( byte challenge ) : byte[]
challenge byte
Результат byte[]

GetUserSessionKey() публичный Метод

Returns the effective user session key.
Returns the effective user session key.
public GetUserSessionKey ( byte challenge ) : byte[]
challenge byte The server challenge.
Результат byte[]

GetUsername() публичный Метод

Returns the username.
Returns the username.
public GetUsername ( ) : string
Результат string

NtlmPasswordAuthentication() публичный Метод

Create an NtlmPasswordAuthentication object from the userinfo component of an SMB URL like "domain;user:pass".
Create an NtlmPasswordAuthentication object from the userinfo component of an SMB URL like "domain;user:pass". This constructor is used internally be jCIFS when parsing SMB URLs.
public NtlmPasswordAuthentication ( string userInfo ) : System
userInfo string
Результат System

NtlmPasswordAuthentication() публичный Метод

Create an NtlmPasswordAuthentication object with raw password hashes.
Create an NtlmPasswordAuthentication object with raw password hashes. This is used exclusively by the jcifs.http.NtlmSsp class which is in turn used by NTLM HTTP authentication functionality.
public NtlmPasswordAuthentication ( string domain, string username, byte challenge, byte ansiHash, byte unicodeHash ) : System
domain string
username string
challenge byte
ansiHash byte
unicodeHash byte
Результат System

NtlmPasswordAuthentication() публичный Метод

Create an NtlmPasswordAuthentication object from a domain, username, and password.
Create an NtlmPasswordAuthentication object from a domain, username, and password. Parameters that are null will be substituted with jcifs.smb.client.domain, jcifs.smb.client.username, jcifs.smb.client.password property values.
public NtlmPasswordAuthentication ( string domain, string username, string password ) : System
domain string
username string
password string
Результат System

NtowFv1() публичный статический Метод

public static NtowFv1 ( string password ) : byte[]
password string
Результат byte[]

NtowFv2() публичный статический Метод

public static NtowFv2 ( string domain, string username, string password ) : byte[]
domain string
username string
password string
Результат byte[]

ToString() публичный Метод

Return the domain and username in the format: domain\\username.
Return the domain and username in the format: domain\\username. This is equivalent to getName().
public ToString ( ) : string
Результат string

Описание свойств

Anonymous публичное статическое свойство

public static NtlmPasswordAuthentication,SharpCifs.Smb Anonymous
Результат NtlmPasswordAuthentication

additionalData публичное свойство

public Object additionalData
Результат Object