mirror of
https://github.com/maxDcb/C2Core
synced 2026-06-08 15:48:01 +00:00
Change logger
This commit is contained in:
+12
-12
@@ -12,9 +12,9 @@ set(SOURCES_BEACON_HTTP_EXE
|
||||
|
||||
add_executable(BeaconHttp ${SOURCES_BEACON_HTTP_EXE} project.rc)
|
||||
if(WIN32)
|
||||
target_link_libraries(BeaconHttp SocketHandler PipeHandler MemoryModule)
|
||||
target_link_libraries(BeaconHttp SocketHandler PipeHandler MemoryModule spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(BeaconHttp SocketHandler PipeHandler MemoryModule openssl::openssl boost::boost)
|
||||
target_link_libraries(BeaconHttp SocketHandler PipeHandler MemoryModule openssl::openssl boost::boost spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
add_custom_command(TARGET BeaconHttp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:BeaconHttp> "${CMAKE_SOURCE_DIR}/Release/Beacons/$<TARGET_FILE_NAME:BeaconHttp>")
|
||||
@@ -31,9 +31,9 @@ set(SOURCES_BEACON_HTTP_DLL
|
||||
|
||||
add_library(BeaconHttpDll SHARED ${SOURCES_BEACON_HTTP_DLL})
|
||||
if(WIN32)
|
||||
target_link_libraries(BeaconHttpDll SocketHandler PipeHandler MemoryModule)
|
||||
target_link_libraries(BeaconHttpDll SocketHandler PipeHandler MemoryModule spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(BeaconHttpDll SocketHandler PipeHandler MemoryModule openssl::openssl boost::boost)
|
||||
target_link_libraries(BeaconHttpDll SocketHandler PipeHandler MemoryModule openssl::openssl boost::boost spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
add_custom_command(TARGET BeaconHttpDll POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:BeaconHttpDll> "${CMAKE_SOURCE_DIR}/Release/Beacons/$<TARGET_FILE_NAME:BeaconHttpDll>")
|
||||
@@ -51,9 +51,9 @@ set(SOURCES_BEACON_TCP_EXE
|
||||
|
||||
add_executable(BeaconTcp ${SOURCES_BEACON_TCP_EXE})
|
||||
if(WIN32)
|
||||
target_link_libraries(BeaconTcp SocketHandler PipeHandler MemoryModule)
|
||||
target_link_libraries(BeaconTcp SocketHandler PipeHandler MemoryModule spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(BeaconTcp SocketHandler PipeHandler MemoryModule boost::boost)
|
||||
target_link_libraries(BeaconTcp SocketHandler PipeHandler MemoryModule boost::boost spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
add_custom_command(TARGET BeaconTcp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:BeaconTcp> "${CMAKE_SOURCE_DIR}/Release/Beacons/$<TARGET_FILE_NAME:BeaconTcp>")
|
||||
@@ -71,9 +71,9 @@ set(SOURCES_BEACON_SMB_EXE
|
||||
|
||||
add_executable(BeaconSmb ${SOURCES_BEACON_SMB_EXE})
|
||||
if(WIN32)
|
||||
target_link_libraries(BeaconSmb SocketHandler PipeHandler MemoryModule)
|
||||
target_link_libraries(BeaconSmb SocketHandler PipeHandler MemoryModule spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(BeaconSmb SocketHandler PipeHandler MemoryModule boost::boost)
|
||||
target_link_libraries(BeaconSmb SocketHandler PipeHandler MemoryModule boost::boost spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
add_custom_command(TARGET BeaconSmb POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:BeaconSmb> "${CMAKE_SOURCE_DIR}/Release/Beacons/$<TARGET_FILE_NAME:BeaconSmb>")
|
||||
@@ -91,9 +91,9 @@ set(SOURCES_BEACON_GITHUB_EXE
|
||||
|
||||
add_executable(BeaconGithub ${SOURCES_BEACON_GITHUB_EXE})
|
||||
if(WIN32)
|
||||
target_link_libraries(BeaconGithub SocketHandler PipeHandler MemoryModule)
|
||||
target_link_libraries(BeaconGithub SocketHandler PipeHandler MemoryModule spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(BeaconGithub SocketHandler PipeHandler MemoryModule openssl::openssl boost::boost)
|
||||
target_link_libraries(BeaconGithub SocketHandler PipeHandler MemoryModule openssl::openssl boost::boost spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
add_custom_command(TARGET BeaconGithub POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:BeaconGithub> "${CMAKE_SOURCE_DIR}/Release/Beacons/$<TARGET_FILE_NAME:BeaconGithub>")
|
||||
@@ -111,9 +111,9 @@ set(SOURCES_BEACON_DNS_EXE
|
||||
|
||||
add_executable(BeaconDns ${SOURCES_BEACON_DNS_EXE})
|
||||
if(WIN32)
|
||||
target_link_libraries(BeaconDns Dnscommunication SocketHandler PipeHandler MemoryModule)
|
||||
target_link_libraries(BeaconDns Dnscommunication SocketHandler PipeHandler MemoryModule spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(BeaconDns Dnscommunication SocketHandler PipeHandler MemoryModule boost::boost)
|
||||
target_link_libraries(BeaconDns Dnscommunication SocketHandler PipeHandler MemoryModule boost::boost spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
add_custom_command(TARGET BeaconDns POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:BeaconDns> "${CMAKE_SOURCE_DIR}/Release/Beacons/$<TARGET_FILE_NAME:BeaconDns>")
|
||||
|
||||
@@ -14,9 +14,9 @@ testBeacon.cpp
|
||||
../../listener/ListenerSmb.cpp
|
||||
../../../thirdParty/base64/base64.cpp)
|
||||
IF (WIN32)
|
||||
target_link_libraries(testBeacon SocketHandler PipeHandler MemoryModule)
|
||||
target_link_libraries(testBeacon SocketHandler PipeHandler MemoryModule spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
ELSE()
|
||||
target_link_libraries(testBeacon SocketHandler PipeHandler MemoryModule boost::boost)
|
||||
target_link_libraries(testBeacon SocketHandler PipeHandler MemoryModule boost::boost spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
ENDIF()
|
||||
add_custom_command(TARGET testBeacon POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testBeacon> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testBeacon>")
|
||||
@@ -29,7 +29,11 @@ testBeaconDns.cpp
|
||||
../../listener/ListenerTcp.cpp
|
||||
../../listener/ListenerSmb.cpp
|
||||
../../../thirdParty/base64/base64.cpp)
|
||||
target_link_libraries(testBeaconDns SocketHandler Dnscommunication PipeHandler MemoryModule)
|
||||
IF (WIN32)
|
||||
target_link_libraries(testBeaconDns SocketHandler PipeHandler MemoryModule spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
ELSE()
|
||||
target_link_libraries(testBeaconDns SocketHandler Dnscommunication PipeHandler MemoryModule boost::boost spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
ENDIF()
|
||||
add_custom_command(TARGET testBeaconDns POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testBeaconDns> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testBeaconDns>")
|
||||
add_test(NAME testBeaconDns COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testBeaconDns>")
|
||||
@@ -41,7 +45,11 @@ testBeaconGithub.cpp
|
||||
../../listener/ListenerTcp.cpp
|
||||
../../listener/ListenerSmb.cpp
|
||||
../../../thirdParty/base64/base64.cpp)
|
||||
target_link_libraries(testBeaconGithub SocketHandler PipeHandler MemoryModule)
|
||||
IF (WIN32)
|
||||
target_link_libraries(testBeaconGithub SocketHandler PipeHandler MemoryModule spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
ELSE()
|
||||
target_link_libraries(testBeaconGithub SocketHandler PipeHandler MemoryModule boost::boost spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
ENDIF()
|
||||
add_custom_command(TARGET testBeaconGithub POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testBeaconGithub> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testBeaconGithub>")
|
||||
add_test(NAME testBeaconGithub COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testBeaconGithub>")
|
||||
@@ -53,7 +61,11 @@ testBeaconHttp.cpp
|
||||
../../listener/ListenerTcp.cpp
|
||||
../../listener/ListenerSmb.cpp
|
||||
../../../thirdParty/base64/base64.cpp)
|
||||
target_link_libraries(testBeaconHttp SocketHandler PipeHandler MemoryModule)
|
||||
IF (WIN32)
|
||||
target_link_libraries(testBeaconHttp SocketHandler PipeHandler MemoryModule spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
ELSE()
|
||||
target_link_libraries(testBeaconHttp SocketHandler PipeHandler MemoryModule boost::boost spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
ENDIF()
|
||||
add_custom_command(TARGET testBeaconHttp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testBeaconHttp> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testBeaconHttp>")
|
||||
add_test(NAME testBeaconHttp COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testBeaconHttp>")
|
||||
@@ -65,7 +77,11 @@ testBeaconSmb.cpp
|
||||
../../listener/ListenerTcp.cpp
|
||||
../../listener/ListenerSmb.cpp
|
||||
../../../thirdParty/base64/base64.cpp)
|
||||
target_link_libraries(testBeaconSmb SocketHandler PipeHandler MemoryModule)
|
||||
IF (WIN32)
|
||||
target_link_libraries(testBeaconSmb SocketHandler PipeHandler MemoryModule spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
ELSE()
|
||||
target_link_libraries(testBeaconSmb SocketHandler PipeHandler MemoryModule boost::boost spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
ENDIF()
|
||||
add_custom_command(TARGET testBeaconSmb POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testBeaconSmb> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testBeaconSmb>")
|
||||
add_test(NAME testBeaconSmb COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testBeaconSmb>")
|
||||
@@ -77,7 +93,11 @@ testBeaconTcp.cpp
|
||||
../../listener/ListenerTcp.cpp
|
||||
../../listener/ListenerSmb.cpp
|
||||
../../../thirdParty/base64/base64.cpp)
|
||||
target_link_libraries(testBeaconTcp SocketHandler PipeHandler MemoryModule)
|
||||
IF (WIN32)
|
||||
target_link_libraries(testBeaconTcp SocketHandler PipeHandler MemoryModule spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
ELSE()
|
||||
target_link_libraries(testBeaconTcp SocketHandler PipeHandler MemoryModule boost::boost spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
ENDIF()
|
||||
add_custom_command(TARGET testBeaconTcp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testBeaconTcp> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testBeaconTcp>")
|
||||
add_test(NAME testBeaconTcp COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testBeaconTcp>")
|
||||
|
||||
@@ -328,7 +328,10 @@ bool Listener::handleMessages(const std::string& input, std::string& output)
|
||||
bool SessionExist = isSessionExist(beaconHash, listenerhash);
|
||||
if(SessionExist==false)
|
||||
{
|
||||
DEBUG("beaconHash " << beaconHash << " listenerhash " << listenerhash);
|
||||
|
||||
#if defined(BUILD_TEAMSERVER) || defined(BUILD_TESTS)
|
||||
SPDLOG_DEBUG("beaconHash {0}, listenerhash {0}", beaconHash, listenerhash);
|
||||
#endif
|
||||
|
||||
std::string username = bundleC2Message->username();
|
||||
std::string hostname = bundleC2Message->hostname();
|
||||
|
||||
@@ -9,6 +9,12 @@
|
||||
#include "Session.hpp"
|
||||
#include "Common.hpp"
|
||||
|
||||
#ifdef BUILD_TEAMSERVER
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "spdlog/sinks/stdout_color_sinks.h"
|
||||
#include "spdlog/sinks/rotating_file_sink.h"
|
||||
#include "spdlog/sinks/basic_file_sink.h"
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
@@ -91,6 +97,5 @@ protected:
|
||||
std::vector<std::shared_ptr<Session>> m_sessions;
|
||||
|
||||
private:
|
||||
std::mutex m_mutex;
|
||||
|
||||
std::mutex m_mutex;
|
||||
};
|
||||
|
||||
+16
-23
@@ -1,12 +1,5 @@
|
||||
#include "ListenerGithub.hpp"
|
||||
|
||||
#include <boost/log/core.hpp>
|
||||
#include <boost/log/trivial.hpp>
|
||||
#include <boost/log/expressions.hpp>
|
||||
|
||||
namespace logging = boost::log;
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace httplib;
|
||||
using json = nlohmann::json;
|
||||
@@ -62,13 +55,13 @@ void ListenerGithub::checkGithubIssues()
|
||||
auto err = response.error();
|
||||
if(err!=httplib::Error::Success)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "Http client Get " << httplib::to_string(err);
|
||||
SPDLOG_ERROR("Http client Get {0}", httplib::to_string(err));
|
||||
continue;
|
||||
}
|
||||
|
||||
if(response->status!=200 && response->status!=201)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "Error with the ListenerGithub: " << response->body;
|
||||
SPDLOG_ERROR("Error with the ListenerGithub: {0}", response->body);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -86,10 +79,10 @@ void ListenerGithub::checkGithubIssues()
|
||||
|
||||
if(nbComments!=0)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(debug) << "Issue with comments: " << std::to_string(number) << std::endl;;
|
||||
SPDLOG_DEBUG("Issue with comments: {0}", std::to_string(number));
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "[+] handle issue: " << std::to_string(number);
|
||||
SPDLOG_TRACE("[+] handle issue: {0}", std::to_string(number));
|
||||
|
||||
if(title.rfind("ResponseC2: ", 0) == 0)
|
||||
{
|
||||
@@ -122,7 +115,7 @@ void ListenerGithub::checkGithubIssues()
|
||||
chunks.push_back(res.substr(i, maxChunkSize));
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(debug) << "Split response of " << chunks.size() << " chunks" << std::endl;
|
||||
SPDLOG_DEBUG("Split response of {0} chunks", chunks.size());
|
||||
|
||||
nlohmann::json responseData = {
|
||||
{"title", reponseTitle},
|
||||
@@ -137,15 +130,15 @@ void ListenerGithub::checkGithubIssues()
|
||||
err = response.error();
|
||||
if(err!=httplib::Error::Success)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "Http client Post Issue " << httplib::to_string(err);
|
||||
SPDLOG_ERROR("Http client Post Issue {0}", httplib::to_string(err));
|
||||
continue;
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Issue created " << response->status << std::endl;
|
||||
SPDLOG_TRACE("Issue created {0}", response->status);
|
||||
|
||||
if(response->status!=200 && response->status!=201)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "Error with the ListenerGithub: " << response->body;
|
||||
SPDLOG_ERROR("Error with the ListenerGithub: {0}", response->body);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -171,13 +164,13 @@ void ListenerGithub::checkGithubIssues()
|
||||
err = response.error();
|
||||
if(err!=httplib::Error::Success)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "Http client Post Comments" << httplib::to_string(err);
|
||||
SPDLOG_ERROR("Http client Post Comments {0}", httplib::to_string(err));
|
||||
continue;
|
||||
}
|
||||
|
||||
if(response->status!=200 && response->status!=201)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "Error with the ListenerGithub: " << response->body;
|
||||
SPDLOG_ERROR("Error with the ListenerGithub: {0}", response->body);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -199,13 +192,13 @@ void ListenerGithub::checkGithubIssues()
|
||||
err = response.error();
|
||||
if(err!=httplib::Error::Success)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "Http client Post " << httplib::to_string(err);
|
||||
SPDLOG_ERROR("Http client Post {0}", httplib::to_string(err));
|
||||
continue;
|
||||
}
|
||||
|
||||
if(response->status!=200 && response->status!=201)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "Error with the ListenerGithub: " << response->body;
|
||||
SPDLOG_ERROR("Error with the ListenerGithub: {0}", response->body);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -224,7 +217,7 @@ void ListenerGithub::checkGithubIssues()
|
||||
err = response.error();
|
||||
if(err!=httplib::Error::Success)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "Http client Post close " << httplib::to_string(err);
|
||||
SPDLOG_ERROR("Http client Post close {0}", httplib::to_string(err));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -238,7 +231,7 @@ void ListenerGithub::checkGithubIssues()
|
||||
|
||||
int ListenerGithub::HandleCheckIn(const std::string& req, std::string& output)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(trace) << "HandleCheckIn";
|
||||
SPDLOG_TRACE("HandleCheckIn");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -246,11 +239,11 @@ int ListenerGithub::HandleCheckIn(const std::string& req, std::string& output)
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "HandleCheckIn catch exception";
|
||||
SPDLOG_ERROR("HandleCheckIn catch exception");
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "HandleCheckIn catch...";
|
||||
SPDLOG_ERROR("HandleCheckIn catch...");
|
||||
}
|
||||
|
||||
|
||||
|
||||
+27
-31
@@ -1,12 +1,5 @@
|
||||
#include "ListenerHttp.hpp"
|
||||
|
||||
#include <boost/log/core.hpp>
|
||||
#include <boost/log/trivial.hpp>
|
||||
#include <boost/log/expressions.hpp>
|
||||
|
||||
namespace logging = boost::log;
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace httplib;
|
||||
using json = nlohmann::json;
|
||||
@@ -52,7 +45,7 @@ ListenerHttp::ListenerHttp(const std::string& ip, int localPort, const nlohmann:
|
||||
}
|
||||
catch (const json::out_of_range)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(fatal) << "No ServHttpsListenerCrtFile or ServHttpsListenerKeyFile in config.";
|
||||
SPDLOG_CRITICAL("No ServHttpsListenerCrtFile or ServHttpsListenerKeyFile in config.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -89,14 +82,17 @@ void ListenerHttp::lauchHttpServ()
|
||||
if(it != m_config[0].end())
|
||||
downloadFolder = m_config[0]["downloadFolder"].get<std::string>();;
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << "uriFileDownload " << uriFileDownload;
|
||||
BOOST_LOG_TRIVIAL(info) << "downloadFolder " << downloadFolder;
|
||||
SPDLOG_INFO("uriFileDownload {0}", uriFileDownload);
|
||||
SPDLOG_INFO("downloadFolder {0}", downloadFolder);
|
||||
for (json::iterator it = uri.begin(); it != uri.end(); ++it)
|
||||
BOOST_LOG_TRIVIAL(info) << "uri " << *it;
|
||||
{
|
||||
std::string uriTmp = *it;
|
||||
SPDLOG_INFO("uri {0}", uriTmp);
|
||||
}
|
||||
}
|
||||
catch (const json::out_of_range)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(fatal) << "No uri in config.";
|
||||
SPDLOG_CRITICAL("No uri in config.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -117,7 +113,7 @@ void ListenerHttp::lauchHttpServ()
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "Unauthorized connection " << req.path;
|
||||
SPDLOG_INFO("Unauthorized connection {0}", req.path);
|
||||
res.status = 401;
|
||||
return Server::HandlerResponse::Handled;
|
||||
}
|
||||
@@ -129,18 +125,18 @@ void ListenerHttp::lauchHttpServ()
|
||||
{
|
||||
try
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "Post connection: " << req.path;
|
||||
SPDLOG_INFO("Post connection: {0}", req.path);
|
||||
this->HandleCheckIn(req, res);
|
||||
res.status = 200;
|
||||
}
|
||||
catch(const std::exception& ex)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "Execption " << ex.what();
|
||||
SPDLOG_INFO("Execption {0}", ex.what());
|
||||
res.status = 401;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "Unknown failure occurred.";
|
||||
SPDLOG_INFO("Unknown failure occurred.");
|
||||
res.status = 401;
|
||||
}
|
||||
});
|
||||
@@ -151,7 +147,7 @@ void ListenerHttp::lauchHttpServ()
|
||||
{
|
||||
try
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "Get connection: " << req.path;
|
||||
SPDLOG_INFO("Get connection: {0}", req.path);
|
||||
if (req.has_header("Authorization"))
|
||||
{
|
||||
// jwt should contained Bearer b64data.b6data.beaconData
|
||||
@@ -170,24 +166,24 @@ void ListenerHttp::lauchHttpServ()
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "Get: invalide JWT";
|
||||
SPDLOG_INFO("Get: invalide JWT");
|
||||
res.status = 401;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "Get: no Authorization header";
|
||||
SPDLOG_INFO("Get: no Authorization header");
|
||||
res.status = 401;
|
||||
}
|
||||
}
|
||||
catch(const std::exception& ex)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "Execption " << ex.what();
|
||||
SPDLOG_INFO("Execption {0}", ex.what());
|
||||
res.status = 401;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "Unknown failure occurred.";
|
||||
SPDLOG_INFO("Unknown failure occurred.");
|
||||
res.status = 401;
|
||||
}
|
||||
});
|
||||
@@ -199,7 +195,7 @@ void ListenerHttp::lauchHttpServ()
|
||||
fileDownloadReg+=":filename";
|
||||
m_svr->Get(fileDownloadReg, [&](const Request& req, Response& res)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "File server connection: " << req.path;
|
||||
SPDLOG_INFO("File server connection: {0}", req.path);
|
||||
|
||||
std::string filename = req.path_params.at("filename");
|
||||
std::string filePath = downloadFolder;
|
||||
@@ -216,7 +212,7 @@ void ListenerHttp::lauchHttpServ()
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "File server: File not found.";
|
||||
SPDLOG_INFO("File server: File not found.");
|
||||
res.status = 404;
|
||||
}
|
||||
});
|
||||
@@ -230,8 +226,8 @@ int ListenerHttp::HandleCheckIn(const httplib::Request& req, httplib::Response&
|
||||
{
|
||||
string input = req.body;
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "m_isHttps " << std::to_string(m_isHttps);
|
||||
BOOST_LOG_TRIVIAL(trace) << "input.size " << std::to_string(input.size());
|
||||
SPDLOG_TRACE("m_isHttps {0}", std::to_string(m_isHttps));
|
||||
SPDLOG_TRACE("input.size {0}", std::to_string(input.size()));
|
||||
|
||||
string output;
|
||||
bool ret = handleMessages(input, output);
|
||||
@@ -244,7 +240,7 @@ int ListenerHttp::HandleCheckIn(const httplib::Request& req, httplib::Response&
|
||||
}
|
||||
catch (const json::out_of_range)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(fatal) << "No server headers in config.";
|
||||
SPDLOG_CRITICAL("No server headers in config.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -253,7 +249,7 @@ int ListenerHttp::HandleCheckIn(const httplib::Request& req, httplib::Response&
|
||||
httpServerHeaders.insert({(it).key(), (it).value()});
|
||||
res.headers = httpServerHeaders;
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "output.size " << std::to_string(output.size());
|
||||
SPDLOG_TRACE("output.size {0}", std::to_string(output.size()));
|
||||
|
||||
if(ret)
|
||||
res.body = output;
|
||||
@@ -266,8 +262,8 @@ int ListenerHttp::HandleCheckIn(const httplib::Request& req, httplib::Response&
|
||||
|
||||
int ListenerHttp::HandleCheckIn(const std::string& requestData, httplib::Response& res)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(trace) << "m_isHttps " << std::to_string(m_isHttps);
|
||||
BOOST_LOG_TRIVIAL(trace) << "requestData.size " << std::to_string(requestData.size());
|
||||
SPDLOG_TRACE("m_isHttps {0}", std::to_string(m_isHttps));
|
||||
SPDLOG_TRACE("requestData.size {0}", std::to_string(requestData.size()));
|
||||
|
||||
string output;
|
||||
bool ret = handleMessages(requestData, output);
|
||||
@@ -280,7 +276,7 @@ int ListenerHttp::HandleCheckIn(const std::string& requestData, httplib::Respons
|
||||
}
|
||||
catch (const json::out_of_range)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(fatal) << "No server headers in config.";
|
||||
SPDLOG_CRITICAL("No server headers in config.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -289,7 +285,7 @@ int ListenerHttp::HandleCheckIn(const std::string& requestData, httplib::Respons
|
||||
httpServerHeaders.insert({(it).key(), (it).value()});
|
||||
res.headers = httpServerHeaders;
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "output.size " << std::to_string(output.size());
|
||||
SPDLOG_TRACE("output.size {0}", std::to_string(output.size()));
|
||||
|
||||
if(ret)
|
||||
res.body = output;
|
||||
|
||||
@@ -7,6 +7,11 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
add_executable(testListener testListener.cpp)
|
||||
if(WIN32)
|
||||
|
||||
else()
|
||||
target_link_libraries(testListener spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
add_custom_command(TARGET testListener POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testListener> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testListener>")
|
||||
add_test(NAME testListener COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testListener>")
|
||||
@@ -15,19 +20,31 @@ IF (WIN32)
|
||||
ELSE()
|
||||
|
||||
add_executable(testListenerDns testListenerDns.cpp)
|
||||
target_link_libraries(testListenerDns Dnscommunication)
|
||||
if(WIN32)
|
||||
target_link_libraries(testListenerDns Dnscommunication spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(testListenerDns Dnscommunication spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
add_custom_command(TARGET testListenerDns POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testListenerDns> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testListenerDns>")
|
||||
add_test(NAME testListenerDns COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testListenerDns>")
|
||||
|
||||
add_executable(testListenerGithub testListenerGithub.cpp)
|
||||
target_link_libraries(testListenerGithub openssl::openssl)
|
||||
if(WIN32)
|
||||
target_link_libraries(testListenerGithub openssl::openssl spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(testListenerGithub openssl::openssl spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
add_custom_command(TARGET testListenerGithub POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testListenerGithub> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testListenerGithub>")
|
||||
add_test(NAME testListenerGithub COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testListenerGithub>")
|
||||
|
||||
add_executable(testListenerHttp testListenerHttp.cpp)
|
||||
target_link_libraries(testListenerHttp openssl::openssl)
|
||||
if(WIN32)
|
||||
target_link_libraries(testListenerHttp openssl::openssl spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(testListenerHttp openssl::openssl spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
add_custom_command(TARGET testListenerHttp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testListenerHttp> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testListenerHttp>")
|
||||
add_test(NAME testListenerHttp COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testListenerHttp>")
|
||||
@@ -35,13 +52,21 @@ add_test(NAME testListenerHttp COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_
|
||||
ENDIF()
|
||||
|
||||
add_executable(testListenerSmb testListenerSmb.cpp)
|
||||
target_link_libraries(testListenerSmb PipeHandler)
|
||||
if(WIN32)
|
||||
target_link_libraries(testListenerSmb PipeHandler spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(testListenerSmb PipeHandler spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
add_custom_command(TARGET testListenerSmb POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testListenerSmb> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testListenerSmb>")
|
||||
add_test(NAME testListenerSmb COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testListenerSmb>")
|
||||
|
||||
add_executable(testListenerTcp testListenerTcp.cpp)
|
||||
target_link_libraries(testListenerTcp SocketHandler)
|
||||
if(WIN32)
|
||||
target_link_libraries(testListenerTcp SocketHandler spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(testListenerTcp SocketHandler spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
add_custom_command(TARGET testListenerTcp POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testListenerTcp> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testListenerTcp>")
|
||||
add_test(NAME testListenerTcp COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testListenerTcp>")
|
||||
|
||||
@@ -2,7 +2,7 @@ include_directories(../)
|
||||
add_library(AssemblyExec SHARED AssemblyExec.cpp)
|
||||
if(WITH_TESTS)
|
||||
message(STATUS "[+] AssemblyExec Tests are enable.")
|
||||
target_link_libraries(AssemblyExec ${Donut})
|
||||
target_link_libraries(AssemblyExec ${Donut} spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
message(STATUS "[-] AssemblyExec Tests are disable.")
|
||||
endif()
|
||||
@@ -13,9 +13,9 @@ if(WITH_TESTS)
|
||||
add_executable(testsAssemblyExec tests/testsAssemblyExec.cpp AssemblyExec.cpp)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(testsAssemblyExec ${Donut} )
|
||||
target_link_libraries(testsAssemblyExec ${Donut} spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(testsAssemblyExec ${Donut} ${aplib64} )
|
||||
target_link_libraries(testsAssemblyExec ${Donut} ${aplib64} spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
|
||||
add_custom_command(TARGET testsAssemblyExec POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(Cat SHARED Cat.cpp)
|
||||
target_link_libraries(Cat spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET Cat POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:Cat> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:Cat>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsCat tests/testsCat.cpp Cat.cpp)
|
||||
target_link_libraries(testsCat)
|
||||
add_custom_command(TARGET testsCat POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsCat> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsCat>")
|
||||
add_executable(testsCat tests/testsCat.cpp Cat.cpp)
|
||||
target_link_libraries(testsCat spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsCat POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsCat> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsCat>")
|
||||
|
||||
add_test(NAME testsCat COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsCat>")
|
||||
add_test(NAME testsCat COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsCat>")
|
||||
endif()
|
||||
@@ -1,12 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(ChangeDirectory SHARED ChangeDirectory.cpp)
|
||||
target_link_libraries(ChangeDirectory spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET ChangeDirectory POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:ChangeDirectory> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:ChangeDirectory>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsChangeDirectory tests/testsChangeDirectory.cpp ChangeDirectory.cpp)
|
||||
add_custom_command(TARGET testsChangeDirectory POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsChangeDirectory> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsChangeDirectory>")
|
||||
add_executable(testsChangeDirectory tests/testsChangeDirectory.cpp ChangeDirectory.cpp)
|
||||
target_link_libraries(testsChangeDirectory spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsChangeDirectory POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsChangeDirectory> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsChangeDirectory>")
|
||||
|
||||
add_test(NAME testsChangeDirectory COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsChangeDirectory>")
|
||||
add_test(NAME testsChangeDirectory COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsChangeDirectory>")
|
||||
endif()
|
||||
@@ -2,7 +2,7 @@ include_directories(../)
|
||||
add_library(Chisel SHARED Chisel.cpp)
|
||||
if(WITH_TESTS)
|
||||
message(STATUS "[+] Chisel Tests are enable.")
|
||||
target_link_libraries(Chisel ${Donut})
|
||||
target_link_libraries(Chisel ${Donut} spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
message(STATUS "[-] Chisel Tests are disable.")
|
||||
endif()
|
||||
@@ -13,9 +13,9 @@ if(WITH_TESTS)
|
||||
add_executable(testsChisel tests/testsChisel.cpp Chisel.cpp)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(testsChisel ${Donut} )
|
||||
target_link_libraries(testsChisel ${Donut} spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(testsChisel ${Donut} ${aplib64} )
|
||||
target_link_libraries(testsChisel ${Donut} ${aplib64} spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
|
||||
add_custom_command(TARGET testsChisel POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
@@ -23,3 +23,4 @@ $<TARGET_FILE:testsChisel> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsCh
|
||||
|
||||
add_test(NAME testsChisel COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsChisel>")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(Coff SHARED CoffLoader.cpp)
|
||||
target_link_libraries(Coff CoffLoader CoffPacker)
|
||||
target_link_libraries(Coff CoffLoader CoffPacker spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET Coff POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:Coff> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:Coff>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsCoffLoader tests/testsCoffLoader.cpp CoffLoader.cpp)
|
||||
target_link_libraries(testsCoffLoader CoffLoader CoffPacker)
|
||||
add_custom_command(TARGET testsCoffLoader POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsCoffLoader> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsCoffLoader>")
|
||||
add_executable(testsCoffLoader tests/testsCoffLoader.cpp CoffLoader.cpp)
|
||||
target_link_libraries(testsCoffLoader CoffLoader CoffPacker spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsCoffLoader POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsCoffLoader> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsCoffLoader>")
|
||||
|
||||
add_test(NAME testsCoffLoader COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsCoffLoader>")
|
||||
add_test(NAME testsCoffLoader COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsCoffLoader>")
|
||||
endif()
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(Download SHARED Download.cpp)
|
||||
target_link_libraries(Download spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET Download POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:Download> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:Download>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsDownload tests/testsDownload.cpp Download.cpp)
|
||||
target_link_libraries(testsDownload)
|
||||
add_custom_command(TARGET testsDownload POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsDownload> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsDownload>")
|
||||
add_executable(testsDownload tests/testsDownload.cpp Download.cpp)
|
||||
target_link_libraries(testsDownload spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsDownload POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsDownload> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsDownload>")
|
||||
|
||||
add_test(NAME testsDownload COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsDownload>")
|
||||
add_test(NAME testsDownload COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsDownload>")
|
||||
endif()
|
||||
@@ -1,14 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(Evasion SHARED Evasion.cpp)
|
||||
target_link_libraries(Evasion)
|
||||
target_link_libraries(Evasion spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET Evasion POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:Evasion> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:Evasion>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsEvasion tests/testsEvasion.cpp Evasion.cpp)
|
||||
target_link_libraries(testsEvasion)
|
||||
add_custom_command(TARGET testsEvasion POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsEvasion> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsEvasion>")
|
||||
add_executable(testsEvasion tests/testsEvasion.cpp Evasion.cpp)
|
||||
target_link_libraries(testsEvasion spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsEvasion POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsEvasion> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsEvasion>")
|
||||
|
||||
add_test(NAME testsEvasion COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsEvasion>")
|
||||
endif()
|
||||
add_test(NAME testsEvasion COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsEvasion>")
|
||||
endif()
|
||||
|
||||
@@ -2,7 +2,7 @@ include_directories(../)
|
||||
add_library(Inject SHARED Inject.cpp)
|
||||
if(WITH_TESTS)
|
||||
message(STATUS "[+] Inject Tests are enable.")
|
||||
target_link_libraries(Inject ${Donut})
|
||||
target_link_libraries(Inject ${Donut} spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
message(STATUS "[-] Inject Tests are disable.")
|
||||
endif()
|
||||
@@ -13,9 +13,9 @@ if(WITH_TESTS)
|
||||
add_executable(testsInject tests/testsInject.cpp Inject.cpp)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(testsInject ${Donut} )
|
||||
target_link_libraries(testsInject ${Donut} spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(testsInject ${Donut} ${aplib64} )
|
||||
target_link_libraries(testsInject ${Donut} ${aplib64} spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
|
||||
add_custom_command(TARGET testsInject POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(KerberosUseTicket SHARED KerberosUseTicket.cpp)
|
||||
target_link_libraries(KerberosUseTicket spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET KerberosUseTicket POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:KerberosUseTicket> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:KerberosUseTicket>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsKerberosUseTicket tests/testsKerberosUseTicket.cpp KerberosUseTicket.cpp)
|
||||
target_link_libraries(testsKerberosUseTicket)
|
||||
add_custom_command(TARGET testsKerberosUseTicket POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsKerberosUseTicket> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsKerberosUseTicket>")
|
||||
add_executable(testsKerberosUseTicket tests/testsKerberosUseTicket.cpp KerberosUseTicket.cpp)
|
||||
target_link_libraries(testsKerberosUseTicket spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsKerberosUseTicket POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsKerberosUseTicket> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsKerberosUseTicket>")
|
||||
|
||||
add_test(NAME testsKerberosUseTicket COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsKerberosUseTicket>")
|
||||
add_test(NAME testsKerberosUseTicket COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsKerberosUseTicket>")
|
||||
endif()
|
||||
@@ -1,11 +1,12 @@
|
||||
include_directories(../)
|
||||
add_library(ListDirectory SHARED ListDirectory.cpp)
|
||||
target_link_libraries(ListDirectory spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET ListDirectory POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:ListDirectory> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:ListDirectory>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsListDirectory tests/testsListDirectory.cpp ListDirectory.cpp)
|
||||
target_link_libraries(testsListDirectory)
|
||||
target_link_libraries(testsListDirectory spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsListDirectory POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsListDirectory> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsListDirectory>")
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(ListProcesses SHARED ListProcesses.cpp)
|
||||
target_link_libraries(ListProcesses spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET ListProcesses POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:ListProcesses> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:ListProcesses>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsListProcesses tests/testsListProcesses.cpp ListProcesses.cpp)
|
||||
target_link_libraries(testsListProcesses)
|
||||
add_custom_command(TARGET testsListProcesses POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsListProcesses> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsListProcesses>")
|
||||
add_executable(testsListProcesses tests/testsListProcesses.cpp ListProcesses.cpp)
|
||||
target_link_libraries(testsListProcesses spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsListProcesses POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsListProcesses> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsListProcesses>")
|
||||
|
||||
add_test(NAME testsListProcesses COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsListProcesses>")
|
||||
add_test(NAME testsListProcesses COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsListProcesses>")
|
||||
endif()
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(MakeToken SHARED MakeToken.cpp)
|
||||
target_link_libraries(MakeToken spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET MakeToken POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:MakeToken> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:MakeToken>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsMakeToken tests/testsMakeToken.cpp MakeToken.cpp)
|
||||
target_link_libraries(testsMakeToken)
|
||||
add_custom_command(TARGET testsMakeToken POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsMakeToken> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsMakeToken>")
|
||||
add_executable(testsMakeToken tests/testsMakeToken.cpp MakeToken.cpp)
|
||||
target_link_libraries(testsMakeToken spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsMakeToken POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsMakeToken> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsMakeToken>")
|
||||
|
||||
add_test(NAME testsMakeToken COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsMakeToken>")
|
||||
add_test(NAME testsMakeToken COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsMakeToken>")
|
||||
endif()
|
||||
@@ -1,15 +1,15 @@
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsModuleCmd tests/testsModuleCmd.cpp ../../../thirdParty/base64/base64.cpp)
|
||||
target_link_libraries(testsModuleCmd)
|
||||
add_custom_command(TARGET testsModuleCmd POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsModuleCmd> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsModuleCmd>")
|
||||
add_test(NAME testsModuleCmd COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsModuleCmd>")
|
||||
add_executable(testsModuleCmd tests/testsModuleCmd.cpp ../../../thirdParty/base64/base64.cpp)
|
||||
target_link_libraries(testsModuleCmd spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsModuleCmd POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsModuleCmd> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsModuleCmd>")
|
||||
add_test(NAME testsModuleCmd COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsModuleCmd>")
|
||||
|
||||
add_executable(testsTools tests/testsTools.cpp ../../../thirdParty/base64/base64.cpp)
|
||||
target_link_libraries(testsTools)
|
||||
add_custom_command(TARGET testsTools POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsTools> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsTools>")
|
||||
add_executable(testsTools tests/testsTools.cpp ../../../thirdParty/base64/base64.cpp)
|
||||
target_link_libraries(testsTools spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsTools POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsTools> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsTools>")
|
||||
|
||||
add_test(NAME testsTools COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsTools>")
|
||||
add_test(NAME testsTools COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsTools>")
|
||||
endif()
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <thread>
|
||||
|
||||
#include <base64.h>
|
||||
#include <json.hpp>
|
||||
#include "nlohmann/json.hpp"
|
||||
|
||||
|
||||
//
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <queue>
|
||||
|
||||
#include <base64.h>
|
||||
#include <json.hpp>
|
||||
#include "nlohmann/json.hpp"
|
||||
|
||||
using json = nlohmann::json;
|
||||
using namespace std;
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(Powershell SHARED Powershell.cpp)
|
||||
target_link_libraries(Powershell spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET Powershell POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:Powershell> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:Powershell>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsPowershell tests/testsPowershell.cpp Powershell.cpp)
|
||||
target_link_libraries(testsPowershell)
|
||||
add_custom_command(TARGET testsPowershell POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsPowershell> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsPowershell>")
|
||||
add_executable(testsPowershell tests/testsPowershell.cpp Powershell.cpp)
|
||||
target_link_libraries(testsPowershell spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsPowershell POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsPowershell> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsPowershell>")
|
||||
|
||||
add_test(NAME testsPowershell COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsPowershell>")
|
||||
add_test(NAME testsPowershell COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsPowershell>")
|
||||
endif()
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(PrintWorkingDirectory SHARED PrintWorkingDirectory.cpp)
|
||||
target_link_libraries(PrintWorkingDirectory spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET PrintWorkingDirectory POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:PrintWorkingDirectory> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:PrintWorkingDirectory>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsPrintWorkingDirectory tests/testsPrintWorkingDirectory.cpp PrintWorkingDirectory.cpp)
|
||||
target_link_libraries(testsPrintWorkingDirectory)
|
||||
add_custom_command(TARGET testsPrintWorkingDirectory POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsPrintWorkingDirectory> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsPrintWorkingDirectory>")
|
||||
add_executable(testsPrintWorkingDirectory tests/testsPrintWorkingDirectory.cpp PrintWorkingDirectory.cpp)
|
||||
target_link_libraries(testsPrintWorkingDirectory spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsPrintWorkingDirectory POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsPrintWorkingDirectory> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsPrintWorkingDirectory>")
|
||||
|
||||
add_test(NAME testsPrintWorkingDirectory COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsPrintWorkingDirectory>")
|
||||
add_test(NAME testsPrintWorkingDirectory COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsPrintWorkingDirectory>")
|
||||
endif()
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(PsExec SHARED PsExec.cpp)
|
||||
target_link_libraries(PsExec spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET PsExec POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:PsExec> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:PsExec>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsPsExec tests/testsPsExec.cpp PsExec.cpp)
|
||||
target_link_libraries(testsPsExec)
|
||||
add_custom_command(TARGET testsPsExec POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsPsExec> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsPsExec>")
|
||||
add_executable(testsPsExec tests/testsPsExec.cpp PsExec.cpp)
|
||||
target_link_libraries(testsPsExec spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsPsExec POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsPsExec> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsPsExec>")
|
||||
|
||||
add_test(NAME testsPsExec COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsPsExec>")
|
||||
add_test(NAME testsPsExec COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsPsExec>")
|
||||
endif()
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(Rev2self SHARED Rev2self.cpp)
|
||||
target_link_libraries(Rev2self spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET Rev2self POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:Rev2self> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:Rev2self>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsRev2self tests/testsRev2self.cpp Rev2self.cpp)
|
||||
target_link_libraries(testsRev2self)
|
||||
add_custom_command(TARGET testsRev2self POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsRev2self> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsRev2self>")
|
||||
add_executable(testsRev2self tests/testsRev2self.cpp Rev2self.cpp)
|
||||
target_link_libraries(testsRev2self spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsRev2self POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsRev2self> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsRev2self>")
|
||||
|
||||
add_test(NAME testsRev2self COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsRev2self>")
|
||||
add_test(NAME testsRev2self COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsRev2self>")
|
||||
endif()
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(Run SHARED Run.cpp)
|
||||
target_link_libraries(Run spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET Run POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:Run> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:Run>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsRun tests/testsRun.cpp Run.cpp)
|
||||
target_link_libraries(testsRun)
|
||||
add_custom_command(TARGET testsRun POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsRun> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsRun>")
|
||||
add_executable(testsRun tests/testsRun.cpp Run.cpp)
|
||||
target_link_libraries(testsRun spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsRun POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsRun> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsRun>")
|
||||
|
||||
add_test(NAME testsRun COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsRun>")
|
||||
add_test(NAME testsRun COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsRun>")
|
||||
endif()
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(Script SHARED Script.cpp)
|
||||
target_link_libraries(Script spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET Script POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:Script> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:Script>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsScript tests/testsScript.cpp Script.cpp)
|
||||
target_link_libraries(testsScript)
|
||||
add_custom_command(TARGET testsScript POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsScript> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsScript>")
|
||||
add_executable(testsScript tests/testsScript.cpp Script.cpp)
|
||||
target_link_libraries(testsScript spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsScript POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsScript> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsScript>")
|
||||
|
||||
add_test(NAME testsScript COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsScript>")
|
||||
add_test(NAME testsScript COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsScript>")
|
||||
endif()
|
||||
@@ -1,6 +1,6 @@
|
||||
include_directories(../)
|
||||
add_library(SpawnAs SHARED SpawnAs.cpp)
|
||||
target_link_libraries(SpawnAs ${Donut})
|
||||
target_link_libraries(SpawnAs ${Donut} spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET SpawnAs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:SpawnAs> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:SpawnAs>")
|
||||
|
||||
@@ -8,9 +8,9 @@ if(WITH_TESTS)
|
||||
add_executable(testsSpawnAs tests/testsSpawnAs.cpp SpawnAs.cpp)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(testsSpawnAs ${Donut} )
|
||||
target_link_libraries(testsSpawnAs ${Donut} spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
else()
|
||||
target_link_libraries(testsSpawnAs ${Donut} ${aplib64} )
|
||||
target_link_libraries(testsSpawnAs ${Donut} ${aplib64} spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
|
||||
add_custom_command(TARGET testsSpawnAs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(StealToken SHARED StealToken.cpp)
|
||||
target_link_libraries(StealToken spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET StealToken POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:StealToken> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:StealToken>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsStealToken tests/testsStealToken.cpp StealToken.cpp)
|
||||
target_link_libraries(testsStealToken)
|
||||
add_custom_command(TARGET testsStealToken POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsStealToken> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsStealToken>")
|
||||
add_executable(testsStealToken tests/testsStealToken.cpp StealToken.cpp)
|
||||
target_link_libraries(testsStealToken spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsStealToken POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsStealToken> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsStealToken>")
|
||||
|
||||
add_test(NAME testsStealToken COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsStealToken>")
|
||||
add_test(NAME testsStealToken COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsStealToken>")
|
||||
endif()
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(Tree SHARED Tree.cpp)
|
||||
target_link_libraries(Tree spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET Tree POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:Tree> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:Tree>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsTree tests/testsTree.cpp Tree.cpp)
|
||||
target_link_libraries(testsTree)
|
||||
add_custom_command(TARGET testsTree POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsTree> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsTree>")
|
||||
add_executable(testsTree tests/testsTree.cpp Tree.cpp)
|
||||
target_link_libraries(testsTree spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsTree POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsTree> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsTree>")
|
||||
|
||||
add_test(NAME testsTree COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsTree>")
|
||||
add_test(NAME testsTree COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsTree>")
|
||||
endif()
|
||||
@@ -1,11 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(Upload SHARED Upload.cpp)
|
||||
target_link_libraries(Upload spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET Upload POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:Upload> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:Upload>")
|
||||
|
||||
add_executable(testsUpload tests/testsUpload.cpp Upload.cpp)
|
||||
target_link_libraries(testsUpload)
|
||||
add_custom_command(TARGET testsUpload POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsUpload> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsUpload>")
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsUpload tests/testsUpload.cpp Upload.cpp)
|
||||
target_link_libraries(testsUpload spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsUpload POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsUpload> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsUpload>")
|
||||
|
||||
add_test(NAME testsUpload COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsUpload>")
|
||||
add_test(NAME testsUpload COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsUpload>")
|
||||
endif()
|
||||
@@ -1,13 +1,14 @@
|
||||
include_directories(../)
|
||||
add_library(WmiExec SHARED WmiExec.cpp)
|
||||
target_link_libraries(WmiExec spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET WmiExec POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:WmiExec> "${CMAKE_SOURCE_DIR}/Release/Modules/$<TARGET_FILE_NAME:WmiExec>")
|
||||
|
||||
if(WITH_TESTS)
|
||||
add_executable(testsWmiExec tests/testsWmiExec.cpp WmiExec.cpp)
|
||||
target_link_libraries(testsWmiExec)
|
||||
add_custom_command(TARGET testsWmiExec POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsWmiExec> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsWmiExec>")
|
||||
add_executable(testsWmiExec tests/testsWmiExec.cpp WmiExec.cpp)
|
||||
target_link_libraries(testsWmiExec spdlog::spdlog nlohmann_json::nlohmann_json)
|
||||
add_custom_command(TARGET testsWmiExec POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
|
||||
$<TARGET_FILE:testsWmiExec> "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsWmiExec>")
|
||||
|
||||
add_test(NAME testsWmiExec COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsWmiExec>")
|
||||
add_test(NAME testsWmiExec COMMAND "${CMAKE_SOURCE_DIR}/Tests/$<TARGET_FILE_NAME:testsWmiExec>")
|
||||
endif()
|
||||
Reference in New Issue
Block a user