#include <assert.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <unistd.h>


Go to the source code of this file.
Data Structures | |
| struct | tSmbStrItem |
| struct | NtlmV2Packet |
| struct | tSmbStrHeader |
| struct | tSmbNtlmAuthRequest |
| struct | tSmbNtlmAuthChallenge |
| struct | tSmbNtlmAuthResponse |
Defines | |
| #define | _strdup strdup |
| #define | SERVERNAMEITEM 0x01 |
| #define | DOMAINNAMEITEM 0x02 |
| #define | DNSITEM 0x03 |
| #define | FQDNITEM 0x04 |
| #define | NtlmChallengeSize(Challenge) ( sizeof(tSmbNtlmAuthChallenge) - sizeof(Challenge->buffer) +Challenge->uDomain.maxlen + Challenge->emptyString.maxlen) |
| #define | SmbLength(ptr) (((ptr)->buffer - (uint8*)(ptr)) + (ptr)->bufIndex) |
Typedefs | |
| typedef unsigned short | uint16 |
| typedef unsigned int | uint32 |
| typedef unsigned long long int | uint64 |
| typedef unsigned char | uint8 |
Functions | |
| void | BuildAuthRequest (tSmbNtlmAuthRequest *request, long flags, char *host, char *domain) |
| void | BuildAuthChallenge (tSmbNtlmAuthChallenge *pChallenge, char *DomainName, char *ServerName, char *DNS, char *FQDN, uint8 flags, uint8 *SpoofedChallenge) |
| void | buildAuthResponse (tSmbNtlmAuthChallenge *challenge, tSmbNtlmAuthResponse *response, long flags, char *user, char *password, char *domainname, char *host, tSmbNtlmAuthResponse *OptionalNtlmPacket3) |
| __inline void | SetChallengeKey (tSmbNtlmAuthChallenge *challenge, uint8 *SpoofedChallenge) |
| int | from64tobits (char *out, const char *in) |
| void | to64frombits (unsigned char *out, const unsigned char *in, int inlen) |
| void | dumpAuthRequest (FILE *fp, tSmbNtlmAuthRequest *request) |
| void | dumpAuthChallenge (FILE *fp, tSmbNtlmAuthChallenge *challenge) |
| void | dumpAuthResponse (FILE *fp, tSmbNtlmAuthResponse *response) |
| void | GetNTLMPacketInfo (tSmbNtlmAuthResponse *NtlmAuthResponse, char *UserName, char *DomainName, char *WorkstationName, int verbose) |
| void | chartoWide (char *destination, char *source, int len) |
| void | Widetochar (char *destination, char *source, int len) |
| #define DNSITEM 0x03 |
| #define DOMAINNAMEITEM 0x02 |
| #define FQDNITEM 0x04 |
| #define NtlmChallengeSize | ( | Challenge | ) | ( sizeof(tSmbNtlmAuthChallenge) - sizeof(Challenge->buffer) +Challenge->uDomain.maxlen + Challenge->emptyString.maxlen) |
| #define SERVERNAMEITEM 0x01 |
| #define SmbLength | ( | ptr | ) | (((ptr)->buffer - (uint8*)(ptr)) + (ptr)->bufIndex) |
Definition at line 215 of file ntlm.h.
Referenced by BuildSmbPacket1(), GetSmbPacket3(), HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), and HandleIncommingSMTPRequest().
| void BuildAuthChallenge | ( | tSmbNtlmAuthChallenge * | pChallenge, | |
| char * | DomainName, | |||
| char * | ServerName, | |||
| char * | DNS, | |||
| char * | FQDN, | |||
| uint8 | flags, | |||
| uint8 * | SpoofedChallenge | |||
| ) |
Definition at line 1437 of file ntlm.cpp.
References tSmbStrItem::buffer, tSmbNtlmAuthChallenge::buffer, tSmbNtlmAuthChallenge::challengeData, chartoWide(), DNSITEM, DOMAINNAMEITEM, tSmbNtlmAuthChallenge::emptyString, tSmbNtlmAuthChallenge::flags, FQDNITEM, tSmbNtlmAuthChallenge::ident, tSmbStrItem::ItemLength, tSmbStrItem::ItemType, tSmbStrHeader::len, tSmbStrHeader::maxlen, tSmbNtlmAuthChallenge::msgType, tSmbStrHeader::offset, tSmbNtlmAuthChallenge::reserved, SERVERNAMEITEM, and tSmbNtlmAuthChallenge::uDomain.

| void BuildAuthRequest | ( | tSmbNtlmAuthRequest * | request, | |
| long | flags, | |||
| char * | host, | |||
| char * | domain | |||
| ) |
| void buildAuthResponse | ( | tSmbNtlmAuthChallenge * | challenge, | |
| tSmbNtlmAuthResponse * | response, | |||
| long | flags, | |||
| char * | user, | |||
| char * | password, | |||
| char * | domainname, | |||
| char * | host, | |||
| tSmbNtlmAuthResponse * | OptionalNtlmPacket3 | |||
| ) |
Definition at line 1298 of file ntlm.cpp.
Referenced by GetSmbPacket3(), HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), and HandleIncommingSMTPRequest().
| void chartoWide | ( | char * | destination, | |
| char * | source, | |||
| int | len | |||
| ) |
Definition at line 1417 of file ntlm.cpp.
Referenced by BuildAuthChallenge(), BuildSmbPacket(), BuildTreeConnectAndXStub(), ChangeServiceConfigWStub(), InitDataBlock(), and OpenScManagerWStub().
| void dumpAuthChallenge | ( | FILE * | fp, | |
| tSmbNtlmAuthChallenge * | challenge | |||
| ) |
Definition at line 1511 of file ntlm.cpp.
Referenced by HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), HandleIncommingSmbRequest(), HandleIncommingSMTPRequest(), and StablishNTLMSession().
| void dumpAuthRequest | ( | FILE * | fp, | |
| tSmbNtlmAuthRequest * | request | |||
| ) |
Definition at line 1391 of file ntlm.cpp.
References tSmbNtlmAuthRequest::ident, IVAL, and tSmbNtlmAuthRequest::msgType.
Referenced by HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), and HandleIncommingSMTPRequest().
| void dumpAuthResponse | ( | FILE * | fp, | |
| tSmbNtlmAuthResponse * | response | |||
| ) |
Definition at line 1591 of file ntlm.cpp.
Referenced by HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), and HandleIncommingSMTPRequest().
| int from64tobits | ( | char * | out, | |
| const char * | in | |||
| ) |
Definition at line 1695 of file ntlm.cpp.
Referenced by HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), and HandleIncommingSMTPRequest().
| void GetNTLMPacketInfo | ( | tSmbNtlmAuthResponse * | NtlmAuthResponse, | |
| char * | UserName, | |||
| char * | DomainName, | |||
| char * | WorkstationName, | |||
| int | verbose | |||
| ) |
Definition at line 1622 of file ntlm.cpp.
Referenced by HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), HandleIncommingSMTPRequest(), and WriteDataToReportFile().
| __inline void SetChallengeKey | ( | tSmbNtlmAuthChallenge * | challenge, | |
| uint8 * | SpoofedChallenge | |||
| ) |
| void to64frombits | ( | unsigned char * | out, | |
| const unsigned char * | in, | |||
| int | inlen | |||
| ) |
Definition at line 1669 of file ntlm.cpp.
Referenced by HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), and HandleIncommingSMTPRequest().
| void Widetochar | ( | char * | destination, | |
| char * | source, | |||
| int | len | |||
| ) |
1.5.4