Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
PanoptesYara.h
Go to the documentation of this file.
1#pragma once
2#include "ExtensibilityCore.h"
3#include <vector>
4extern "C" {
5#include "yara_x.h"
6}
7
8#define VERSION "1.0.0"
9using namespace std;
10
14 bool isSigned = false;
16 bool trusted = false;
18 bool catalogSigned = false;
20 std::string signer;
22 LONG trustStatus = TRUST_E_NOSIGNATURE;
23};
24
25SignatureInfo VerifyFileSignature(const std::string& PathToFile);
26
29public:
31 bool Hello(ExtensibilityType extensibilityType, int ContainerPort);
32 bool SendResults_Yara(std::string PePath, std::string FileHash, std::vector<std::string> DetectedRules, const SignatureInfo& Signature);
33};
34
37private:
39 YRX_RULES* g_yaraRules = nullptr;
40public:
42 struct ScanData
43 {
45 std::vector<std::string> detectedRules;
46 };
47
48 YaraScanner(const char* Rules);
50 // Owns g_yaraRules, so a copy would destroy the rules twice
51 YaraScanner(const YaraScanner&) = delete;
53 std::vector<std::string> YaraScanFile(std::string PathToFile);
54};
ExtensibilityType
The type of extensibility.
SignatureInfo VerifyFileSignature(const std::string &PathToFile)
Verify the Authenticode signature of a file using WinVerifyTrust. The embedded signature is checked f...
The Panoptes Service client used to talk to the service over gRPC.
bool SendResults_Yara(std::string PePath, std::string FileHash, DWORD ProcessId, std::string YaraRulesPath, INT MatchRules, std::vector< std::string > DetectedRules)
bool Hello(ExtensibilityType extensibilityType, int ContainerPort)
YaraScanner(const YaraScanner &)=delete
YaraScanner(const char *Rules)
Intializes Yara memory and attempts to load supplied yara rules.
Definition yara-scan.cpp:38
std::vector< std::string > YaraScanFile(std::string PathToFile)
Scan a file using YARA rules.
Definition yara-scan.cpp:82
YaraScanner & operator=(const YaraScanner &)=delete
~YaraScanner()
Destructor for the YaraScanner class that destroys the YARA rules.
Definition yara-scan.cpp:54
The result of verifying a file's Authenticode signature with WinVerifyTrust.
bool trusted
True if WinVerifyTrust reported the signature as valid and trusted.
std::string signer
The signing certificate's display name (UTF-8), empty if unsigned.
LONG trustStatus
The WinVerifyTrust result, 0 if trusted.
bool isSigned
True if the file has an embedded or catalog signature.
bool catalogSigned
True if the signature came from a catalog file rather than being embedded.
The data that is sent to the Panoptes Service.
std::vector< std::string > detectedRules