#include <stdio.h>#include <unistd.h>#include <fcntl.h>#include <sys/socket.h>#include <sys/ioctl.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netdb.h>#include <pthread.h>#include <ctype.h>#include <time.h>#include <sys/timeb.h>#include "ntlm.h"


Go to the source code of this file.
Data Structures | |
| struct | RELAY |
Defines | |
| #define | _CRT_SECURE_NO_DEPRECATE |
| #define | SOCKET int |
| #define | _strnicmp strncasecmp |
| #define | closesocket close |
| #define | Sleep(a) sleep(a/1000) |
| #define | INVALID_SOCKET -1 |
| #define | CONNECT_TIMEOUT 10 |
| #define | SMBWAITTIMEOUT 5 |
| #define | DBG_DUMP_ROWS 16 |
Functions | |
| void | DumpMem (void *string, int length) |
| char * | ReadFileToSend (int *BackdoorFileSize, char *lpBackdoorFile) |
| int | ConnectToRemoteHost (RELAY *relay, char *hostname, int port) |
| int | SendBytesAndWaitForResponse (SOCKET destination, char *source, int nBytes, char *destinationBuffer, int MaxReadSize, int timeout) |
| void | WriteDataToReportFile (char *lpLogFileFilename, tSmbNtlmAuthResponse *NtlmAuthResponse, char *SourceIpAddress, unsigned char *challenge) |
| void | CleanLine (int verbose) |
| void | usage (void) |
| void | Banner (void) |
| #define _strnicmp strncasecmp |
| #define closesocket close |
Definition at line 31 of file misc.h.
Referenced by HandleIncommingSmbRequest(), and ReplayAttackAgainst().
| #define CONNECT_TIMEOUT 10 |
| #define INVALID_SOCKET -1 |
| #define Sleep | ( | a | ) | sleep(a/1000) |
| #define SMBWAITTIMEOUT 5 |
Definition at line 51 of file misc.h.
Referenced by AttackWeakServices(), ExecuteCode(), GetSmbPacket2(), HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), HandleIncommingSmbRequest(), HandleIncommingSMTPRequest(), StablishNTLMSession(), and WriteRemoteFile().
| #define SOCKET int |
| int ConnectToRemoteHost | ( | RELAY * | relay, | |
| char * | hostname, | |||
| int | port | |||
| ) |
Definition at line 225 of file misc.cpp.
References CONNECT_TIMEOUT, RELAY::destination, RELAY::destinationaddr, and RELAY::hostname.
Referenced by HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), HandleIncommingSmbRequest(), HandleIncommingSMTPRequest(), and main().
| void DumpMem | ( | void * | string, | |
| int | length | |||
| ) |
Definition at line 9 of file misc.cpp.
References DBG_DUMP_ROWS.
Referenced by BuildSmbPacket1(), ExecuteCode(), HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), HandleIncommingSmbRequest(), HandleIncommingSMTPRequest(), SendBytesAndWaitForResponse(), StablishNTLMSession(), and WriteRemoteFile().
| char* ReadFileToSend | ( | int * | BackdoorFileSize, | |
| char * | lpBackdoorFile | |||
| ) |
| int SendBytesAndWaitForResponse | ( | SOCKET | destination, | |
| char * | source, | |||
| int | nBytes, | |||
| char * | destinationBuffer, | |||
| int | MaxReadSize, | |||
| int | timeout | |||
| ) |
Definition at line 280 of file misc.cpp.
References debug, and DumpMem().
Referenced by AttackWeakServices(), ExecuteCode(), GetSmbPacket2(), HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), HandleIncommingSmbRequest(), HandleIncommingSMTPRequest(), StablishNTLMSession(), and WriteRemoteFile().

| void WriteDataToReportFile | ( | char * | lpLogFileFilename, | |
| tSmbNtlmAuthResponse * | NtlmAuthResponse, | |||
| char * | SourceIpAddress, | |||
| unsigned char * | challenge | |||
| ) |
Definition at line 336 of file misc.cpp.
References GetNTLMPacketInfo(), tSmbNtlmAuthResponse::lmResponse, tSmbNtlmAuthResponse::ntResponse, and tSmbStrHeader::offset.

1.5.4