Commit Graph

12 Commits

Author SHA1 Message Date
Maxime Meignan 7587511330 Merge pull request #2 from JohnLaTwC/patch-1
Fix potential buffer overrun in credguard disable
2021-12-08 18:18:19 +01:00
John Lambert 7c6eb8173d Update CredGuard.c 2021-12-08 08:26:18 -08:00
John Lambert 2072b71d05 Fix potential buffer overrun in credguard disable
The call to `GetModuleFileNameEx` passes in `sizeof(szModulename)` for the size parameter. The documentation for that API says the size parameter is a character count, not a byte count ("The size of the lpFilename buffer, in characters.").  Since the code currently passes in a byte count, this opens up the possibility for a stack buffer overrun on UNICODE compilations of this tool where the byte count will be `2*MAX_PATH` which `GetModuleFileNameEx` will interpret as a character count and potentially write up to `2*2*MAX_PATH' bytes into the buffer.  Fix by passing in a character count.  You could also use a macro like `ARRAYSIZE(szModulename)`.


```diff
    TCHAR szModulename[MAX_PATH];
    for (DWORD i = 0; i < (lpcbNeeded / sizeof(HMODULE)); i++) {
        if (hModulesArray[i] && !GetModuleFileNameEx(hLsass, hModulesArray[i], szModulename, sizeof(szModulename))) {
...        }
```

[1] Docs for GetModuleFileNameEx are here (https://docs.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-getmodulefilenameexa)
2021-12-08 07:15:06 -08:00
Qazeer f3147ecb8a Merge pull request #1 from zeronounours/master
Make extraction of offsets compatible with Linux
2021-12-08 14:52:44 +01:00
zeroNounours 10c04a9174 Rather use r2 to get file version than pefile 2021-12-08 13:55:16 +01:00
zeroNounours 82704114b3 Make ExtractOffsets.py compatible with Linux 2021-12-08 13:43:29 +01:00
Maxime Meignan ab6188aece Removed a typo in README.md 2021-12-08 10:54:51 +01:00
Qazeer 894f58377b [Offsets] adds new ntoskrnl & wdigest offsets 2021-12-07 15:49:28 +01:00
Maxime Meignan 3c17e09d50 Update README.md with detections insights 2021-12-02 13:47:05 +01:00
Maxime Meignan 907d6b0a87 Cleaning up some code 2021-11-10 16:19:41 +01:00
Qazeer 9957b7a38e Adds randomization of service name 2021-11-10 01:12:48 +01:00
Maxime Meignan 4bff81986b Initial commit for public version
Co-authored-by: Thomas Diot <thomas.diot@wavestone.com>
2021-11-08 09:54:05 +01:00