support iterating across RHOSTS for exploits
parent
4ab36bc713
commit
17c8f7c4c7
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue