File tree Expand file tree Collapse file tree
source/extensions/sniffer
workspace/ext_server_sniffer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,8 +35,13 @@ Command customCommands[] =
3535// include the Reflectiveloader() function, we end up linking back to the metsrv.dll's Init function
3636// but this doesnt matter as we wont ever call DLL_METASPLOIT_ATTACH as that is only used by the
3737// second stage reflective dll inject payload and not the metsrv itself when it loads extensions.
38- #define RDIDLL_NOEXPORT
39- #include "../../ReflectiveDLLInjection/dll/src/ReflectiveLoader.c"
38+ #ifndef NO_REFLECTIVE_LOADER
39+ #define RDIDLL_NOEXPORT
40+ #include "../../ReflectiveDLLInjection/dll/src/ReflectiveLoader.c"
41+ #else
42+ HINSTANCE hAppInstance = NULL ;
43+ #include "../../ReflectiveDLLInjection/dll/src/DirectSyscall.c"
44+ #endif
4045
4146#define check_pssdk (); if(!hMgr && pktsdk_initialize()!=0){ met_api->packet.transmit_response(hErr, remote, response);return(hErr); }
4247
Original file line number Diff line number Diff line change @@ -25,12 +25,12 @@ endif()
2525set (SRC_DIR ../../source/extensions/sniffer)
2626file (GLOB SRC_FILES
2727 ${SRC_DIR} /*.c
28- ${MOD_DEF_DIR} /extension.def
28+ ${EXTENSION_DEF_FILE}
2929)
3030add_library (${PROJECT_NAME } SHARED ${SRC_FILES} )
3131set_target_properties (${PROJECT_NAME } PROPERTIES OUTPUT_NAME ${PROJECT_NAME } .${TARGET_ARCH} )
32- set_target_properties (${PROJECT_NAME } PROPERTIES LINK_FLAGS "/DEF:\" ${MOD_DEF_DIR} /extension.def \" " )
33- set_source_files_properties (${MOD_DEF_DIR} /extension.def PROPERTIES HEADER_FILE_ONLY TRUE )
32+ set_target_properties (${PROJECT_NAME } PROPERTIES LINK_FLAGS "/DEF:\" ${EXTENSION_DEF_FILE} \" " )
33+ set_source_files_properties (${EXTENSION_DEF_FILE} PROPERTIES HEADER_FILE_ONLY TRUE )
3434
3535set (PSSDK_LIB_DIR ${PSSDK_DIR} /PSSDK_VC${PSSDK_VER} _LIB/_Libs)
3636if (IS_X64)
@@ -39,6 +39,10 @@ endif()
3939
4040set (LINK_LIBS ${PSSDK_LIB_DIR} /pssdk_vc${PSSDK_VER} _mt.lib ws2_32)
4141target_link_libraries (${PROJECT_NAME } ${LINK_LIBS} ${MET_RDI_ASM} )
42+
43+ if (EXCLUDE_REFLECTIVE_LOADER)
44+ target_compile_definitions (${PROJECT_NAME } PRIVATE NO_REFLECTIVE_LOADER )
45+ endif ()
4246if (MSVC )
4347 target_link_options (${PROJECT_NAME } PUBLIC "/ignore:4070" )
4448endif ()
You can’t perform that action at this time.
0 commit comments