From 87ea275a17cb98c61a42bb37413c54edcf16b7af Mon Sep 17 00:00:00 2001 From: HD Moore Date: Sun, 30 Aug 2009 01:57:25 +0000 Subject: [PATCH] Fixes #299 - corrects the win32 build environment and source to build properly again git-svn-id: file:///home/svn/framework3/trunk@6987 4d416f70-5f16-0410-b530-b9f4589650da --- .../source/client/remote_dispatch.c | 34 ------------------- .../common/arch/win/i386/base_dispatch.c | 5 +-- .../source/meterpreter/source/server/metsrv.c | 4 +-- .../meterpreter/source/server/server_setup.c | 9 +++-- .../workspace/common/common.vcproj | 5 +++ .../ext_server_boiler.vcproj | 2 +- .../ext_server_espia/ext_server_espia.vcproj | 2 +- .../ext_server_incognito.vcproj | 2 +- .../ext_server_priv/ext_server_priv.vcproj | 4 +-- .../ext_server_sniffer.vcproj | 3 +- .../ext_server_stdapi.vcproj | 5 +-- .../workspace/metcli/metcli.vcproj | 3 +- .../workspace/metsrv/metsrv.vcproj | 16 +++++++-- 13 files changed, 37 insertions(+), 57 deletions(-) diff --git a/external/source/meterpreter/source/client/remote_dispatch.c b/external/source/meterpreter/source/client/remote_dispatch.c index 54f58ca34c..50794d18b1 100644 --- a/external/source/meterpreter/source/client/remote_dispatch.c +++ b/external/source/meterpreter/source/client/remote_dispatch.c @@ -1,39 +1,5 @@ #include "metcli.h" -/* - * Process a request to print one or more strings - */ -DWORD remote_request_core_console_write(Remote *remote, Packet *packet) -{ - DWORD res = ERROR_NOT_FOUND; - DWORD index; - Tlv tlv; - - console_write_output("\n"); - - do - { - for (index = 0; - packet_enum_tlv(packet, index, TLV_TYPE_STRING, &tlv) - == ERROR_SUCCESS; - index++) - console_write_output("%s", (PCHAR)tlv.buffer); - - res = ERROR_SUCCESS; - - } while (0); - - fflush(stdout); - - console_write_prompt(); - - return res; -} - -DWORD remote_response_core_console_write(Remote *remote, Packet *packet) -{ - return ERROR_SUCCESS; -} /* * Extension callback for printing out notifications for channels opening diff --git a/external/source/meterpreter/source/common/arch/win/i386/base_dispatch.c b/external/source/meterpreter/source/common/arch/win/i386/base_dispatch.c index 49fa09712f..b116ebaa68 100644 --- a/external/source/meterpreter/source/common/arch/win/i386/base_dispatch.c +++ b/external/source/meterpreter/source/common/arch/win/i386/base_dispatch.c @@ -1,7 +1,4 @@ -#include "common.h" - -// include the PolarSSL library -#pragma comment(lib,"polarssl.lib") +#include "common.h" /* diff --git a/external/source/meterpreter/source/server/metsrv.c b/external/source/meterpreter/source/server/metsrv.c index 2e3cf9e3ae..fe04f0fce0 100644 --- a/external/source/meterpreter/source/server/metsrv.c +++ b/external/source/meterpreter/source/server/metsrv.c @@ -1,4 +1,4 @@ -#include "metsrv.h" +#include "metsrv.h" #ifdef _WIN32 @@ -29,4 +29,4 @@ DWORD __declspec(dllexport) Init(SOCKET fd, void *base) metsrv_rtld(fd, base); } -#endif +#endif \ No newline at end of file diff --git a/external/source/meterpreter/source/server/server_setup.c b/external/source/meterpreter/source/server/server_setup.c index 849387bff5..5076a90774 100644 --- a/external/source/meterpreter/source/server/server_setup.c +++ b/external/source/meterpreter/source/server/server_setup.c @@ -12,10 +12,10 @@ int exceptionfilter(unsigned int code, struct _EXCEPTION_POINTERS *ep) { return EXCEPTION_EXECUTE_HANDLER; -}^M +} #define InitAppInstance() do { \ - if( hAppInstance == NULL )^M \ + if( hAppInstance == NULL ) \ hAppInstance = GetModuleHandle( NULL ); \ } while (0) @@ -107,7 +107,7 @@ DWORD server_setup(SOCKET fd) // Flush all pending data on the connected socket before doing SSL static void flush_socket(Remote *remote) { - fd_set fdread, fdother ; + fd_set fdread; DWORD ret; SOCKET fd; unsigned char buff[4096]; @@ -140,7 +140,6 @@ static DWORD negotiate_ssl(Remote *remote) DWORD hres = ERROR_SUCCESS; SOCKET fd = remote_get_fd(remote); DWORD ret; - int serr; SSL_load_error_strings(); SSL_library_init(); @@ -158,7 +157,7 @@ static DWORD negotiate_ssl(Remote *remote) } - if ((serr = SSL_connect(remote->ssl)) != 1) { + if ((ret = SSL_connect(remote->ssl)) != 1) { printf("connect failed %d\n", SSL_get_error(remote->ssl, ret)); exit(1); } diff --git a/external/source/meterpreter/workspace/common/common.vcproj b/external/source/meterpreter/workspace/common/common.vcproj index 06c78f7474..b668aca436 100644 --- a/external/source/meterpreter/workspace/common/common.vcproj +++ b/external/source/meterpreter/workspace/common/common.vcproj @@ -43,6 +43,7 @@ + + diff --git a/external/source/meterpreter/workspace/ext_server_boiler/ext_server_boiler.vcproj b/external/source/meterpreter/workspace/ext_server_boiler/ext_server_boiler.vcproj index 4e7cf2f04d..b849af227e 100644 --- a/external/source/meterpreter/workspace/ext_server_boiler/ext_server_boiler.vcproj +++ b/external/source/meterpreter/workspace/ext_server_boiler/ext_server_boiler.vcproj @@ -141,7 +141,7 @@ AdditionalDependencies="metsrv.lib" OutputFile=".\Release/ext_server_boiler.dll" LinkIncremental="1" - AdditionalLibraryDirectories="..\metsrv\Release" + AdditionalLibraryDirectories="..\metsrv\Release; ;..\..\source\openssl\lib\win" GenerateManifest="false" DelayLoadDLLs="metsrv.dll" GenerateDebugInformation="false" diff --git a/external/source/meterpreter/workspace/ext_server_espia/ext_server_espia.vcproj b/external/source/meterpreter/workspace/ext_server_espia/ext_server_espia.vcproj index 46c4fcdbe5..de99d39679 100644 --- a/external/source/meterpreter/workspace/ext_server_espia/ext_server_espia.vcproj +++ b/external/source/meterpreter/workspace/ext_server_espia/ext_server_espia.vcproj @@ -142,7 +142,7 @@ AdditionalDependencies="Netapi32.lib Mpr.lib metsrv.lib" OutputFile=".\Release/ext_server_espia.dll" LinkIncremental="1" - AdditionalLibraryDirectories="..\metsrv\Release" + AdditionalLibraryDirectories="..\metsrv\Release;;..\..\source\openssl\lib\win" GenerateManifest="false" DelayLoadDLLs="metsrv.dll" GenerateDebugInformation="false" diff --git a/external/source/meterpreter/workspace/ext_server_incognito/ext_server_incognito.vcproj b/external/source/meterpreter/workspace/ext_server_incognito/ext_server_incognito.vcproj index 72ad610c2c..27c7fd5285 100644 --- a/external/source/meterpreter/workspace/ext_server_incognito/ext_server_incognito.vcproj +++ b/external/source/meterpreter/workspace/ext_server_incognito/ext_server_incognito.vcproj @@ -142,7 +142,7 @@ AdditionalDependencies="Netapi32.lib Mpr.lib metsrv.lib" OutputFile=".\Release/ext_server_incognito.dll" LinkIncremental="1" - AdditionalLibraryDirectories="..\metsrv\Release" + AdditionalLibraryDirectories="..\metsrv\Release;..\..\source\openssl\lib\win" GenerateManifest="false" DelayLoadDLLs="metsrv.dll" GenerateDebugInformation="false" diff --git a/external/source/meterpreter/workspace/ext_server_priv/ext_server_priv.vcproj b/external/source/meterpreter/workspace/ext_server_priv/ext_server_priv.vcproj index bca20c87b3..66c33b572a 100644 --- a/external/source/meterpreter/workspace/ext_server_priv/ext_server_priv.vcproj +++ b/external/source/meterpreter/workspace/ext_server_priv/ext_server_priv.vcproj @@ -81,7 +81,7 @@ OutputFile=".\Release/ext_server_priv.dll" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories="..\metsrv\Release" + AdditionalLibraryDirectories="..\metsrv\Release;..\..\source\openssl\lib\win" GenerateManifest="false" DelayLoadDLLs="metsrv.dll" ProgramDatabaseFile=".\Release/ext_server_priv.pdb" @@ -149,7 +149,7 @@ @@ -48,7 +49,7 @@ @@ -172,7 +173,7 @@ OutputFile=".\Release/metcli.exe" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories="..\common\Release; ..\..\source\openssl\lib" + AdditionalLibraryDirectories="..\common\Release; ..\..\source\openssl\lib\win" ModuleDefinitionFile="..\..\source\client\metcli.def" GenerateDebugInformation="true" ProgramDatabaseFile=".\Release/metcli.pdb" diff --git a/external/source/meterpreter/workspace/metsrv/metsrv.vcproj b/external/source/meterpreter/workspace/metsrv/metsrv.vcproj index 86cb747be2..fc9d193f0b 100644 --- a/external/source/meterpreter/workspace/metsrv/metsrv.vcproj +++ b/external/source/meterpreter/workspace/metsrv/metsrv.vcproj @@ -4,6 +4,7 @@ Version="9.00" Name="metsrv" ProjectGUID="{37E24F8F-1BD9-490B-8CD2-4768B89E5EAB}" + RootNamespace="metsrv" TargetFrameworkVersion="131072" > @@ -48,6 +49,7 @@ + + + +