Add opt --sec-name for msfvenom; Implement -S, -P for cmd dispatcher #11400
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.
Add option
--sec-name <String>
tomsfvenom
to give the user the ability to specify a custom section header name when generating (large) Windows binaries that require a new section to fit the payload. Resolves #6637Implement
--sec-name
and--pad-nops
formsfconsole
command dispatcher (to use on a payload module directly).To keep things clean, no console output was added/modified in these implementations (aside from option help menus).
msfvenom Verification
msfvenom
with--sec-name
option on the console.Console Output
In the above example, the user specifies a new section header name "pdata" when generating a stageless payload with the default template.
To verify the section name was added to the PE, you can open the .exe in a PE viewer, such as CFF Explorer, as shown in this screenshot.
Command dispatcher verification
msfconsole
and use a payload. Set necessary parameters.generate
on any payload module with options -S (section name) or -P (pad nops).Here's an example of -P. Notice the
diff
output; 100 bytes is a result of-S 100
option, automatically prepending (100-63=37) nops.Here's an example of -S.
And here's proof that the above example command
generate -S pdata -f exe -o secname-cmddispatch.exe
generates the correct section header name: screenshot