diff --git a/beacon/CMakeLists.txt b/beacon/CMakeLists.txt index 6954d3d..345f91f 100644 --- a/beacon/CMakeLists.txt +++ b/beacon/CMakeLists.txt @@ -3,7 +3,6 @@ set(C2CORE_BEACON_COMMON_SOURCES ../listener/Listener.cpp ../listener/ListenerTcp.cpp ../listener/ListenerSmb.cpp - ../../thirdParty/base64/base64.cpp ) set(C2CORE_BEACON_COMMON_LINK_LIBS @@ -11,6 +10,7 @@ set(C2CORE_BEACON_COMMON_LINK_LIBS PipeHandler MemoryModule SocksServer + c2_base64 ) set(C2CORE_BEACON_HTTP_LINK_LIBS) diff --git a/beacon/tests/CMakeLists.txt b/beacon/tests/CMakeLists.txt index 1d896ec..fb7ee46 100644 --- a/beacon/tests/CMakeLists.txt +++ b/beacon/tests/CMakeLists.txt @@ -17,8 +17,7 @@ add_executable(beacon_unit_tests ../Beacon.cpp ../../listener/Listener.cpp ../../listener/ListenerTcp.cpp - ../../listener/ListenerSmb.cpp - ../../../thirdParty/base64/base64.cpp) + ../../listener/ListenerSmb.cpp) target_link_libraries(beacon_unit_tests Catch2::Catch2WithMain @@ -27,7 +26,8 @@ target_link_libraries(beacon_unit_tests SocketHandler PipeHandler MemoryModule - SocksServer) + SocksServer + c2_base64) add_test(NAME beacon_unit_tests COMMAND beacon_unit_tests) @@ -38,8 +38,7 @@ add_executable(testBeaconDns ../BeaconDns.cpp ../../listener/Listener.cpp ../../listener/ListenerTcp.cpp - ../../listener/ListenerSmb.cpp - ../../../thirdParty/base64/base64.cpp) + ../../listener/ListenerSmb.cpp) target_link_libraries(testBeaconDns nlohmann_json::nlohmann_json @@ -47,7 +46,8 @@ target_link_libraries(testBeaconDns Dnscommunication PipeHandler MemoryModule - SocksServer) + SocksServer + c2_base64) add_test(NAME testBeaconDns COMMAND testBeaconDns) @@ -57,8 +57,7 @@ add_executable(testBeaconGithub ../BeaconGithub.cpp ../../listener/Listener.cpp ../../listener/ListenerTcp.cpp - ../../listener/ListenerSmb.cpp - ../../../thirdParty/base64/base64.cpp) + ../../listener/ListenerSmb.cpp) target_link_libraries(testBeaconGithub nlohmann_json::nlohmann_json @@ -66,6 +65,7 @@ target_link_libraries(testBeaconGithub PipeHandler MemoryModule SocksServer + c2_base64 ${C2CORE_BEACON_TEST_HTTP_LINK_LIBS}) add_test(NAME testBeaconGithub COMMAND testBeaconGithub) @@ -76,8 +76,7 @@ add_executable(testBeaconHttp ../BeaconHttp.cpp ../../listener/Listener.cpp ../../listener/ListenerTcp.cpp - ../../listener/ListenerSmb.cpp - ../../../thirdParty/base64/base64.cpp) + ../../listener/ListenerSmb.cpp) target_link_libraries(testBeaconHttp nlohmann_json::nlohmann_json @@ -85,6 +84,7 @@ target_link_libraries(testBeaconHttp PipeHandler MemoryModule SocksServer + c2_base64 ${C2CORE_BEACON_TEST_HTTP_LINK_LIBS}) add_test(NAME testBeaconHttp COMMAND testBeaconHttp) @@ -95,15 +95,15 @@ add_executable(testBeaconSmb ../BeaconSmb.cpp ../../listener/Listener.cpp ../../listener/ListenerTcp.cpp - ../../listener/ListenerSmb.cpp - ../../../thirdParty/base64/base64.cpp) + ../../listener/ListenerSmb.cpp) target_link_libraries(testBeaconSmb nlohmann_json::nlohmann_json SocketHandler PipeHandler MemoryModule - SocksServer) + SocksServer + c2_base64) add_test(NAME testBeaconSmb COMMAND testBeaconSmb) @@ -113,14 +113,14 @@ add_executable(testBeaconTcp ../BeaconTcp.cpp ../../listener/Listener.cpp ../../listener/ListenerTcp.cpp - ../../listener/ListenerSmb.cpp - ../../../thirdParty/base64/base64.cpp) + ../../listener/ListenerSmb.cpp) target_link_libraries(testBeaconTcp nlohmann_json::nlohmann_json SocketHandler PipeHandler MemoryModule - SocksServer) + SocksServer + c2_base64) add_test(NAME testBeaconTcp COMMAND testBeaconTcp) diff --git a/listener/tests/CMakeLists.txt b/listener/tests/CMakeLists.txt index 24b764b..38a62ac 100644 --- a/listener/tests/CMakeLists.txt +++ b/listener/tests/CMakeLists.txt @@ -1,6 +1,5 @@ include_directories(..) include_directories(../../modules/ModuleCmd) -include_directories(../../thirdParty/base64) if(BUILD_TEAMSERVER) set(additionalLib "spdlog::spdlog") @@ -11,13 +10,13 @@ endif() # Unit tests using Catch2 add_executable(listener_unit_tests testListener.cpp - ../Listener.cpp - ../../thirdParty/base64/base64.cpp) + ../Listener.cpp) target_link_libraries(listener_unit_tests Catch2::Catch2WithMain Catch2::Catch2 nlohmann_json::nlohmann_json + c2_base64 ${additionalLib}) add_test(NAME listener_unit_tests COMMAND listener_unit_tests) @@ -26,32 +25,28 @@ add_test(NAME listener_unit_tests COMMAND listener_unit_tests) add_executable(testListenerDns testListenerDns.cpp ../Listener.cpp - ../ListenerDns.cpp - ../../thirdParty/base64/base64.cpp) -target_link_libraries(testListenerDns nlohmann_json::nlohmann_json Dnscommunication ${additionalLib}) + ../ListenerDns.cpp) +target_link_libraries(testListenerDns nlohmann_json::nlohmann_json Dnscommunication c2_base64 ${additionalLib}) add_test(NAME testListenerDns COMMAND testListenerDns) add_executable(testListenerGithub testListenerGithub.cpp ../Listener.cpp - ../ListenerGithub.cpp - ../../thirdParty/base64/base64.cpp) -target_link_libraries(testListenerGithub nlohmann_json::nlohmann_json openssl::openssl httplib::httplib ${additionalLib}) + ../ListenerGithub.cpp) +target_link_libraries(testListenerGithub nlohmann_json::nlohmann_json openssl::openssl httplib::httplib c2_base64 ${additionalLib}) add_test(NAME testListenerGithub COMMAND testListenerGithub) add_executable(testListenerSmb testListenerSmb.cpp ../Listener.cpp - ../ListenerSmb.cpp - ../../thirdParty/base64/base64.cpp) -target_link_libraries(testListenerSmb nlohmann_json::nlohmann_json PipeHandler ${additionalLib}) + ../ListenerSmb.cpp) +target_link_libraries(testListenerSmb nlohmann_json::nlohmann_json PipeHandler c2_base64 ${additionalLib}) add_test(NAME testListenerSmb COMMAND testListenerSmb) add_executable(testListenerTcp testListenerTcp.cpp ../Listener.cpp - ../ListenerTcp.cpp - ../../thirdParty/base64/base64.cpp) -target_link_libraries(testListenerTcp nlohmann_json::nlohmann_json SocketHandler ${additionalLib}) + ../ListenerTcp.cpp) +target_link_libraries(testListenerTcp nlohmann_json::nlohmann_json SocketHandler c2_base64 ${additionalLib}) add_test(NAME testListenerTcp COMMAND testListenerTcp) diff --git a/modules/ModuleCmd/CMakeLists.txt b/modules/ModuleCmd/CMakeLists.txt index 480d72c..493f7ac 100644 --- a/modules/ModuleCmd/CMakeLists.txt +++ b/modules/ModuleCmd/CMakeLists.txt @@ -1,14 +1,13 @@ if(C2CORE_BUILD_TESTS) - include_directories(../../../thirdParty/base64) - add_executable(testsModuleCmd tests/testsModuleCmd.cpp ../../../thirdParty/base64/base64.cpp) - target_link_libraries(testsModuleCmd nlohmann_json::nlohmann_json) + add_executable(testsModuleCmd tests/testsModuleCmd.cpp) + target_link_libraries(testsModuleCmd nlohmann_json::nlohmann_json c2_base64) add_custom_command(TARGET testsModuleCmd POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ "${C2_TEST_BIN_OUTPUT_DIR}/$") add_test(NAME testsModuleCmd COMMAND "${C2_TEST_BIN_OUTPUT_DIR}/$") - add_executable(testsTools tests/testsTools.cpp ../../../thirdParty/base64/base64.cpp) - target_link_libraries(testsTools nlohmann_json::nlohmann_json) + add_executable(testsTools tests/testsTools.cpp) + target_link_libraries(testsTools nlohmann_json::nlohmann_json c2_base64) add_custom_command(TARGET testsTools POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ "${C2_TEST_BIN_OUTPUT_DIR}/$") add_test(NAME testsTools COMMAND "${C2_TEST_BIN_OUTPUT_DIR}/$") @@ -26,4 +25,4 @@ if(C2CORE_BUILD_TESTS) $ "${C2_TEST_BIN_OUTPUT_DIR}/$") add_test(NAME testsHwbp COMMAND "${C2_TEST_BIN_OUTPUT_DIR}/$") endif() -endif() \ No newline at end of file +endif()