[FEATURE REQUEST] Convert modules to stop using deprecated features in Empire 5.9+ #716
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Description
Empire 5.9.0 introduced a new way of doing error handling: https://bc-security.gitbook.io/empire-wiki/module-development/powershell-modules#error-handling
Instead of returning a tuple containing an error message or using the
handle_error_message
function, an exception should be raised and the generated module script should be returned as astr
Empire 5.9.0 introduced 2 decorators
auto_get_source
andauto_finalize
: https://bc-security.gitbook.io/empire-wiki/module-development/powershell-modules#decoratorsUsing these decorators eliminates a bit of boiler plate code from the beginning and end of a module's generate function.
auto_finalize
cannot be used without replacing tuple returns with raised exceptions.Solution
Remove the use of
handle_error_message
, instead using the raised exceptions described in the docs https://bc-security.gitbook.io/empire-wiki/module-development/powershell-modules#error-handlingFor modules that are not deviating from the boiler plate template, replace the
get_module_source
andfinalize_module
calls with theauto_get_source
andauto_finalize
decorators.An example module conversion is here:
4eb02f6#diff-c41918d437c0bf39ac6fc692e1bb881586f8d1b0c583864f72bdcfbf5ba0ad65R12-R48
Alternatives
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: