support iterating across RHOSTS for exploits
parent
4ab36bc713
commit
17c8f7c4c7
|
@ -46,8 +46,9 @@ class Exploit
|
||||||
"Exploit"
|
"Exploit"
|
||||||
end
|
end
|
||||||
|
|
||||||
def exploit_single(opts)
|
def exploit_single(opts, rhost)
|
||||||
begin
|
begin
|
||||||
|
mod.datastore['RHOST'] = rhost
|
||||||
session = mod.exploit_simple(opts)
|
session = mod.exploit_simple(opts)
|
||||||
rescue ::Interrupt
|
rescue ::Interrupt
|
||||||
raise $!
|
raise $!
|
||||||
|
@ -176,7 +177,9 @@ class Exploit
|
||||||
opts['Payload'] = Exploit.choose_payload(mod, opts['Target'])
|
opts['Payload'] = Exploit.choose_payload(mod, opts['Target'])
|
||||||
end
|
end
|
||||||
|
|
||||||
exploit_single(opts)
|
Rex::Socket::RangeWalker.new(mod.datastore['RHOSTS']).each do |rhost|
|
||||||
|
exploit_single(opts, rhost)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
alias cmd_run cmd_exploit
|
alias cmd_run cmd_exploit
|
||||||
|
|
Loading…
Reference in New Issue