mirror of
https://github.com/maxDcb/C2Core
synced 2026-06-08 15:48:01 +00:00
minor
This commit is contained in:
@@ -71,6 +71,7 @@ std::string CoffLoader::getInfo()
|
||||
|
||||
int CoffLoader::init(std::vector<std::string>& splitedCmd, C2Message& c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
if (splitedCmd.size() < 3)
|
||||
{
|
||||
c2Message.set_returnvalue(getInfo());
|
||||
@@ -114,7 +115,7 @@ int CoffLoader::init(std::vector<std::string>& splitedCmd, C2Message& c2Message)
|
||||
c2Message.set_returnvalue(msg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ std::string Download::getInfo()
|
||||
|
||||
int Download::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
std::vector<std::string> quoteRegroupedCmd = regroupStrings(splitedCmd);
|
||||
|
||||
if (quoteRegroupedCmd.size() == 3)
|
||||
@@ -76,6 +77,7 @@ int Download::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
c2Message.set_returnvalue(getInfo());
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -196,6 +198,7 @@ int Download::process(C2Message &c2Message, C2Message &c2RetMessage)
|
||||
|
||||
int Download::followUp(const C2Message &c2RetMessage)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
// check if there is an error
|
||||
if(c2RetMessage.errorCode()==-1)
|
||||
{
|
||||
@@ -218,6 +221,7 @@ int Download::followUp(const C2Message &c2RetMessage)
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -52,11 +52,14 @@ std::string EnumerateShares::getInfo()
|
||||
|
||||
int EnumerateShares::init(std::vector<std::string>& splitedCmd, C2Message& c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
std::string host;
|
||||
if(splitedCmd.size() > 1)
|
||||
host = splitedCmd[1];
|
||||
c2Message.set_instruction(splitedCmd[0]);
|
||||
c2Message.set_cmd(host);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,10 @@ std::string GetEnv::getInfo()
|
||||
|
||||
int GetEnv::init(std::vector<std::string>& splitedCmd, C2Message& c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
c2Message.set_instruction(splitedCmd[0]);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,10 @@ std::string IpConfig::getInfo()
|
||||
|
||||
int IpConfig::init(std::vector<std::string>& splitedCmd, C2Message& c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
c2Message.set_instruction(splitedCmd[0]);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ std::string ListDirectory::getInfo()
|
||||
|
||||
int ListDirectory::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
string path;
|
||||
for (int idx = 1; idx < splitedCmd.size(); idx++)
|
||||
{
|
||||
@@ -70,6 +71,7 @@ int ListDirectory::init(std::vector<std::string> &splitedCmd, C2Message &c2Messa
|
||||
|
||||
c2Message.set_instruction(splitedCmd[0]);
|
||||
c2Message.set_cmd(path);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -385,8 +385,10 @@ std::string ListProcesses::getInfo()
|
||||
|
||||
int ListProcesses::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
c2Message.set_instruction(splitedCmd[0]);
|
||||
c2Message.set_cmd("");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,10 @@ std::string Netstat::getInfo()
|
||||
|
||||
int Netstat::init(std::vector<std::string>& splitedCmd, C2Message& c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
c2Message.set_instruction(splitedCmd[0]);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,10 @@ std::string PrintWorkingDirectory::getInfo()
|
||||
|
||||
int PrintWorkingDirectory::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
c2Message.set_instruction(splitedCmd[0]);
|
||||
c2Message.set_cmd("");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -60,8 +60,10 @@ std::string Rev2self::getInfo()
|
||||
|
||||
int Rev2self::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
c2Message.set_instruction(splitedCmd[0]);
|
||||
c2Message.set_cmd("");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ std::string Run::getInfo()
|
||||
|
||||
int Run::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
if(splitedCmd.size()<2)
|
||||
{
|
||||
c2Message.set_returnvalue(getInfo());
|
||||
@@ -87,6 +88,7 @@ int Run::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
|
||||
c2Message.set_instruction(splitedCmd[0]);
|
||||
c2Message.set_cmd(shellCmd);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ std::string Script::getInfo()
|
||||
|
||||
int Script::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
if(splitedCmd.size()<2)
|
||||
{
|
||||
c2Message.set_returnvalue(getInfo());
|
||||
@@ -83,6 +84,7 @@ int Script::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
c2Message.set_returnvalue(err);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -238,6 +238,7 @@ SpawnAs::Options SpawnAs::unpackParameters(const std::string& data) const
|
||||
|
||||
int SpawnAs::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
auto regroupedCmd = regroupStrings(splitedCmd);
|
||||
|
||||
if (regroupedCmd.size() < 4)
|
||||
@@ -397,6 +398,7 @@ int SpawnAs::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
c2Message.set_cmd(cmd);
|
||||
c2Message.set_data(programToLaunch.data(), static_cast<int>(programToLaunch.size()));
|
||||
c2Message.set_args(packParameters(options));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ std::string Upload::getInfo()
|
||||
|
||||
int Upload::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
std::vector<std::string> quoteRegroupedCmd = regroupStrings(splitedCmd);
|
||||
|
||||
if (quoteRegroupedCmd.size() == 3)
|
||||
@@ -89,6 +90,7 @@ int Upload::init(std::vector<std::string> &splitedCmd, C2Message &c2Message)
|
||||
c2Message.set_returnvalue(getInfo());
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,9 @@ std::string Whoami::getInfo()
|
||||
|
||||
int Whoami::init(std::vector<std::string>& splitedCmd, C2Message& c2Message)
|
||||
{
|
||||
#if defined(BUILD_TEAMSERVER) || defined(C2CORE_BUILD_TESTS)
|
||||
c2Message.set_instruction(splitedCmd[0]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user