KNTLM Class Reference
KNTLM class implements the NTLM authentication protocol. More...
#include <kntlm.h>
Public Types | |
enum | Flags { Negotiate_Unicode = 0x00000001, Negotiate_OEM = 0x00000002, Request_Target = 0x00000004, Negotiate_Sign = 0x00000010, Negotiate_Seal = 0x00000020, Negotiate_Datagram_Style = 0x00000040, Negotiate_LM_Key = 0x00000080, Negotiate_Netware = 0x00000100, Negotiate_NTLM = 0x00000200, Negotiate_Domain_Supplied = 0x00001000, Negotiate_WS_Supplied = 0x00002000, Negotiate_Local_Call = 0x00004000, Negotiate_Always_Sign = 0x00008000, Target_Type_Domain = 0x00010000, Target_Type_Server = 0x00020000, Target_Type_Share = 0x00040000, Negotiate_NTLM2_Key = 0x00080000, Request_Init_Response = 0x00100000, Request_Accept_Response = 0x00200000, Request_NonNT_Key = 0x00400000, Negotiate_Target_Info = 0x00800000, Negotiate_128 = 0x20000000, Negotiate_Key_Exchange = 0x40000000, Negotiate_56 = 0x80000000 } |
Static Public Member Functions | |
bool | getNegotiate (QByteArray &negotiate, const QString &domain=QString::null, const QString &workstation=QString::null, Q_UINT32 flags=Negotiate_Unicode|Request_Target|Negotiate_NTLM) |
bool | getAuth (QByteArray &auth, const QByteArray &challenge, const QString &user, const QString &password, const QString &domain=QString::null, const QString &workstation=QString::null, bool forceNTLM=false, bool forceNTLMv2=false) |
QByteArray | getLMResponse (const QString &password, const unsigned char *challenge) |
QByteArray | lmHash (const QString &password) |
QByteArray | lmResponse (const QByteArray &hash, const unsigned char *challenge) |
QByteArray | getNTLMResponse (const QString &password, const unsigned char *challenge) |
QByteArray | ntlmHash (const QString &password) |
QByteArray | getNTLMv2Response (const QString &target, const QString &user, const QString &password, const QByteArray &targetInformation, const unsigned char *challenge) |
QByteArray | getLMv2Response (const QString &target, const QString &user, const QString &password, const unsigned char *challenge) |
QByteArray | ntlmv2Hash (const QString &target, const QString &user, const QString &password) |
QByteArray | lmv2Response (const QByteArray &hash, const QByteArray &clientData, const unsigned char *challenge) |
QString | getString (const QByteArray &buf, const SecBuf &secbuf, bool unicode) |
QByteArray | getBuf (const QByteArray &buf, const SecBuf &secbuf) |
QByteArray | createBlob (const QByteArray &targetinfo) |
QByteArray | hmacMD5 (const QByteArray &data, const QByteArray &key) |
Detailed Description
KNTLM class implements the NTLM authentication protocol.The KNTLM class is useful for creating the authentication structures which can be used for various servers which implements NTLM type authentication. A comprehensive description of the NTLM authentication protocol can be found at http://davenport.sourceforge.net/ntlm.html The class also contains methods to create the LanManager and NT (MD4) hashes of a password. This class doesn't maintain any state information, so all methods are static.
Definition at line 41 of file kntlm.h.
Member Function Documentation
|
Creates the initial message (type 1) which should be sent to the server.
Definition at line 87 of file kntlm.cpp. References getNegotiate(), QString::isEmpty(), and KFromToLittleEndian(). Referenced by getNegotiate(). |
|
Creates the type 3 message which should be sent to the server after the challenge (type 2) received.
Definition at line 107 of file kntlm.cpp. References KNTLM::Challenge::challengeData, KNTLM::Challenge::flags, getAuth(), getBuf(), getLMResponse(), getLMv2Response(), getNTLMResponse(), getNTLMv2Response(), getString(), QString::isEmpty(), KFromToLittleEndian(), KNTLM::Challenge::targetInfo, and KNTLM::Challenge::targetName. Referenced by getAuth(). |
|
Returns the LanManager response from the password and the server challenge.
Definition at line 168 of file kntlm.cpp. References getLMResponse(), lmHash(), and lmResponse(). Referenced by getAuth(), and getLMResponse(). |
|
Calculates the LanManager hash of the specified password.
Definition at line 180 of file kntlm.cpp. References lmHash(), and QString::upper(). Referenced by getLMResponse(), and lmHash(). |
|
Calculates the LanManager response from the LanManager hash and the server challenge.
Definition at line 202 of file kntlm.cpp. References lmResponse(). Referenced by getLMResponse(), getNTLMResponse(), and lmResponse(). |
|
Returns the NTLM response from the password and the server challenge.
Definition at line 220 of file kntlm.cpp. References getNTLMResponse(), lmResponse(), and ntlmHash(). Referenced by getAuth(), and getNTLMResponse(). |
|
Returns the NTLM hash (MD4) from the password.
Definition at line 232 of file kntlm.cpp. References KMD4::Digest, ntlmHash(), and KMD4::rawDigest(). Referenced by getNTLMResponse(), ntlmHash(), and ntlmv2Hash(). |
|
Calculates the NTLMv2 response.
Definition at line 244 of file kntlm.cpp. References getNTLMv2Response(), lmv2Response(), and ntlmv2Hash(). Referenced by getAuth(), and getNTLMv2Response(). |
|
Calculates the LMv2 response.
Definition at line 253 of file kntlm.cpp. References getLMv2Response(), lmv2Response(), ntlmv2Hash(), and KApplication::random(). Referenced by getAuth(), and getLMv2Response(). |
|
Returns the NTLMv2 hash.
Definition at line 264 of file kntlm.cpp. References ntlmHash(), ntlmv2Hash(), and QString::upper(). Referenced by getLMv2Response(), getNTLMv2Response(), and ntlmv2Hash(). |
|
Calculates the LMv2 response.
Definition at line 274 of file kntlm.cpp. References lmv2Response(). Referenced by getLMv2Response(), getNTLMv2Response(), and lmv2Response(). |
|
Extracts a string field from an NTLM structure.
Definition at line 35 of file kntlm.cpp. References getString(). Referenced by getAuth(), and getString(). |
|
Extracts a byte array from an NTLM structure.
Definition at line 52 of file kntlm.cpp. References getBuf(). |
The documentation for this class was generated from the following files: