C:/Web/smbrelay3/src/smb.cpp File Reference

#include "ntlm.h"
#include "smb.h"
#include "misc.h"

Include dependency graph for smb.cpp:

Go to the source code of this file.

Defines

#define _CRT_SECURE_NO_DEPRECATE

Functions

void SetEnviroment (uint16 sessionUserID, uint16 sessionTreeID, uint16 sessionFID)
int InitDataBlock (DataBlock *block, char *data)
int CreateServiceWStub (char *destionation, char *ContextHandle, char *ServiceName, char *ServiceDescription, char *path, int StartType, int ServiceType)
int ChangeServiceConfigWStub (char *destionation, char *ContextHandle, char *path, int StartType, int ServiceType)
int OpenServiceWStub (char *destionation, char *ContextHandle, char *servicename, int flags)
int OpenScManagerWStub (char *destionation, char *data, int flags)
int BuildTreeConnectAndXStub (char *destination, char *password, char *resource, char *service)
char * AddDialect (char *data, char *name, uint8 type, int *PacketSize)
smheaderBuildSmbPacket (smheader *PreviousSmbMessage, uint8 SmbCommand, uint8 SubCommand, void *data, int DataSize)

Variables

uint16 UserID = 0
uint16 MultpleID = 0


Define Documentation

#define _CRT_SECURE_NO_DEPRECATE

Definition at line 22 of file smb.cpp.


Function Documentation

char* AddDialect ( char *  data,
char *  name,
uint8  type,
int *  PacketSize 
)

Definition at line 175 of file smb.cpp.

Referenced by HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), HandleIncommingSmbRequest(), HandleIncommingSMTPRequest(), and StablishNTLMSession().

smheader* BuildSmbPacket ( smheader PreviousSmbMessage,
uint8  SmbCommand,
uint8  SubCommand,
void *  data,
int  DataSize 
)

Definition at line 218 of file smb.cpp.

References smheader::buffer, chartoWide(), CONTINUERESPONSE, ERRORRESPONSE, FINDFIRST2, MultpleID, NEGOTIATEPROTOCOLREQUEST, NTCREATEANDX, READANDX, RPCBIND, SESSIONSETUPANDX, SMB_COM_CHECK_DIRECTORY, SMB_COM_CLOSE_AND_TREE_DISC, SMB_COM_CLOSE_PRINT_FILE, SMB_COM_COPY, SMB_COM_CREATE, SMB_COM_CREATE_DIRECTORY, SMB_COM_CREATE_NEW, SMB_COM_CREATE_TEMPORARY, SMB_COM_DELETE, SMB_COM_DELETE_DIRECTORY, SMB_COM_ECHO, SMB_COM_FIND, SMB_COM_FIND_CLOSE2, SMB_COM_FIND_NOTIFY_CLOSE, SMB_COM_FIND_UNIQUE, SMB_COM_FLUSH, SMB_COM_GET_PRINT_QUEUE, SMB_COM_IOCTL, SMB_COM_IOCTL_SECONDARY, SMB_COM_LOCK_AND_READ, SMB_COM_LOCK_BYTE_RANGE, SMB_COM_LOCKING_ANDX, SMB_COM_LOGOFF_ANDX, SMB_COM_MOVE, SMB_COM_NT_CANCEL, SMB_COM_NT_TRANSACT, SMB_COM_NT_TRANSACT_SECONDARY, SMB_COM_OPEN, SMB_COM_OPEN_ANDX, SMB_COM_OPEN_PRINT_FILE, SMB_COM_PROCESS_EXIT, SMB_COM_QUERY_INFORMATION, SMB_COM_QUERY_INFORMATION2, SMB_COM_QUERY_INFORMATION_DISK, SMB_COM_READ, SMB_COM_READ_BULK, SMB_COM_READ_MPX, SMB_COM_READ_MPX_SECONDARY, SMB_COM_READ_RAW, SMB_COM_RENAME, SMB_COM_SEARCH, SMB_COM_SEEK, SMB_COM_SET_INFORMATION, SMB_COM_SET_INFORMATION2, SMB_COM_TRANSACTION, SMB_COM_TRANSACTION2_SECONDARY, SMB_COM_TRANSACTION_SECONDARY, SMB_COM_TREE_CONNECT, SMB_COM_TREE_DISCONNECT, SMB_COM_UNLOCK_BYTE_RANGE, SMB_COM_WRITE, SMB_COM_WRITE_AND_CLOSE, SMB_COM_WRITE_AND_UNLOCK, SMB_COM_WRITE_BULK, SMB_COM_WRITE_BULK_DATA, SMB_COM_WRITE_COMPLETE, SMB_COM_WRITE_MPX, SMB_COM_WRITE_PRINT_FILE, SMB_COM_WRITE_RAW, SMBCLOSE, SREV, STATUS_BAD_NETWORK_NAME, TREECONNETANDX, smheader::UserID, UserID, and WRITEANDX.

Referenced by AttackWeakServices(), BuildSmbPacket1(), ExecuteCode(), GetSmbPacket3(), HandleIncommingHTTPRequest(), HandleIncommingIMAPRequest(), HandleIncommingPOP3Request(), HandleIncommingSmbRequest(), HandleIncommingSMTPRequest(), StablishNTLMSession(), and WriteRemoteFile().

Here is the call graph for this function:

int BuildTreeConnectAndXStub ( char *  destination,
char *  password,
char *  resource,
char *  service 
)

Definition at line 156 of file smb.cpp.

References TreeConnectAndX::AndXCommand, TreeConnectAndX::AndXOffset, smheader::buffer, TreeConnectAndX::ByteCount, chartoWide(), TreeConnectAndX::flags, TreeConnectAndX::Password, TreeConnectAndX::PasswordLen, TreeConnectAndX::reserved2, and TreeConnectAndX::WordCount.

Referenced by ExecuteCode(), and WriteRemoteFile().

Here is the call graph for this function:

int ChangeServiceConfigWStub ( char *  destionation,
char *  ContextHandle,
char *  path,
int  StartType,
int  ServiceType 
)

Definition at line 82 of file smb.cpp.

References chartoWide().

Referenced by AttackWeakServices().

Here is the call graph for this function:

int CreateServiceWStub ( char *  destionation,
char *  ContextHandle,
char *  ServiceName,
char *  ServiceDescription,
char *  path,
int  StartType,
int  ServiceType 
)

Definition at line 48 of file smb.cpp.

References InitDataBlock().

Referenced by ExecuteCode().

Here is the call graph for this function:

int InitDataBlock ( DataBlock block,
char *  data 
)

Definition at line 39 of file smb.cpp.

References chartoWide(), DataBlock::data, DataBlock::Lenght, DataBlock::MaxLenHigh, and DataBlock::MaxLenLow.

Referenced by CreateServiceWStub(), and OpenServiceWStub().

Here is the call graph for this function:

int OpenScManagerWStub ( char *  destionation,
char *  data,
int  flags 
)

Definition at line 125 of file smb.cpp.

References MSCStruct::AccessMask, MSCStruct::ActualCount, chartoWide(), MSCStruct::Database, MSCStruct::lpFileNameW, MSCStruct::MaxCount, MSCStruct::Offset, and MSCStruct::ReferentID.

Referenced by AttackWeakServices(), and ExecuteCode().

Here is the call graph for this function:

int OpenServiceWStub ( char *  destionation,
char *  ContextHandle,
char *  servicename,
int  flags 
)

Definition at line 99 of file smb.cpp.

References InitDataBlock().

Referenced by AttackWeakServices(), and ExecuteCode().

Here is the call graph for this function:

void SetEnviroment ( uint16  sessionUserID,
uint16  sessionTreeID,
uint16  sessionFID 
)

Definition at line 33 of file smb.cpp.

References UserID.

Referenced by StablishNTLMSession().


Variable Documentation

uint16 MultpleID = 0

Definition at line 31 of file smb.cpp.

Referenced by BuildSmbPacket(), and HandleIncommingSmbRequest().

uint16 UserID = 0

Definition at line 30 of file smb.cpp.

Referenced by BuildSmbPacket(), SetEnviroment(), and StablishNTLMSession().


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