Files
Anthony Rose 87aa24f716 feat: add dynamic option dependencies and fix option validation (#1215)
* feat: add dynamic depends_on options to stagers and fix module options

- Fix DependsOn key casing inconsistency: normalize stager options from
  Depends_on to DependsOn and fix evaluate_dependencies to check the
  correct key, making the dependency skipping logic functional
- Add DependsOn to all 17 stagers with Obfuscate/ObfuscateCommand:
  Obfuscate depends on Language=powershell, ObfuscateCommand depends
  on both Language=powershell and Obfuscate=True
- Add missing depends_on to 5 module YAML files (invoke_bypass,
  invoke_ntsd, service_exe_stager, write_dllhijacker, ProcessInjection)
- Add Language=powershell dependency to Obfuscate in modules with
  Language option (spawn, spawnas, invoke_psexec, ThreadlessInject,
  ProcessInjection, bypassuac_fodhelper)
- Fix empty depends_on in bypassuac_fodhelper.yaml
- Update test_option_util.py to use consistent DependsOn key

https://claude.ai/code/session_0146JEJUaGw2wNYjsrtbgf1V

* feat: add strict and suggested_values to boolean switch options in modules

Add strict: true and suggested_values for True/False to 28 boolean
switch options across 15 module YAML files that were missing them.

https://claude.ai/code/session_0146JEJUaGw2wNYjsrtbgf1V

* fix: remove redundant description text from Obfuscate/ObfuscateCommand options

Since depends_on now handles conditional visibility, the description
notes about "For powershell only" and "Only used if Obfuscate switch
is True" are redundant and cluttering the UI.

https://claude.ai/code/session_0146JEJUaGw2wNYjsrtbgf1V

* fix: remove redundant "Switch." prefix from option descriptions

The UI already handles displaying the option type, so the "Switch."
prefix in descriptions is redundant.

https://claude.ai/code/session_0146JEJUaGw2wNYjsrtbgf1V

* style: run ruff lint, ruff format, and yamlfmt

https://claude.ai/code/session_0146JEJUaGw2wNYjsrtbgf1V

* docs: add changelog entries for dynamic options and description cleanup

https://claude.ai/code/session_0146JEJUaGw2wNYjsrtbgf1V

* fix: resolve option validation bugs and mark conditional options as required

- Fix evaluate_dependencies to handle DependsOn being None
- Fix strict validation crash when SuggestedValues is None
- Include options with unmet dependencies in output with default values
  instead of skipping them, preventing KeyError in module generate()
- Remove broken revert_options logic in stager_service that caused
  circular reference errors during JSON serialization
- Fix invoke_ntsd.py setting stager options without ["Value"] key
- Mark Listener and Command as required in 7 lateral movement modules
  (psexec, wmi, smbexec, dcom, psremoting, inveigh_relay, executemsbuild)
  so they are validated when their depends_on condition is met
- Add missing depends_on for Listener in invoke_executemsbuild and fix
  Command depends_on from Payload=Empire to Payload=Manual
- Rewrite nanodump BOF module to use bof_packer for proper argument
  serialization
- Update test assertions to match new dependency behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: update changelog and document conditional required options

- Add changelog entries for all bug fixes, nanodump module, and
  conditional required options in lateral movement modules
- Document conditional required pattern (required: true + depends_on)
  in module development docs with Payload/Listener/Command example
- Update module configuration docs to mention conditionally required
  options

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fixed bof test issue

* fix: standardize DependsOn key to PascalCase across listeners, plugins, and stager DTOs

Listeners and plugins used `Depends_on` (mixed case) while stagers and
option_util used `DependsOn` (PascalCase). Standardize on `DependsOn` to
match the convention of all other internal option keys (Description,
Required, SuggestedValues, etc.). Also fix trailing colon typo in
`depends_on:` dict keys in listener and stager DTOs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove unnecessary Depends_on fallback in stager template service

No stager defines `Depends_on` in its options, so the `pop` fallback
was unnecessary defensive code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-25 17:18:22 +01:00

1.3 KiB

Module Configuration

Each module defines:

  • Options: Required and optional parameters exposed to the operator.
  • Language: The runtime environment the agent must support (PowerShell, Python, C#, etc.).
  • Opsec notes: Guidance on how noisy the module may be or what artifacts it leaves behind.
  • Background execution: Whether the module runs synchronously or can be queued for later execution.

Reading the module description and options carefully helps avoid failed tasks and reduces unnecessary network or disk activity.

Dynamic Options

Some modules populate or reveal option values dynamically based on other option selections. When you open a module, Empire evaluates these relationships so the UI only shows the options that are relevant to the current configuration. This keeps the option list shorter and helps avoid invalid combinations.

Options can be conditionally required — marked required: true with a depends_on field — so they are only validated when their dependency is met. For example, lateral movement modules like Invoke-PsExec require a Listener when using the Empire payload, but require a Command when using a manual payload.

For detailed, YAML-backed examples of dynamic options (including depends_on, suggested_values, and internal), see the module development documentation in Module Development.