Skip to content

Commit

Permalink
Fix submodule & Config for ExternalIp
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Sep 5, 2024
1 parent 5b54a34 commit d706817
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ git submodule update --init
mkdir build
cd build
cmake ..
cmake .. -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./conan_provider.cmake
make -j4
```

Expand Down
1 change: 1 addition & 0 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ foreach(ClientFile ${ClientFiles})
endforeach()

file(COPY PowershellWebDelivery DESTINATION ${CMAKE_SOURCE_DIR}/Release/Client/)
file(COPY PeDropper DESTINATION ${CMAKE_SOURCE_DIR}/Release/Client/)

2 changes: 1 addition & 1 deletion client/PeDropper
21 changes: 14 additions & 7 deletions teamServer/teamServer/TeamServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,21 +978,26 @@ grpc::Status TeamServer::SendTermCmd(grpc::ServerContext* context, const teamser
{
std::string type = m_listeners[i]->getType();

std::string interface="";
auto it = m_config.find("IpInterface");
if(it != m_config.end())
interface = m_config["IpInterface"].get<std::string>();

std::string domainName="";
it = m_config.find("DomainName");
auto it = m_config.find("DomainName");
if(it != m_config.end())
domainName = m_config["DomainName"].get<std::string>();

std::string exposedIp="";
it = m_config.find("ExposedIp");
if(it != m_config.end())
exposedIp = m_config["ExposedIp"].get<std::string>();

std::string interface="";
it = m_config.find("IpInterface");
if(it != m_config.end())
interface = m_config["IpInterface"].get<std::string>();

std::string ip = "";
if(!interface.empty())
ip = getIPAddress(interface);

if(ip.empty() && domainName.empty())
if(ip.empty() && domainName.empty() && exposedIp.empty())
{
responseTmp.set_result("Error: No IP or Hostname in config.");
*response = responseTmp;
Expand Down Expand Up @@ -1024,6 +1029,8 @@ grpc::Status TeamServer::SendTermCmd(grpc::ServerContext* context, const teamser
result+="\n";
if(!domainName.empty())
result+=domainName;
else if(!exposedIp.empty())
result+=exposedIp;
else if(!ip.empty())
result+=ip;
result+="\n";
Expand Down
4 changes: 3 additions & 1 deletion teamServer/teamServer/TeamServerConfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"//LogLevelValues": "trace, debug, info, warning, error, fatal",
"LogLevel": "info",
"IpInterface": "eth0",
"//Host contacted by the beacon": "3 following value are related to the host, probably a proxy, that will be contacted by the beacon, if DomainName is filled it will be selected first, then the ExposedIp and then the IpInterface",
"DomainName": "",
"ExposedIp": "",
"IpInterface": "eth0",
"ServerGRPCAdd": "0.0.0.0",
"ServerGRPCPort": "50051",
"ServCrtFile": "server.crt",
Expand Down

0 comments on commit d706817

Please sign in to comment.