mirror of
https://github.com/maxDcb/C2Core
synced 2026-06-08 15:48:01 +00:00
108a370807
* CommandSpecs * CommandSpecs * feat(command-specs): add simple module specs * listModule * AssemblyExec * AssemblyExecTests * Minor * Inject * InjectTests * Spec modules * Folder layout * upload & download * Chisel Minidump Powershell & Script * CoffLoader DotnetExec /KerberosUseTicket PsExec PwSh ScreenShot * add artifact_filters * Minor * stabilisation * Fixes * manual test * manual test * manual test * manual test * manual test * manual test * manual test * manual test * ScreenShot png * socks5 hostname * Maj for AI * minor
45 lines
943 B
C++
45 lines
943 B
C++
#pragma once
|
|
|
|
#include "ModuleCmd.hpp"
|
|
|
|
|
|
class Download : public ModuleCmd
|
|
{
|
|
|
|
public:
|
|
Download();
|
|
~Download();
|
|
|
|
std::string getInfo();
|
|
|
|
int init(std::vector<std::string>& splitedCmd, C2Message& c2Message);
|
|
int recurringExec(C2Message& c2RetMessage);
|
|
int process(C2Message& c2Message, C2Message& c2RetMessage);
|
|
int followUp(const C2Message &c2RetMessage);
|
|
int errorCodeToMsg(const C2Message &c2RetMessage, std::string& errorMsg);
|
|
int osCompatibility()
|
|
{
|
|
return OS_LINUX | OS_WINDOWS;
|
|
}
|
|
|
|
private:
|
|
std::string m_inputfile;
|
|
std::string m_outputfile;
|
|
std::string m_taskUuid;
|
|
std::ofstream m_output;
|
|
std::ifstream m_input;
|
|
std::streamsize m_fileSize;
|
|
std::streamsize m_bytesRead;
|
|
};
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
extern "C" __declspec(dllexport) Download * DownloadConstructor();
|
|
|
|
#else
|
|
|
|
extern "C" __attribute__((visibility("default"))) Download * DownloadConstructor();
|
|
|
|
#endif
|