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

guard persist on handler existence #14393

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

jmartin-tech
Copy link
Contributor

@jmartin-tech jmartin-tech commented Nov 13, 2020

Short term fix to only persist jobs with handlers. More work should
be done to improve job persistence to allow more jobs types to persist.

Verification

List the steps needed to make sure this thing works

  • Start msfconsole
  • use exploit/multi/handler
  • set LHOST <IP_ADDRESS>
  • set payload windows/meterpreter/reverse_tcp
  • run -j
  • jobs -P
  • use socks_proxy
  • `set LHOST <IP_ADDRESS>
  • run
  • jobs -v
  • jobs -P
  • Verify all command complete successfully (second jobs -P will report socks_proxy job is not a handler)

Short term fix to only persist jobs with handlers. More work should
be done to improve job persistence to allow more jobs types to persist.
@jmartin-tech
Copy link
Contributor Author

Note for future travelers, auxiliary module set context values in the ctx array position expected to contain the handler details. This results in undefined behavior when code expects ctx[1] to be handler details.

Job context should be more explicit and ctx should probably be either be a hash with known keys or an object with accessors

@zeroSteiner
Copy link
Contributor

Looks perhaps related to #13593 (which has a corresponding PR).

@mubix
Copy link
Contributor

mubix commented Nov 16, 2020

This fix worked for me. Thanks!

@dwelch-r7
Copy link
Contributor

image
Looks good to me!

@dwelch-r7 dwelch-r7 self-assigned this Nov 17, 2020
@dwelch-r7 dwelch-r7 merged commit f910d64 into rapid7:master Nov 17, 2020
@dwelch-r7 dwelch-r7 added the bug label Nov 17, 2020
@dwelch-r7
Copy link
Contributor

dwelch-r7 commented Nov 17, 2020

Release Notes

Fixed a crash related to the verbose output of jobs with jobs -v, and persistence of jobs with jobs -P, when auxiliary jobs were present.

@jmartin-tech jmartin-tech deleted the guard-job-persist branch November 17, 2020 15:52
@pbarry-r7 pbarry-r7 added the rn-fix release notes fix label Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug rn-fix release notes fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants