Skip to content
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

Add error handling when loading payloads #18220

Merged

Conversation

dwelch-r7
Copy link
Contributor

@dwelch-r7 dwelch-r7 commented Jul 26, 2023

Adding in some error handling to payload loading so we don't crash msfconsole on boot as described here #18198 (note that the root cause of the issue described in #18198 is already addressed in #18171 where I borrowed some of this code from)

To replicate the original issue:

  • boot up msfconsole
  • setg payload windows/x64/meterpreter/reverse_tcp # This sets the payload datastore option globally
  • exit and then restart msfconsole
  • It should crash

Verification Steps

  • msfconsole no longer crashes on boot up with a globally set payload datastore option
  • The error is logged to ~/.msf4/logs/framework.log

@dwelch-r7 dwelch-r7 force-pushed the add-nil-checks-to-payload-creation branch from 6f281c6 to d9817e8 Compare July 26, 2023 11:02
Copy link
Contributor

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May not be viable the more I look at the slight variation but might also be able to expand the refactor make the process more generic too.

lib/msf/core/payload_set.rb Show resolved Hide resolved
@adfoster-r7 adfoster-r7 merged commit a543199 into rapid7:master Aug 4, 2023
34 checks passed
@adfoster-r7 adfoster-r7 added the rn-fix release notes fix label Aug 4, 2023
@adfoster-r7
Copy link
Contributor

Release Notes

Adds additional error handling when loading Metasploit payloads to msfconsole's startup process to ensure missing payloads do not crash msfconsole

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-fix release notes fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants