Yet another proof-of-concept for an LSASS memory dumper. This one incorporates established techniques and attempts to neutralize all user-land API hooks before dumping LSASS.
Dumper2020 relies almost completely on the work of others, to whom I owe a great deal of thanks:
As demonstrated by AndrewSpecial and Dumpert, unhooking NtReadVirtualMemory is typically enough to avoid EDR preventative measures when dumping LSASS. However, if MiniDumpWriteDump is hooked, dumping LSASS will still generate alerts. Dumper2020 builds on the Dumpert idea and uses syscalls for most tasks where possible but takes things up a notch by attempting to remove all user-land API hooks before calling MiniDumpWriteDump. If successful, this should further reduce the chance of preventative action and decrease the overall indicator footprint. User-land API hooks are only one source of telemetry, though. EDR sensors will still record the following events, at least, thanks to kernel callbacks and mini-filters:
The dumper2020 solution consists of three projects:
dumper2020 builds a static library that provides the core functionality.
dumper2020_dll builds a DLL that links the static library and attempts to dump LSASS to C:\Windows\Temp\setup_error_log.txt
when executed.
dumper2020_exe builds an EXE that links the static library and attempts to dump LSASS to log.txt
in the current directory when executed.
Syscall macros are not provided, but can be quickly generated with SysWhispers. Please refer to that project's README for integration guidance. Alternative syscall implementations could be leveraged with minimal effort.
For reference, dumper2020 uses the following syscalls:
NtAdjustPrivilegesToken
NtClose
NtCreateFile
NtDeleteFile
NtOpenProcess
NtOpenProcessToken
NtProtectVirtualMemory
NtQueryInformationToken
NtQuerySystemInformation
NtWriteVirtualMemory