Add payload support definition & support for custom user payloads #459
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for adding explicit payload support to an exploit. This provides a few things:
BYOP
Now when a payload adds support via
config.AddPayloaddepending on the supported payloads. The file based (ELF, SO, .exe, .dll, webshell) types will add a-payloadoption that will automatically read a file from disk and add it toconfig.CustomPayloadif the user uses the flag.If the user uses one of the new
payload.*Commandtypes then-commandflag will be available andconfig.CustomPayloadwill contain the value provided by that flag (or it can be accessed directly from the normal flag handling for the string type).An example of how to define the code for this:
Now when the exploit is run the following options can be seen:
If a payload is defined with only one architecture
-payload-archwill not show up and if only one payload type is defined-payload-typewill also disappear. For example:will yield the following flags with none of the others:
The developer can then handle the specific cases:
Or if there is a complex case where more specificity is required:
Payload and Exploit Effects
You can now define payload effects. The above example adds a list of payload effects if the default payload is used. An example of how this is now available in the details listing from the above example:
This is part of #434
Undraft requirements: