mirror of
https://github.com/JKornev/hidden
synced 2024-06-16 03:58:04 +00:00
Added exclude\protect list loading from HiddenCLI to driver
Fixed memory leak on the CreateProcessNotifyCallback
This commit is contained in:
parent
a25458a4c8
commit
5d1787ffbc
@ -16,14 +16,14 @@ PsRulesContext g_excludeProcessRules;
|
||||
PsRulesContext g_protectProcessRules;
|
||||
|
||||
// Use this variable for hard code full path to applications that can see hidden objects
|
||||
// For instance: L"\\??\\C:\\Windows\\System32\\calc.exe",
|
||||
// For instance: L"\\Device\\HarddiskVolume1\\Windows\\System32\\calc.exe",
|
||||
// Notice: this array should be NULL terminated
|
||||
CONST PWCHAR g_excludeProcesses[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
// Use this variable for hard code full path to applications that will be protected
|
||||
// For instance: L"\\??\\C:\\Windows\\System32\\cmd.exe",
|
||||
// For instance: L"\\Device\\HarddiskVolume1\\Windows\\System32\\cmd.exe",
|
||||
// Notice: this array should be NULL terminated
|
||||
CONST PWCHAR g_protectProcesses[] = {
|
||||
NULL
|
||||
@ -191,6 +191,7 @@ VOID CreateProcessNotifyCallback(PEPROCESS Process, HANDLE ProcessId, PPS_CREATE
|
||||
if (!NT_SUCCESS(status))
|
||||
{
|
||||
DbgPrint("FsFilter1!" __FUNCTION__ ": path normalization failed with code:%08x, path:%wZ\n", status, CreateInfo->ImageFileName);
|
||||
ExFreePool(normalized.Buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -10,14 +10,18 @@
|
||||
+ Протестировать фишки с ObRegisterCallback
|
||||
+ Стерание всех флагов
|
||||
- Реализовать PsMonitor со всеми вытекающими
|
||||
- Реализовать рабочий прототип
|
||||
+ Реализовать рабочий прототип
|
||||
+ Для Exclude
|
||||
+ Для Protected
|
||||
+ Добавить флаг наследования
|
||||
- Реализовать интерфейс для IOCTL
|
||||
- Реализовать интерфейс для File & Reg мониторов
|
||||
+ Реализовать интерфейс для IOCTL
|
||||
+ Реализовать интерфейс для File & Reg мониторов
|
||||
+ Вынести Process Table в отдельный файл
|
||||
+ Переименовать Process Tree в Process Table
|
||||
- Протестировать интерфейсы
|
||||
+ Добавить в HiddenCLI загрузку excluded и protected процессов
|
||||
- Добавить проект HiddenTest
|
||||
- Реализовать тесты в проекте HiddenTest
|
||||
- Реализовать конвертирование NT path в кернел путь \\Deivce\\HardDisk..
|
||||
+ Портировать в PsMonitor
|
||||
- Портировать в Device API
|
||||
|
@ -38,6 +38,15 @@ CONST PWCHAR g_excludeRegValues[] = {
|
||||
L"\\Registry\\MACHINE\\SOFTWARE\\zz",
|
||||
};
|
||||
|
||||
CONST PWCHAR g_protectProcesses[] = {
|
||||
L"\\Device\\HarddiskVolume1\\Windows\\System32\\calc.exe",
|
||||
L"\\Device\\HarddiskVolume1\\Windows\\System32\\calc2.exe",
|
||||
};
|
||||
|
||||
CONST PWCHAR g_excludeProcesses[] = {
|
||||
L"\\Device\\HarddiskVolume1\\Windows\\System32\\cmd.exe",
|
||||
L"\\Device\\HarddiskVolume1\\Windows\\System32\\cmd2.exe",
|
||||
};
|
||||
|
||||
int wmain(int argc, wchar_t *argv[])
|
||||
{
|
||||
@ -94,6 +103,26 @@ int wmain(int argc, wchar_t *argv[])
|
||||
cout << "Error, Hid_AddHiddenDir failed with code: " << HID_STATUS_CODE(hid_status) << endl;
|
||||
}
|
||||
|
||||
// Load excluded processes
|
||||
count = _countof(g_excludeProcesses);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
HidObjId objId;
|
||||
hid_status = Hid_AddExcludedImage(hid_context, g_excludeProcesses[i], WithoutInherit, &objId);
|
||||
if (!HID_STATUS_SUCCESSFUL(hid_status))
|
||||
cout << "Error, Hid_AddExcludedImage failed with code: " << HID_STATUS_CODE(hid_status) << endl;
|
||||
}
|
||||
|
||||
// Load protected processes
|
||||
count = _countof(g_protectProcesses);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
HidObjId objId;
|
||||
hid_status = Hid_AddProtectedImage(hid_context, g_protectProcesses[i], WithoutInherit, &objId);
|
||||
if (!HID_STATUS_SUCCESSFUL(hid_status))
|
||||
cout << "Error, Hid_AddProtectedImage failed with code: " << HID_STATUS_CODE(hid_status) << endl;
|
||||
}
|
||||
|
||||
Hid_Destroy(hid_context);
|
||||
cout << "Completed!" << endl;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user