Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
moccajoghurt committed Aug 3, 2018
1 parent 307f137 commit 55c3571
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 17 deletions.
Binary file removed AttackServices/DLLInjectionAttack/InjectorTest.exe
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions AttackServices/HiddenKernelDLLInjectionAttack/Injector.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ BOOL StealthInject(string processName, string dllPath) {
SetTargetEProcessIfCanRead(eProcess, padSpace);
WriteVirtual(backup1.data(), padSpace, pidBasedHook.size());

// TODO Use ntdll.dll imports instead of GetKernelRoutine() and see if it's still crashing on PC
// first try NON_PAGED_CODE and NON_PAGED_DATA if possible
// TODO write test cases for the driver (e.g. loading & unloading 100x, init memory controller 100x, ...)

return TRUE;
}
Expand Down
27 changes: 15 additions & 12 deletions AttackServices/HiddenKernelDLLInjectionAttack/MemoryController.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ NON_PAGED_DATA static kernelFuncCall PsGetProcessId;
NON_PAGED_DATA static kernelFuncCall ZwOpenSection;
NON_PAGED_DATA static kernelFuncCall ZwMapViewOfSection;
NON_PAGED_DATA static kernelFuncCall ZwClose;
NON_PAGED_DATA PPHYSICAL_MEMORY_RANGE(NTAPI* MmGetPhysicalMemoryRanges)(void);
NON_PAGED_DATA static PPHYSICAL_MEMORY_RANGE(NTAPI* MmGetPhysicalMemoryRanges)(void);

/** Functions executed in kernel mode **/

Expand Down Expand Up @@ -396,30 +396,33 @@ void InitKernelFunctions() {
ZwMapViewOfSection = GetKernelProcAddress<>("ZwMapViewOfSection");
ZwClose = GetKernelProcAddress<>("ZwClose");
MmGetPhysicalMemoryRanges = GetKernelProcAddress<PPHYSICAL_MEMORY_RANGE(*)()>("MmGetPhysicalMemoryRanges");

// cout << ExAllocatePool << endl;
// cout << PsGetCurrentProcess << endl;
// cout << PsGetProcessId << endl;
// cout << ZwOpenSection << endl;
// cout << ZwMapViewOfSection << endl;
// cout << ZwClose << endl;
// cout << MmGetPhysicalMemoryRanges << endl;
}

BOOL InitMemoryController() {

if (!InitKernelModuleInfo()) {
return FALSE;
}
InitKernelFunctions();

cout << "loading driver..." << endl;
// system("PAUSE");
if (!InitDriver()) {
return FALSE;
}
cout << "about to init kernel funcs" << endl;
system("PAUSE");
// RunInKernel(InitKernelFunctions, NULL);
cout << "done init kernel funcs" << endl;
system("PAUSE");
cout << "about to GetPhysicalMemoryData" << endl;
cout << "getting GetPhysicalMemoryData" << endl;
// system("PAUSE");
RunInKernel(GetPhysicalMemoryData, NULL);
cout << "done GetPhysicalMemoryData" << endl;
system("PAUSE");
if (!physicalMemoryBegin || !physicalMemorySize || !uniqueProcessIdOffset || !activeProcessLinksOffset) {
return FALSE;
}
cout << "got GetPhysicalMemoryData" << endl;
// system("PAUSE");
targetDirectoryBase = currentDirectoryBase;


Expand Down

This file was deleted.

Binary file removed AttackServices/IATHookAttack/IATHookTest.exe
Binary file not shown.
Binary file removed AttackServices/JmpHookAttack/InjectorTest.exe
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 55c3571

Please sign in to comment.