-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle invalid payloads more clearly #11823
Handle invalid payloads more clearly #11823
Conversation
I'm seeing a handful of spec errors, both via Travis here on Github, and locally:
I think most of the issue is that a few of the test cases will need updating, but I'm unclear as to why some seemingly unrelated test cases are failing now. I'm happy to dig deeper later, but I'm going to call it a night for now. |
Thanks, I had notice the test failures earlier, will update them to match. |
Currently, if you have an error in a payload module (e.g. you have a syntax error in a module), the error is not noticed early enough in the generation process by the parameter validator, leading to a mysterious message like so: ``` Error: undefined method `platform' for nil:NilClass ``` This change cleans up some of the error handling, checks to see if the payload module can be instantiated, and gives a more useful error output for the different cases. This also tweaks some of the literal string outputs to match other exception strings from payload_generator.
ac9b2c7
to
621d404
Compare
Updated tests (and it found 1 bug, so fixed those too!) |
raise InvalidFormat, "invalid format: #{format}" unless format_is_valid? | ||
raise ArgumentError, "invalid payload: #{payload}" unless payload_is_valid? | ||
|
||
# A side-effecto of running framework.payloads.create is that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
effect
Merge branch 'land-11823' into upstream-master
Release notesError messaging have been improved for fatal conditions that occur while generating payloads. |
Merge branch 'land-11823' into upstream-master
Currently, if you have an error in a payload module (e.g. you have a syntax error in a module), the error is not noticed early enough in the generation process by the parameter validator, leading to a mysterious message like so from msfvenom, due to it failing to instantiate the payload module later in the process:
This change cleans up some of the error handling, checks to see if the payload
module can be instantiated, and gives a more useful error output for the
different cases. This also tweaks some of the literal string outputs to match
other exception strings from payload_generator.
Verification
./msfvenom -p linux/x86/shell_bind_tcp_random_portal
end
from a block, then try generating it:./msfvenom -p linux/x86/shell_bind_tcp_random_port