gitjdm / dumper2020

Yet another LSASS dumper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dumper2020

Summary

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.

Credit/Thanks

Dumper2020 relies almost completely on the work of others, to whom I owe a great deal of thanks:

Background

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:

  • LSASS handle creation
  • Dump file creation

Usage

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

Screenshot

dumper2020

Considerations

  • 64-bit only
  • Visual Studio 2019 (v142)
  • Lightly tested on Windows 2012 R2 and Windows 10 with some common EDR solutions
  • As a proof-of-concept, this solution should not be considered operationally secure as is

About

Yet another LSASS dumper

License:Other


Languages

Language:C++ 91.0%Language:C 9.0%