PE-sieve
Scans all running processes. Recognizes and dumps a variety of potentially malicious implants (replaced/implanted PEs, shellcodes, hooks, in-memory patches).
Loading...
Searching...
No Matches
scanner.h
Go to the documentation of this file.
1#pragma once
2
3#include <windows.h>
4#include <string>
5#include <map>
6
7#include <peconv.h>
8#include "scan_report.h"
9#include "module_data.h"
11
12namespace pesieve {
13
16 public:
17
24 ProcessScanner(HANDLE procHndl, bool is_reflection, pesieve::t_params _args);
25
27 {
28 }
29
31
34 ProcessScanReport* scanRemote(); //throws exceptions
35
36 static t_scan_status scanForHollows(HANDLE hProcess, ModuleData& modData, RemoteModuleData &remoteModData, ProcessScanReport& process_report);
37 static t_scan_status scanForHooks(HANDLE hProcess, ModuleData& modData, RemoteModuleData &remoteModData, ProcessScanReport& process_report, bool scan_data, bool scan_inaccessible);
38 static t_scan_status scanForIATHooks(HANDLE hProcess, ModuleData& modData, RemoteModuleData &remoteModData, ProcessScanReport& process_report, t_iat_scan_mode filter);
39
40 protected:
41 size_t scanModules(ProcessScanReport &pReport); //throws exceptions
42 size_t scanModulesIATs(ProcessScanReport &pReport); //throws exceptions
43 size_t scanThreads(ProcessScanReport& pReport); //throws exceptions
44 size_t scanWorkingSet(ProcessScanReport &pReport); //throws exceptions
45
47
48 bool resolveHooksTargets(ProcessScanReport& process_report);
49 bool filterDotNetReport(ProcessScanReport& process_report);
50
52 bool isDEP;
53 const bool isReflection;
56
57 std::set<std::string> ignoredModules;
58 };
59
60}; //namespace pesieve
Loads a module from the disk, corresponding to the module in the scanned process' memory.
Definition module_data.h:15
A base class of all the reports detailing on the output of the performed module's scan.
The report aggregating the results of the performed scan.
Definition scan_report.h:19
The root scanner, responsible for enumerating all the elements to be scanned within a given process,...
Definition scanner.h:15
size_t scanWorkingSet(ProcessScanReport &pReport)
Definition scanner.cpp:298
size_t scanModules(ProcessScanReport &pReport)
Definition scanner.cpp:350
const bool isReflection
Definition scanner.h:53
size_t scanThreads(ProcessScanReport &pReport)
Definition scanner.cpp:484
ProcessScanner(HANDLE procHndl, bool is_reflection, pesieve::t_params _args)
Definition scanner.cpp:82
static t_scan_status scanForHooks(HANDLE hProcess, ModuleData &modData, RemoteModuleData &remoteModData, ProcessScanReport &process_report, bool scan_data, bool scan_inaccessible)
Definition scanner.cpp:148
size_t scanModulesIATs(ProcessScanReport &pReport)
Definition scanner.cpp:438
pesieve::t_params args
Definition scanner.h:55
static t_scan_status scanForHollows(HANDLE hProcess, ModuleData &modData, RemoteModuleData &remoteModData, ProcessScanReport &process_report)
Definition scanner.cpp:92
bool resolveHooksTargets(ProcessScanReport &process_report)
Definition scanner.cpp:164
bool filterDotNetReport(ProcessScanReport &process_report)
Definition scanner.cpp:193
ModuleScanReport * scanForMappingMismatch(ModuleData &modData, ProcessScanReport &process_report)
Definition scanner.cpp:341
ProcessSymbolsManager symbols
Definition scanner.h:54
static t_scan_status scanForIATHooks(HANDLE hProcess, ModuleData &modData, RemoteModuleData &remoteModData, ProcessScanReport &process_report, t_iat_scan_mode filter)
Definition scanner.cpp:124
ProcessScanReport * scanRemote()
The main function of ProcessScanner, deploying the scan. Throws exceptions in case of a failure.
Definition scanner.cpp:230
std::set< std::string > ignoredModules
Definition scanner.h:57
Buffers the data from the module loaded in the scanned process into the local memory.
enum pesieve::module_scan_status t_scan_status