Добрый день, среди всех аналогичных проектов из гитхаба нашел более-менее рабочий: github.com/wavestone-cdt/EDRSandblast .
Немного переписал его чтобы вообще проверить, анхукуются ли хуки на самом деле, получилось что да.
Имеем вот такой вывод:
Как мы можем видеть, все аверские хуки заменились оригинальными, но! Мой вопрос состоит в том, как это может помочь.
Проверял на своем коде, даже после анхуков авер работает ни в чем не бывало и продолжает ловить инжект, uacbypass, и процессы cmd /c
Так что, есть ли хоть какая то польза от этих анхуков?
Также ищу способ оборвать AV Execution Flow (Например, возможно ли запускать процессы не от родительского процесса а вообще от левого)
Немного переписал его чтобы вообще проверить, анхукуются ли хуки на самом деле, получилось что да.
Имеем вот такой вывод:
Loaded DLLs in current process:
0x00007FF85F150000 : ntdll.dll (C:\Windows\SYSTEM32\ntdll.dll)
Hook detected in function 0x000a0a70 : KiUserApcDispatcher -> hmpalert.dll+0x9b470
diff found at 0x00007FF85F1F0A70 of size 5
Hook detected in function 0x00016a10 : LdrLoadDll -> hmpalert.dll+0x29220
diff found at 0x00007FF85F166A10 of size 5
Hook detected in function 0x0009d060 : NtAllocateVirtualMemory -> hmpalert.dll+0x275c0
diff found at 0x00007FF85F1ED060 of size 5
Hook detected in function 0x0009dc70 : NtAlpcConnectPort -> hmpalert.dll+0x2a700
diff found at 0x00007FF85F1EDC70 of size 5
Hook detected in function 0x0009d120 : NtFreeVirtualMemory -> hmpalert.dll+0x27a80
diff found at 0x00007FF85F1ED120 of size 5
Hook detected in function 0x0009d260 : NtMapViewOfSection -> hmpalert.dll+0x28770
diff found at 0x00007FF85F1ED260 of size 5
Hook detected in function 0x0009d760 : NtProtectVirtualMemory -> hmpalert.dll+0x27c80
diff found at 0x00007FF85F1ED760 of size 5
Hook detected in function 0x0009d600 : NtQueueApcThread -> hmpalert.dll+0x28e20
diff found at 0x00007FF85F1ED600 of size 5
Hook detected in function 0x0009f9f0 : NtQueueApcThreadEx -> hmpalert.dll+0x28f40
diff found at 0x00007FF85F1EF9F0 of size 5
Hook detected in function 0x0009d540 : NtReadVirtualMemory -> hmpalert.dll+0x285e0
diff found at 0x00007FF85F1ED540 of size 5
Hook detected in function 0x0009feb0 : NtSetContextThread -> hmpalert.dll+0x2a460
diff found at 0x00007FF85F1EFEB0 of size 5
Hook detected in function 0x0009d2a0 : NtUnmapViewOfSection -> hmpalert.dll+0x28be0
diff found at 0x00007FF85F1ED2A0 of size 5
Hook detected in function 0x0009d4a0 : NtWriteVirtualMemory -> hmpalert.dll+0x28450
diff found at 0x00007FF85F1ED4A0 of size 5
Hook detected in function 0x00068300 : RtlInstallFunctionTableCallback -> hmpalert.dll+0x2acb0
diff found at 0x00007FF85F1B8300 of size 5
0x00007FF85C4D0000 : hmpalert.dll (C:\Windows\system32\hmpalert.dll)
No hooks found in this module.
0x00007FF85EC50000 : KERNEL32.dll (C:\Windows\System32\KERNEL32.dll)
No hooks found in this module.
0x00007FF85C9D0000 : KERNELBASE.dll (C:\Windows\System32\KERNELBASE.dll)
Hook detected in function 0x00007e90 : CreateProcessInternalW -> hmpalert.dll+0x29640
diff found at 0x00007FF85C9D7E90 of size 5
0x00007FF85E160000 : ADVAPI32.dll (C:\Windows\System32\ADVAPI32.dll)
Hook detected in function 0x00047dc0 : CreateProcessWithLogonW -> hmpalert.dll+0x2a520
diff found at 0x00007FF85E1A7DC0 of size 5
0x00007FF85D240000 : msvcrt.dll (C:\Windows\System32\msvcrt.dll)
No hooks found in this module.
0x00007FF85E6D0000 : sechost.dll (C:\Windows\System32\sechost.dll)
No hooks found in this module.
0x00007FF85D340000 : RPCRT4.dll (C:\Windows\System32\RPCRT4.dll)
No hooks found in this module.
0x00007FF854AC0000 : dbghelp.dll (C:\Windows\SYSTEM32\dbghelp.dll)
No hooks found in this module.
0x00007FF85CF90000 : ucrtbase.dll (C:\Windows\System32\ucrtbase.dll)
No hooks found in this module.
0x00007FF858A60000 : VERSION.dll (C:\Windows\SYSTEM32\VERSION.dll)
No hooks found in this module.
0x00007FF854E80000 : dbgcore.DLL (C:\Windows\SYSTEM32\dbgcore.DLL)
No hooks found in this module.
0x00007FF85D470000 : shell32.dll (C:\Windows\System32\shell32.dll)
1 No hooks found in this module.
0x00007FF85D090000 : msvcp_win.dll (C:\Windows\System32\msvcp_win.dll)
No hooks found in this module.
0x00007FF85ED40000 : USER32.dll (C:\Windows\System32\USER32.dll)
No hooks found in this module.
0x00007FF85C970000 : win32u.dll (C:\Windows\System32\win32u.dll)
No hooks found in this module.
0x00007FF85E640000 : GDI32.dll (C:\Windows\System32\GDI32.dll)
No hooks found in this module.
0x00007FF85C860000 : gdi32full.dll (C:\Windows\System32\gdi32full.dll)
No hooks found in this module.
0x00007FF85E5A0000 : IMM32.DLL (C:\Windows\System32\IMM32.DLL)
No hooks found in this module.
Unhooking KiUserApcDispatcher using method 5 ...
Unhooking LdrLoadDll using method 5 ...
Unhooking NtAllocateVirtualMemory using method 5 ...
Unhooking NtAlpcConnectPort using method 5 ...
Unhooking NtFreeVirtualMemory using method 5 ...
Unhooking NtMapViewOfSection using method 5 ...
Unhooking NtProtectVirtualMemory using method 5 ...
Unhooking NtQueueApcThread using method 5 ...
Unhooking NtQueueApcThreadEx using method 5 ...
Unhooking NtReadVirtualMemory using method 5 ...
Unhooking NtSetContextThread using method 5 ...
Unhooking NtUnmapViewOfSection using method 5 ...
Unhooking NtWriteVirtualMemory using method 5 ...
Unhooking RtlInstallFunctionTableCallback using method 5 ...
Unhooking CreateProcessInternalW using method 5 ...
Unhooking CreateProcessWithLogonW using method 5 ...
After unhook, second scan:
0x00007FF85F150000 : ntdll.dll (C:\Windows\SYSTEM32\ntdll.dll)
No hooks found in this module.
0x00007FF85C4D0000 : hmpalert.dll (C:\Windows\system32\hmpalert.dll)
No hooks found in this module.
0x00007FF85EC50000 : KERNEL32.dll (C:\Windows\System32\KERNEL32.dll)
No hooks found in this module.
0x00007FF85C9D0000 : KERNELBASE.dll (C:\Windows\System32\KERNELBASE.dll)
No hooks found in this module.
0x00007FF85E160000 : ADVAPI32.dll (C:\Windows\System32\ADVAPI32.dll)
No hooks found in this module.
0x00007FF85D240000 : msvcrt.dll (C:\Windows\System32\msvcrt.dll)
No hooks found in this module.
0x00007FF85E6D0000 : sechost.dll (C:\Windows\System32\sechost.dll)
No hooks found in this module.
0x00007FF85D340000 : RPCRT4.dll (C:\Windows\System32\RPCRT4.dll)
No hooks found in this module.
0x00007FF854AC0000 : dbghelp.dll (C:\Windows\SYSTEM32\dbghelp.dll)
No hooks found in this module.
0x00007FF85CF90000 : ucrtbase.dll (C:\Windows\System32\ucrtbase.dll)
No hooks found in this module.
0x00007FF858A60000 : VERSION.dll (C:\Windows\SYSTEM32\VERSION.dll)
No hooks found in this module.
0x00007FF854E80000 : dbgcore.DLL (C:\Windows\SYSTEM32\dbgcore.DLL)
No hooks found in this module.
0x00007FF85D470000 : shell32.dll (C:\Windows\System32\shell32.dll)
1 No hooks found in this module.
0x00007FF85D090000 : msvcp_win.dll (C:\Windows\System32\msvcp_win.dll)
No hooks found in this module.
0x00007FF85ED40000 : USER32.dll (C:\Windows\System32\USER32.dll)
No hooks found in this module.
0x00007FF85C970000 : win32u.dll (C:\Windows\System32\win32u.dll)
No hooks found in this module.
0x00007FF85E640000 : GDI32.dll (C:\Windows\System32\GDI32.dll)
No hooks found in this module.
0x00007FF85C860000 : gdi32full.dll (C:\Windows\System32\gdi32full.dll)
No hooks found in this module.
0x00007FF85E5A0000 : IMM32.DLL (C:\Windows\System32\IMM32.DLL)
No hooks found in this module.
0x00007FF85F150000 : ntdll.dll (C:\Windows\SYSTEM32\ntdll.dll)
Hook detected in function 0x000a0a70 : KiUserApcDispatcher -> hmpalert.dll+0x9b470
diff found at 0x00007FF85F1F0A70 of size 5
Hook detected in function 0x00016a10 : LdrLoadDll -> hmpalert.dll+0x29220
diff found at 0x00007FF85F166A10 of size 5
Hook detected in function 0x0009d060 : NtAllocateVirtualMemory -> hmpalert.dll+0x275c0
diff found at 0x00007FF85F1ED060 of size 5
Hook detected in function 0x0009dc70 : NtAlpcConnectPort -> hmpalert.dll+0x2a700
diff found at 0x00007FF85F1EDC70 of size 5
Hook detected in function 0x0009d120 : NtFreeVirtualMemory -> hmpalert.dll+0x27a80
diff found at 0x00007FF85F1ED120 of size 5
Hook detected in function 0x0009d260 : NtMapViewOfSection -> hmpalert.dll+0x28770
diff found at 0x00007FF85F1ED260 of size 5
Hook detected in function 0x0009d760 : NtProtectVirtualMemory -> hmpalert.dll+0x27c80
diff found at 0x00007FF85F1ED760 of size 5
Hook detected in function 0x0009d600 : NtQueueApcThread -> hmpalert.dll+0x28e20
diff found at 0x00007FF85F1ED600 of size 5
Hook detected in function 0x0009f9f0 : NtQueueApcThreadEx -> hmpalert.dll+0x28f40
diff found at 0x00007FF85F1EF9F0 of size 5
Hook detected in function 0x0009d540 : NtReadVirtualMemory -> hmpalert.dll+0x285e0
diff found at 0x00007FF85F1ED540 of size 5
Hook detected in function 0x0009feb0 : NtSetContextThread -> hmpalert.dll+0x2a460
diff found at 0x00007FF85F1EFEB0 of size 5
Hook detected in function 0x0009d2a0 : NtUnmapViewOfSection -> hmpalert.dll+0x28be0
diff found at 0x00007FF85F1ED2A0 of size 5
Hook detected in function 0x0009d4a0 : NtWriteVirtualMemory -> hmpalert.dll+0x28450
diff found at 0x00007FF85F1ED4A0 of size 5
Hook detected in function 0x00068300 : RtlInstallFunctionTableCallback -> hmpalert.dll+0x2acb0
diff found at 0x00007FF85F1B8300 of size 5
0x00007FF85C4D0000 : hmpalert.dll (C:\Windows\system32\hmpalert.dll)
No hooks found in this module.
0x00007FF85EC50000 : KERNEL32.dll (C:\Windows\System32\KERNEL32.dll)
No hooks found in this module.
0x00007FF85C9D0000 : KERNELBASE.dll (C:\Windows\System32\KERNELBASE.dll)
Hook detected in function 0x00007e90 : CreateProcessInternalW -> hmpalert.dll+0x29640
diff found at 0x00007FF85C9D7E90 of size 5
0x00007FF85E160000 : ADVAPI32.dll (C:\Windows\System32\ADVAPI32.dll)
Hook detected in function 0x00047dc0 : CreateProcessWithLogonW -> hmpalert.dll+0x2a520
diff found at 0x00007FF85E1A7DC0 of size 5
0x00007FF85D240000 : msvcrt.dll (C:\Windows\System32\msvcrt.dll)
No hooks found in this module.
0x00007FF85E6D0000 : sechost.dll (C:\Windows\System32\sechost.dll)
No hooks found in this module.
0x00007FF85D340000 : RPCRT4.dll (C:\Windows\System32\RPCRT4.dll)
No hooks found in this module.
0x00007FF854AC0000 : dbghelp.dll (C:\Windows\SYSTEM32\dbghelp.dll)
No hooks found in this module.
0x00007FF85CF90000 : ucrtbase.dll (C:\Windows\System32\ucrtbase.dll)
No hooks found in this module.
0x00007FF858A60000 : VERSION.dll (C:\Windows\SYSTEM32\VERSION.dll)
No hooks found in this module.
0x00007FF854E80000 : dbgcore.DLL (C:\Windows\SYSTEM32\dbgcore.DLL)
No hooks found in this module.
0x00007FF85D470000 : shell32.dll (C:\Windows\System32\shell32.dll)
1 No hooks found in this module.
0x00007FF85D090000 : msvcp_win.dll (C:\Windows\System32\msvcp_win.dll)
No hooks found in this module.
0x00007FF85ED40000 : USER32.dll (C:\Windows\System32\USER32.dll)
No hooks found in this module.
0x00007FF85C970000 : win32u.dll (C:\Windows\System32\win32u.dll)
No hooks found in this module.
0x00007FF85E640000 : GDI32.dll (C:\Windows\System32\GDI32.dll)
No hooks found in this module.
0x00007FF85C860000 : gdi32full.dll (C:\Windows\System32\gdi32full.dll)
No hooks found in this module.
0x00007FF85E5A0000 : IMM32.DLL (C:\Windows\System32\IMM32.DLL)
No hooks found in this module.
Unhooking KiUserApcDispatcher using method 5 ...
Unhooking LdrLoadDll using method 5 ...
Unhooking NtAllocateVirtualMemory using method 5 ...
Unhooking NtAlpcConnectPort using method 5 ...
Unhooking NtFreeVirtualMemory using method 5 ...
Unhooking NtMapViewOfSection using method 5 ...
Unhooking NtProtectVirtualMemory using method 5 ...
Unhooking NtQueueApcThread using method 5 ...
Unhooking NtQueueApcThreadEx using method 5 ...
Unhooking NtReadVirtualMemory using method 5 ...
Unhooking NtSetContextThread using method 5 ...
Unhooking NtUnmapViewOfSection using method 5 ...
Unhooking NtWriteVirtualMemory using method 5 ...
Unhooking RtlInstallFunctionTableCallback using method 5 ...
Unhooking CreateProcessInternalW using method 5 ...
Unhooking CreateProcessWithLogonW using method 5 ...
After unhook, second scan:
0x00007FF85F150000 : ntdll.dll (C:\Windows\SYSTEM32\ntdll.dll)
No hooks found in this module.
0x00007FF85C4D0000 : hmpalert.dll (C:\Windows\system32\hmpalert.dll)
No hooks found in this module.
0x00007FF85EC50000 : KERNEL32.dll (C:\Windows\System32\KERNEL32.dll)
No hooks found in this module.
0x00007FF85C9D0000 : KERNELBASE.dll (C:\Windows\System32\KERNELBASE.dll)
No hooks found in this module.
0x00007FF85E160000 : ADVAPI32.dll (C:\Windows\System32\ADVAPI32.dll)
No hooks found in this module.
0x00007FF85D240000 : msvcrt.dll (C:\Windows\System32\msvcrt.dll)
No hooks found in this module.
0x00007FF85E6D0000 : sechost.dll (C:\Windows\System32\sechost.dll)
No hooks found in this module.
0x00007FF85D340000 : RPCRT4.dll (C:\Windows\System32\RPCRT4.dll)
No hooks found in this module.
0x00007FF854AC0000 : dbghelp.dll (C:\Windows\SYSTEM32\dbghelp.dll)
No hooks found in this module.
0x00007FF85CF90000 : ucrtbase.dll (C:\Windows\System32\ucrtbase.dll)
No hooks found in this module.
0x00007FF858A60000 : VERSION.dll (C:\Windows\SYSTEM32\VERSION.dll)
No hooks found in this module.
0x00007FF854E80000 : dbgcore.DLL (C:\Windows\SYSTEM32\dbgcore.DLL)
No hooks found in this module.
0x00007FF85D470000 : shell32.dll (C:\Windows\System32\shell32.dll)
1 No hooks found in this module.
0x00007FF85D090000 : msvcp_win.dll (C:\Windows\System32\msvcp_win.dll)
No hooks found in this module.
0x00007FF85ED40000 : USER32.dll (C:\Windows\System32\USER32.dll)
No hooks found in this module.
0x00007FF85C970000 : win32u.dll (C:\Windows\System32\win32u.dll)
No hooks found in this module.
0x00007FF85E640000 : GDI32.dll (C:\Windows\System32\GDI32.dll)
No hooks found in this module.
0x00007FF85C860000 : gdi32full.dll (C:\Windows\System32\gdi32full.dll)
No hooks found in this module.
0x00007FF85E5A0000 : IMM32.DLL (C:\Windows\System32\IMM32.DLL)
No hooks found in this module.
Как мы можем видеть, все аверские хуки заменились оригинальными, но! Мой вопрос состоит в том, как это может помочь.
Проверял на своем коде, даже после анхуков авер работает ни в чем не бывало и продолжает ловить инжект, uacbypass, и процессы cmd /c
Так что, есть ли хоть какая то польза от этих анхуков?
Также ищу способ оборвать AV Execution Flow (Например, возможно ли запускать процессы не от родительского процесса а вообще от левого)
Последнее редактирование: