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
Job persist function doesn't seem to work #18995
Comments
It looks like changing the 'Options' key to 'OptionStr' does parse it correctly but the job still is not starting. Also it is a space sperated string and I think the multi/meterpreter/reverse_https payload has spaces in a couple fields like 'HttpUserAgent' and 'HttpUnknownRequestResponse'.
|
I was able to get it to work by changing
but it throws an error on
|
Thanks for the pull request! Sorry that there's been a bit of a race condition here, I had a PoC working for a fix when I self-assigned the issue but was going to put up a pull request for it later - but I see you were able to get a solution working too in that time! 💯 I think we've achieved the same end result here, but I've wired up some extra things: #19002 If you want to test that the above PR works, I'd be able to merge mine in - then I could merge in the logging changes that you've added to |
Yeah it works great. It looks like you were able to get everything I had and more. I added the datastore.to_h to I also think the 'LocalOutput' option is not being written to the file but I havent verified that yet. Thanks |
I just added an update to payload_option = ctx_1.datastore.user_defined.to_h
|
Steps to reproduce
How'd you do it?
Expected behavior
What should happen?
Job should survive.
Current behavior
What happens instead?
Job does not.
In persist file it stores payload options with key 'Options' and the value as a string like
[
{
"mod_name": "exploit/multi/handler",
"mod_options": {
"Payload": "linux/x64/meterpreter/reverse_tcp",
"Options": "AppendExit=false ... WfsDelay=2 payload=linux/x64/meterpreter/reverse_tcp ",
"RunAsJob": true
}
}
]
When parsing the options it tries to do a .each on the string resulting in load fail with this entry in log...
[03/22/2024 10:34:11] [e(0)] core: Exploit failed (multi/handler) - NoMethodError undefined method `each' for "AppendExit=false ... WfsDelay=2 payload=linux/x64/meterpreter/reverse_tcp ":String
It looks like it dumps the datastore into the persist file in
metasploit-framework/lib/msf/ui/console/command_dispatcher/jobs.rb
Line 247 in 11c24ec
And starts to load it here
metasploit-framework/lib/msf/ui/console/driver.rb
Line 211 in 11c24ec
Metasploit version
Framework: 6.4.0-dev
Console : 6.4.0-dev
The text was updated successfully, but these errors were encountered: