dll_wrapper is a Mythic wrapper payload that takes an existing Mythic payload built as raw shellcode and emits a native Windows DLL.
execute_in_dllmain: execute the wrapped shellcode fromDllMainonDLL_PROCESS_ATTACH.export_names: one or more exported function names to execute the shellcode whenexecute_in_dllmainis disabled.execution_method: shellcode execution backend. Current backends areCreateThread (Execution),QueueUserAPC (Execution), andEarlyBird (Injection).target_process_path: Target Process Path used by injection backends to spawn a child process.architecture: compile an x64 or x86 DLL. The DLL architecture must match the wrapped shellcode.
When it's time for you to test out your install or for another user to install your agent, it's pretty simple. Within Mythic you can run the mythic-cli binary to install this in one of three ways:
sudo ./mythic-cli install github https://github.com/user/repoto install the main branchsudo ./mythic-cli install github https://github.com/user/repo branchnameto install a specific branch of that reposudo ./mythic-cli install folder /path/to/local/folder/cloned/from/githubto install from an already cloned down version of an agent repo
Execution backends live in Payload_Type/dll_wrapper/dll_wrapper/agent_code/execution_methods/ and are selected by the Python builder in Payload_Type/dll_wrapper/dll_wrapper/builder.py.
To add a backend:
- Add a C++ implementation in
agent_code/execution_methods/. - Add its function declaration to
agent_code/execution_methods.h. - Add a case to
agent_code/execution_methods.cpp. - Add a UI choice to
EXECUTION_METHODSinbuilder.py.