support iterating across RHOSTS for exploits

GSoC/Meterpreter_Web_Console
Brent Cook 2017-11-28 04:47:31 -06:00
parent 4ab36bc713
commit 17c8f7c4c7
1 changed files with 5 additions and 2 deletions

View File

@ -46,8 +46,9 @@ class Exploit
"Exploit"
end
def exploit_single(opts)
def exploit_single(opts, rhost)
begin
mod.datastore['RHOST'] = rhost
session = mod.exploit_simple(opts)
rescue ::Interrupt
raise $!
@ -176,7 +177,9 @@ class Exploit
opts['Payload'] = Exploit.choose_payload(mod, opts['Target'])
end
exploit_single(opts)
Rex::Socket::RangeWalker.new(mod.datastore['RHOSTS']).each do |rhost|
exploit_single(opts, rhost)
end
end
alias cmd_run cmd_exploit