Skip to content

Maldev-Academy/LsassHijackingViaReg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LsassHijackingViaReg


Loading a DLL into LSASS at boot, providing persistence.

How?


  1. Lsass.exe is found to be reading two registry keys at startup to load DLLs from the System32 directory. These keys are:

image

  • Extension under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LsaExtensionConfig\Interfaces\1001 to read lsasrv.dll.

image

  • Extension under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LsaExtensionConfig\Interfaces\1002 to read dpapisrv.dll.

image


  1. We constructed a program that elevates to TrustedInstaller to edit one of these registry keys, replacing the original DLL name with ours.

IMG1

Note

  • The same program disables PPL to load an unsigned DLL into LSASS. Otherwise, we will get stuck in a boot loop, because Lsass will crash before startup (due to having an unsigned DLL loaded). One can get around this by loading a signed but vulnerable DLL and exploiting it later (BYOVDLL - Bring Your Own Vulnerable DLL).
  • We are replacing the dpapisrv.dll DLL instead of the lsasrv.dll DLL, because the latter DLL has far more exported variables/functions, which make proxying such DLL less stable (for comparison, dpapisrv.dll contains 2 exported functions only).

  1. After the next system boot, our DLL (Dummy.dll) will be loaded into the Lsass.exe.

IMG2


Quick Links

Maldev Academy Home

Maldev Academy Syllabus

Offensive Phishing Operations

Maldev Database

About

Injecting DLL into LSASS at boot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages