I think it will be great to have a module that can accomplish this in a generic way.
For example, the options that the module should take are:
I am thinking about extending either Auxiliary class or Exploit class to accomplish this. It will be great if you can give me some ideas on what do you think on this issue.
The difficulties here is different exploits have different options. We will create a new_module with a module called generic_exploit. Then user can do the following:
I reckon this is feasible and does not require a huge amount of effort. I am not sure about adding a new command to metasploit is a good idea or not. So I am happy to hear your opinion.
Thanks.
I like this idea, I've always wanted it too. However, this would be a challenge for the current architecture considering the handler is meant to receive only one type of payload by default.
For example, if you have a multi-platform exploit that targets Windows and Linux, and that a cross-platform payload isn't an option, your exploit would only work one of those platforms.
Also, some modules may require the user to tweak the settings based on the target or platform they're attacking.
There might be other challenges I haven't thought of, I think @egypt is good candidate to bring in this conversation.
@wchen-r7 we are working on an actual 'Multi' handler for Meterpreter payloads - see the work that @OJ is currently engaged in.
I do believe that, even if we didn't have that, that this feature would still be useful much of the time.
@bcook-r7 Did you guys want to add the RHOSTS feature within the scope too? Or separate?
Im thinking about using some OOP design. I will have a look at it and suggest some solutions.
As @wchen-r7 alluded to, this would require a major architectural change. The handler is not the only problem. Payload settings and TARGET are also dependent on the victim and many exploits cannot know which target to select.
If the handler problem is solved, it may be possible for something like this to work for some exploits, or even classes of exploits, but I don't think it's possible to generically work for all exploits.
is there any update on this issue?
is there any way to set rhosts and loop over them trying to exploit or not?
one-liner RC script that does what you want for now:
<ruby> framework.db.hosts.each do |host| {self.run_single("set RHOST #{host}"); self.run_single("exploit");}</ruby>
Most helpful comment
one-liner RC script that does what you want for now: