A PoC of User-Defined Reflective Loader for Havoc Framework built with Cystal Palace.
Setup
Havoc:
Clone my fork that support User-Defined Reflective Loader.
git clone https://github.com/0xPrimo/Havoc.git
cd Havoc
Follow the installation docs.
User-Defined Reflective Loader:
- Install Crystal Palace linker by following the installation docs.
- Start Crystal Palace server:
cpl server
- Clone repo
git clone https://github.com/0xPrimo/DemonLdr.git
cd DemonLdr
- Build
# debug
make x64-debug
# release
make x64
- Load
DemonLdr.py
Hooks
Hook loader imports:
Edit loader.spec :
x64:
...
attach "MODULE$FUNC" "_MyHook"
...
Edit hooks.c:
...
BOOL _MyHook() {
LOG_INFO("_MyHook called");
return MODULE$FUNC();
}
...
Hook demon imports:
Edit pico.spec:
x64:
...
addhook "MODULE$FUNC" "_MyHook"
...
Edit hooks.c:
...
BOOL _MyHook() {
LOG_INFO("_MyHook called");
return MODULE$FUNC();
}
...