Skip to content

Commit 993e4d7

Browse files
maxDcbkali
authored andcommitted
fix package headers and dependencies
1 parent bcd5200 commit 993e4d7

File tree

6 files changed

+109
-29
lines changed

6 files changed

+109
-29
lines changed

beacon/Beacon.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3-
#include "../listener/ListenerTcp.hpp"
4-
#include "../listener/ListenerSmb.hpp"
3+
#include <ListenerTcp.hpp>
4+
#include <ListenerSmb.hpp>
55
#include "SocksTunnelClient.hpp"
66

77
#include <queue>

beacon/BeaconTcp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "BeaconTcp.hpp"
2+
#include <SocketClient.hpp>
23

34
using namespace std;
45

beacon/BeaconTcp.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#pragma once
22

3-
#include <SocketClient.hpp>
43
#include "Beacon.hpp"
54

5+
class SocketTunnelClient;
6+
67

78
class BeaconTcp : public Beacon
89
{

beacon/CMakeLists.txt

Lines changed: 81 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,31 @@ add_library(BeaconHttpLib ${SOURCES_BEACON_HTTP_EXE})
1414
target_include_directories(BeaconHttpLib PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}> $<INSTALL_INTERFACE:include>)
1515
if(WIN32)
1616
set_property(TARGET BeaconHttpLib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded")
17-
target_link_libraries(BeaconHttpLib PRIVATE
17+
target_link_libraries(BeaconHttpLib PUBLIC
1818
$<BUILD_INTERFACE:SocketHandler>
1919
$<BUILD_INTERFACE:PipeHandler>
2020
$<BUILD_INTERFACE:MemoryModule>
21-
$<BUILD_INTERFACE:SocksServer>)
21+
$<BUILD_INTERFACE:SocksServer>
22+
$<INSTALL_INTERFACE:SocketHandler>
23+
$<INSTALL_INTERFACE:PipeHandler>
24+
$<INSTALL_INTERFACE:MemoryModule>
25+
$<INSTALL_INTERFACE:SocksServer>)
2226
else()
23-
target_link_libraries(BeaconHttpLib PRIVATE
27+
target_link_libraries(BeaconHttpLib PUBLIC
2428
$<BUILD_INTERFACE:SocketHandler>
2529
$<BUILD_INTERFACE:PipeHandler>
2630
$<BUILD_INTERFACE:MemoryModule>
2731
$<BUILD_INTERFACE:SocksServer>
2832
$<BUILD_INTERFACE:openssl::openssl>
2933
$<BUILD_INTERFACE:httplib::httplib>
30-
$<BUILD_INTERFACE:dl>)
34+
$<BUILD_INTERFACE:dl>
35+
$<INSTALL_INTERFACE:SocketHandler>
36+
$<INSTALL_INTERFACE:PipeHandler>
37+
$<INSTALL_INTERFACE:MemoryModule>
38+
$<INSTALL_INTERFACE:SocksServer>
39+
$<INSTALL_INTERFACE:openssl::openssl>
40+
$<INSTALL_INTERFACE:httplib::httplib>
41+
$<INSTALL_INTERFACE:dl>)
3142
endif()
3243
# add_custom_command(TARGET BeaconHttpLib POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
3344
# $<TARGET_FILE:BeaconHttpLib> "${CMAKE_SOURCE_DIR}/Release/Beacons/$<TARGET_FILE_NAME:BeaconHttpLib>")
@@ -46,18 +57,27 @@ add_library(BeaconTcpLib ${SOURCES_BEACON_TCP_EXE})
4657
target_include_directories(BeaconTcpLib PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}> $<INSTALL_INTERFACE:include>)
4758
if(WIN32)
4859
set_property(TARGET BeaconTcpLib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded")
49-
target_link_libraries(BeaconTcpLib PRIVATE
60+
target_link_libraries(BeaconTcpLib PUBLIC
5061
$<BUILD_INTERFACE:SocketHandler>
5162
$<BUILD_INTERFACE:PipeHandler>
5263
$<BUILD_INTERFACE:MemoryModule>
53-
$<BUILD_INTERFACE:SocksServer>)
64+
$<BUILD_INTERFACE:SocksServer>
65+
$<INSTALL_INTERFACE:SocketHandler>
66+
$<INSTALL_INTERFACE:PipeHandler>
67+
$<INSTALL_INTERFACE:MemoryModule>
68+
$<INSTALL_INTERFACE:SocksServer>)
5469
else()
55-
target_link_libraries(BeaconTcpLib PRIVATE
70+
target_link_libraries(BeaconTcpLib PUBLIC
5671
$<BUILD_INTERFACE:SocketHandler>
5772
$<BUILD_INTERFACE:PipeHandler>
5873
$<BUILD_INTERFACE:MemoryModule>
5974
$<BUILD_INTERFACE:SocksServer>
60-
$<BUILD_INTERFACE:dl>)
75+
$<BUILD_INTERFACE:dl>
76+
$<INSTALL_INTERFACE:SocketHandler>
77+
$<INSTALL_INTERFACE:PipeHandler>
78+
$<INSTALL_INTERFACE:MemoryModule>
79+
$<INSTALL_INTERFACE:SocksServer>
80+
$<INSTALL_INTERFACE:dl>)
6181
endif()
6282
# add_custom_command(TARGET BeaconTcpLib POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
6383
# $<TARGET_FILE:BeaconTcpLib> "${CMAKE_SOURCE_DIR}/Release/Beacons/$<TARGET_FILE_NAME:BeaconTcpLib>")
@@ -76,18 +96,27 @@ add_library(BeaconSmbLib ${SOURCES_BEACON_SMB_EXE})
7696
target_include_directories(BeaconSmbLib PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}> $<INSTALL_INTERFACE:include>)
7797
if(WIN32)
7898
set_property(TARGET BeaconSmbLib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded")
79-
target_link_libraries(BeaconSmbLib PRIVATE
99+
target_link_libraries(BeaconSmbLib PUBLIC
80100
$<BUILD_INTERFACE:SocketHandler>
81101
$<BUILD_INTERFACE:PipeHandler>
82102
$<BUILD_INTERFACE:MemoryModule>
83-
$<BUILD_INTERFACE:SocksServer>)
103+
$<BUILD_INTERFACE:SocksServer>
104+
$<INSTALL_INTERFACE:SocketHandler>
105+
$<INSTALL_INTERFACE:PipeHandler>
106+
$<INSTALL_INTERFACE:MemoryModule>
107+
$<INSTALL_INTERFACE:SocksServer>)
84108
else()
85-
target_link_libraries(BeaconSmbLib PRIVATE
109+
target_link_libraries(BeaconSmbLib PUBLIC
86110
$<BUILD_INTERFACE:SocketHandler>
87111
$<BUILD_INTERFACE:PipeHandler>
88112
$<BUILD_INTERFACE:MemoryModule>
89113
$<BUILD_INTERFACE:SocksServer>
90-
$<BUILD_INTERFACE:dl>)
114+
$<BUILD_INTERFACE:dl>
115+
$<INSTALL_INTERFACE:SocketHandler>
116+
$<INSTALL_INTERFACE:PipeHandler>
117+
$<INSTALL_INTERFACE:MemoryModule>
118+
$<INSTALL_INTERFACE:SocksServer>
119+
$<INSTALL_INTERFACE:dl>)
91120
endif()
92121
# add_custom_command(TARGET BeaconSmbLib POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
93122
# $<TARGET_FILE:BeaconSmbLib> "${CMAKE_SOURCE_DIR}/Release/Beacons/$<TARGET_FILE_NAME:BeaconSmbLib>")
@@ -106,20 +135,31 @@ add_library(BeaconGithubLib ${SOURCES_BEACON_GITHUB_EXE})
106135
target_include_directories(BeaconGithubLib PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}> $<INSTALL_INTERFACE:include>)
107136
if(WIN32)
108137
set_property(TARGET BeaconGithubLib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded")
109-
target_link_libraries(BeaconGithubLib PRIVATE
138+
target_link_libraries(BeaconGithubLib PUBLIC
110139
$<BUILD_INTERFACE:SocketHandler>
111140
$<BUILD_INTERFACE:PipeHandler>
112141
$<BUILD_INTERFACE:MemoryModule>
113-
$<BUILD_INTERFACE:SocksServer>)
142+
$<BUILD_INTERFACE:SocksServer>
143+
$<INSTALL_INTERFACE:SocketHandler>
144+
$<INSTALL_INTERFACE:PipeHandler>
145+
$<INSTALL_INTERFACE:MemoryModule>
146+
$<INSTALL_INTERFACE:SocksServer>)
114147
else()
115-
target_link_libraries(BeaconGithubLib PRIVATE
148+
target_link_libraries(BeaconGithubLib PUBLIC
116149
$<BUILD_INTERFACE:SocketHandler>
117150
$<BUILD_INTERFACE:PipeHandler>
118151
$<BUILD_INTERFACE:MemoryModule>
119152
$<BUILD_INTERFACE:SocksServer>
120153
$<BUILD_INTERFACE:openssl::openssl>
121154
$<BUILD_INTERFACE:httplib::httplib>
122-
$<BUILD_INTERFACE:dl>)
155+
$<BUILD_INTERFACE:dl>
156+
$<INSTALL_INTERFACE:SocketHandler>
157+
$<INSTALL_INTERFACE:PipeHandler>
158+
$<INSTALL_INTERFACE:MemoryModule>
159+
$<INSTALL_INTERFACE:SocksServer>
160+
$<INSTALL_INTERFACE:openssl::openssl>
161+
$<INSTALL_INTERFACE:httplib::httplib>
162+
$<INSTALL_INTERFACE:dl>)
123163
endif()
124164
# add_custom_command(TARGET BeaconGithubLib POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
125165
# $<TARGET_FILE:BeaconGithubLib> "${CMAKE_SOURCE_DIR}/Release/Beacons/$<TARGET_FILE_NAME:BeaconGithubLib>")
@@ -134,31 +174,46 @@ set(SOURCES_BEACON_DNS_EXE
134174
../../thirdParty/base64/base64.cpp
135175
)
136176

177+
137178
add_library(BeaconDnsLib ${SOURCES_BEACON_DNS_EXE})
138179
target_include_directories(BeaconDnsLib PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}> $<INSTALL_INTERFACE:include>)
139180

140-
install(TARGETS BeaconHttpLib BeaconTcpLib BeaconSmbLib BeaconGithubLib BeaconDnsLib
141-
EXPORT C2CoreTargets
142-
ARCHIVE DESTINATION lib
143-
LIBRARY DESTINATION lib
144-
RUNTIME DESTINATION bin
145-
INCLUDES DESTINATION include)
146181
if(WIN32)
147182
set_property(TARGET BeaconDnsLib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded")
148-
target_link_libraries(BeaconDnsLib PRIVATE
183+
target_link_libraries(BeaconDnsLib PUBLIC
149184
$<BUILD_INTERFACE:Dnscommunication>
150185
$<BUILD_INTERFACE:SocketHandler>
151186
$<BUILD_INTERFACE:PipeHandler>
152187
$<BUILD_INTERFACE:MemoryModule>
153-
$<BUILD_INTERFACE:SocksServer>)
188+
$<BUILD_INTERFACE:SocksServer>
189+
$<INSTALL_INTERFACE:Dnscommunication>
190+
$<INSTALL_INTERFACE:SocketHandler>
191+
$<INSTALL_INTERFACE:PipeHandler>
192+
$<INSTALL_INTERFACE:MemoryModule>
193+
$<INSTALL_INTERFACE:SocksServer>)
154194
else()
155-
target_link_libraries(BeaconDnsLib PRIVATE
195+
target_link_libraries(BeaconDnsLib PUBLIC
156196
$<BUILD_INTERFACE:Dnscommunication>
157197
$<BUILD_INTERFACE:SocketHandler>
158198
$<BUILD_INTERFACE:PipeHandler>
159199
$<BUILD_INTERFACE:MemoryModule>
160200
$<BUILD_INTERFACE:SocksServer>
161-
$<BUILD_INTERFACE:dl>)
201+
$<BUILD_INTERFACE:dl>
202+
$<INSTALL_INTERFACE:Dnscommunication>
203+
$<INSTALL_INTERFACE:SocketHandler>
204+
$<INSTALL_INTERFACE:PipeHandler>
205+
$<INSTALL_INTERFACE:MemoryModule>
206+
$<INSTALL_INTERFACE:SocksServer>
207+
$<INSTALL_INTERFACE:dl>)
162208
endif()
163209
# add_custom_command(TARGET BeaconDnsLib POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
164210
# $<TARGET_FILE:BeaconDnsLib> "${CMAKE_SOURCE_DIR}/Release/Beacons/$<TARGET_FILE_NAME:BeaconDnsLib>")
211+
212+
install(TARGETS BeaconHttpLib BeaconTcpLib BeaconSmbLib BeaconGithubLib BeaconDnsLib
213+
SocketHandler PipeHandler MemoryModule SocksServer Dnscommunication
214+
EXPORT C2CoreTargets
215+
ARCHIVE DESTINATION lib
216+
LIBRARY DESTINATION lib
217+
RUNTIME DESTINATION bin
218+
INCLUDES DESTINATION include)
219+

beacon/SocksTunnelClient.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#pragma once
2+
3+
#include <cstdint>
4+
#include <string>
5+
6+
class SocksTunnelClient {
7+
public:
8+
explicit SocksTunnelClient(int id = 0) : m_id(id) {}
9+
int init(std::uint32_t, std::uint16_t) { return 1; }
10+
int process(const std::string&, std::string&) { return -1; }
11+
int getId() const { return m_id; }
12+
void reset() {}
13+
private:
14+
int m_id;
15+
};

cmake/C2CoreConfig.cmake.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
@PACKAGE_INIT@
22

3+
include(CMakeFindDependencyMacro)
4+
find_dependency(SocketHandler)
5+
find_dependency(PipeHandler)
6+
find_dependency(MemoryModule)
7+
find_dependency(SocksServer)
8+
find_dependency(Dnscommunication)
9+
find_dependency(OpenSSL)
10+
311
include("${CMAKE_CURRENT_LIST_DIR}/C2CoreTargets.cmake")
412

0 commit comments

Comments
 (0)