C# Modules
Empire originally adopted Covenant's YAML format for C# modules but has since forked this into Empire-Compiler, which has gradually evolved away from the original Covenant implementation. These modules are defined in YAML files that specify metadata, options, and the C# code to be executed through the .NET Roslyn compiler.
Module Structure
A typical C# module YAML has the following structure:
Every section except for the 'csharp' section are the same as the other module languages.
The csharp section is what was derived from the Covenant yamls. The csharp
section contains the actual C# code and compilation settings, including whether to allow unsafe code, which .NET Framework versions are compatible, and references to external libraries and resources.
Advanced Generation
custom_generate: For complex modules that require custom code that accesses Empire logic, such as lateral movement modules dynamically generating a listener launcher, a custom "generate" function can be used. To tell Empire to utilize the custom generate function, set advanced.custom_generate: true
Additional information about custom_generate can be found under the PowerShell Modules custom_generate.
Last updated
Was this helpful?