Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
Functions
containers.h File Reference
#include <vector>
#include <panoptes.pb.h>
#include "service_constants.h"
#include "Configuration.hpp"

Go to the source code of this file.

Functions

ERRORCODE StartContainers (std::vector< Configuration::ContainerType > selectedExtensibility)
 

Function Documentation

◆ StartContainers()

ERRORCODE StartContainers ( std::vector< Configuration::ContainerType selectedExtensibility)

Definition at line 30 of file containers.cpp.

30 {
31
32 if (selectedExtensibility.size() < 1)
33 {
34 return EXT_SELECTED;
35 }
36
37 BOOL containerStartupSuccess = true;
38 STARTUPINFOA startupInfo;
39 PROCESS_INFORMATION processInformation;
40
41 ZeroMemory(&startupInfo, sizeof(startupInfo));
42 startupInfo.cb = sizeof(startupInfo);
43 ZeroMemory(&processInformation, sizeof(processInformation));
44
45 for (auto containerType : selectedExtensibility) {
46 std::string cmdStr = BuildContainerCommandLine(containerType);
47#ifdef _DEBUG
48 DWORD creationFlags = 0;
49#else
50 DWORD creationFlags = CREATE_NO_WINDOW;
51#endif
52
53 if (!CreateProcessA(
54 NULL, // No module name (use command line)
55 (LPSTR)cmdStr.c_str(), // Command line
56 NULL, // Process handle not inheritable
57 NULL, // Thread handle not inheritable
58 FALSE, // Set handle inheritance to FALSE
59 creationFlags, // No creation flags
60 NULL, // Use parent's environment block
61 NULL, // Use parent's starting directory
62 &startupInfo, // Pointer to STARTUPINFO structure
63 &processInformation) // Pointer to PROCESS_INFORMATION structure
64 )
65 {
66 //string message = format("Failed to create process for {} extensibility: {}", m_extensibilityListName[i], GetLastError());
67 //LogErrorMessage(message);
68 //DWORD errMsg = GetLastError();
69 return CONTAINER_START;
70 }
71 }
72
73 return PANO_SUCCESS;
74}
#define PANO_SUCCESS
#define CONTAINER_START
#define EXT_SELECTED
std::string BuildContainerCommandLine(Configuration::ContainerType ext)
Definition containers.cpp:6
int BOOL
Definition inject.h:3
unsigned long DWORD
Definition inject.h:2

References BuildContainerCommandLine(), CONTAINER_START, EXT_SELECTED, and PANO_SUCCESS.

Referenced by WinMain().