|
3 | 3 | # Tests that the `:ancestor_reference_names` can be loaded from `:modules_pathname` and once the ancestors are loaded
|
4 | 4 | # that `:reference_name` can be instantiated.
|
5 | 5 | #
|
| 6 | +# # Payload Reference Name Derivation |
| 7 | +# You can see this naming logic [here](https://github.com/rapid7/metasploit-framework/blob/1508be6254f698f345616d14415bce164bf377f9/lib/msf/core/payload_set.rb#L132-L148). |
| 8 | +# |
| 9 | +# ## Single |
| 10 | +# 1. Remove the payload type prefix, `modules/payloads/singles`, from the path. |
| 11 | +# 2. Remove the file extension, `.rb` from the path |
| 12 | +# |
| 13 | +# This is <reference_name> |
| 14 | +# |
| 15 | +# ## Staged |
| 16 | +# |
| 17 | +# ### Stager |
| 18 | +# Determine if the stager module has a `handler_type_alias` |
| 19 | +# No) Use stager's handler's `handler_type` as `<handler_type>`. |
| 20 | +# Yes) Use the return value from `handler_type_alias` as `<handler_type>`. |
| 21 | +# |
| 22 | +# ### Stage |
| 23 | +# 1. Remove the payload type prefix, `modules/payloads/stages`, from the path. |
| 24 | +# 2. Remove the file extension, `.rb` from the path. |
| 25 | +# |
| 26 | +# This is <stage_reference_name>. |
| 27 | +# |
| 28 | +# ### Combining |
| 29 | +# The final staged module's combined `<reference_name>` is `<stage_reference_name>/<handler_type>`. |
| 30 | +# |
6 | 31 | # @example Using 'payload can be instantiated' with `Metasploit::Framework::Spec::UntestedPayloads.define_task` and 'untested payloads' shared context
|
7 | 32 | # # Rakefile
|
8 | 33 | # require 'metasploit/framework/spec/untested_payloads'
|
|
33 | 58 | #
|
34 | 59 | # @param options [Hash{Symbol => Array<String>, Pathname, String}]
|
35 | 60 | # @option options [Array<String>] :ancestor_reference_names The reference names of the payload modules that are included
|
36 |
| -# in {Msf::Payload} to make the `:reference_name` payload. |
| 61 | +# in {Msf::Payload} to make the `:reference_name` payload. Ancestor reference names are the names of the files under |
| 62 | +# `modules/payloads` without the extension `.rb` that are mixed together to form a payload module `Class`. For |
| 63 | +# single payloads, there will be one ancestor reference name from `modules/payloads/singles`, while for staged |
| 64 | +# payloads there with be one ancestor reference name from `modules/payloads/stagers` and one ancestor reference name |
| 65 | +# from `modules/payloads/stages`. |
37 | 66 | # @option options [Pathname] :modules_pathname The `modules` directory from which to load `:ancestor_reference_names`.
|
38 | 67 | # @option options [String] :reference_name The reference name for payload class that should be instantiated from mixing
|
39 | 68 | # `:ancestor_reference_names`.
|
|
0 commit comments