C:/Web/smbrelay3/src/misc.h File Reference

#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"

Include dependency graph for misc.h:

This graph shows which files directly or indirectly include this file:

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 Documentation

#define _CRT_SECURE_NO_DEPRECATE

Definition at line 7 of file misc.h.

#define _strnicmp   strncasecmp

Definition at line 30 of file misc.h.

Referenced by GetHeaderValue().

#define closesocket   close

Definition at line 31 of file misc.h.

Referenced by HandleIncommingSmbRequest(), and ReplayAttackAgainst().

#define CONNECT_TIMEOUT   10

Definition at line 50 of file misc.h.

Referenced by ConnectToRemoteHost().

#define DBG_DUMP_ROWS   16

Definition at line 52 of file misc.h.

Referenced by DumpMem().

#define INVALID_SOCKET   -1

Definition at line 33 of file misc.h.

Referenced by ReplayAttackAgainst().

#define Sleep (  )     sleep(a/1000)

Definition at line 32 of file misc.h.

Referenced by AttackWeakServices(), and ExecuteCode().

#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

Definition at line 29 of file misc.h.

Referenced by ReplayAttackAgainst().


Function Documentation

void Banner ( void   ) 

Definition at line 380 of file misc.cpp.

Referenced by main().

void CleanLine ( int  verbose  ) 

Definition at line 373 of file misc.cpp.

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 
)

Definition at line 73 of file misc.cpp.

Referenced by WriteRemoteFile().

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().

Here is the call graph for this function:

void usage ( void   ) 

Definition at line 387 of file misc.cpp.

Referenced by main().

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.

Here is the call graph for this function:


Generated on Wed Nov 12 22:04:28 2008 for Smbrelay version 3 by  doxygen 1.5.4