DLL Shell Game and other misdirections
SSTIC 2019
06/06/2019 Synacktiv Lucas GEORGES
DLL Shell Game and other misdirections SSTIC 2019 06/06/2019 - - PowerPoint PPT Presentation
DLL Shell Game and other misdirections SSTIC 2019 06/06/2019 Synacktiv Lucas GEORGES Table des matires Introduction 1 2 Tools DLL Redirections 3 Vulnerabilities 4 Conclusion 5 Whoami Twitter : @_lucas_georges_ Reverser @
06/06/2019 Synacktiv Lucas GEORGES
3/43
4/43
Win32 API
Applications
TOTO.EXE TATA.EXE TITI.EXE user32.dll kernel32.dll ws2_32.dll advapi32.dll gdi32.dll etc ... ntdll.dll Subsystem Servers System Services Critical Processes
Native API
ntoskrnl.exe Kernel mode User mode
5/43
6/43
7/43
8/43
10/43
11/43
12/43
13/43
14/43
15/43
17/43
Process Initialization Load Dependencies Dynamic Load kernelbase!LoadLibraryEx
LdrpInitializeProcess LdrpLoadDependentModule
Apiset ? Apiset Resolution WinSxs ? WinSxs Resolution Y Y N N LdrpPreprocessName DLL Redirection KnownDll ? Load from \KnownDLLs DLL Search order Load from Disk Y N LdrpLoadDllInternal LdrpMapDllNtFilename DLL Search
LdrpSearchPath + LdrpResolveDllName LdrpLoadKnownDll
Load from SysWow64 in System32 ? (opt) Wow64 layer
18/43
HOST DLLs API SET NAMESPACE
TOTO.EXE api-ms-win-core-debug-l1.dll IsDebuggerPresent DebugBreak OutputDebugStringA OutputDebugStringW ContinueDebugEvent WaitForDebugEvent DebugActiveProcess DebugActiveProcessStop CheckRemoteDebuggerPresent WaitForDebugEventEx
call DebugBreak
Kernel32.dll ... DebugBreak ... HeapCreate Export Address Table api-ms-win-core-heap-l1.dll HeapCreate HeapFree ... ext-ms-win-security-srp-l1 AiEvaluatePlugin AppIDFreeAttributeString ... api-ms-win-wsl-api-l1-1 WslConfigureDistribution WslGetDistributionConfiguration WslIsDistributionRegistered srpapi.dll ... DebugBreak ... HeapCreate Export Address Table WslLaunch WslLaunchInteractive WslRegisterDistribution WslUnregisterDistribution
19/43
20/43
21/43
22/43
23/43
24/43
25/43
26/43
27/43
28/43
Process Initialization Load Dependencies Dynamic Load kernelbase!LoadLibraryEx
LdrpInitializeProcess LdrpLoadDependentModule
Apiset ? Apiset Resolution WinSxs ? WinSxs Resolution Y Y N N LdrpPreprocessName DLL Redirection KnownDll ? Load from \KnownDLLs DLL Search order Load from Disk Y N LdrpLoadDllInternal LdrpMapDllNtFilename DLL Search
LdrpSearchPath + LdrpResolveDllName LdrpLoadKnownDll
Load from SysWow64 in System32 ? (opt) Wow64 layer
30/43
31/43
32/43
33/43
34/43
35/43
36/43
37/43
38/43
39/43
40/43
42/43
MERCI DE VOTRE ATTENTION