Some libraries are still loaded from the current directories. If we pre-load them with an absolute path then we are good.
| 16 | // Some libraries are still loaded from the current directories. |
| 17 | // If we pre-load them with an absolute path then we are good. |
| 18 | void PreloadLibs() |
| 19 | { |
| 20 | wchar_t sys32Folder[MAX_PATH]; |
| 21 | GetSystemDirectory(sys32Folder, MAX_PATH); |
| 22 | |
| 23 | std::wstring version = (std::wstring(sys32Folder) + L"\\version.dll"); |
| 24 | std::wstring logoncli = (std::wstring(sys32Folder) + L"\\logoncli.dll"); |
| 25 | std::wstring sspicli = (std::wstring(sys32Folder) + L"\\sspicli.dll"); |
| 26 | |
| 27 | LoadLibrary(version.c_str()); |
| 28 | LoadLibrary(logoncli.c_str()); |
| 29 | LoadLibrary(sspicli.c_str()); |
| 30 | } |
| 31 | |
| 32 | void MitigateDllHijacking() |
| 33 | { |
no outgoing calls
no test coverage detected