Go all in with JSON format, rename var to get more readable.
parent
bdb663b078
commit
2394e92c1c
|
@ -179,19 +179,21 @@ class Driver < Msf::Ui::Driver
|
||||||
end
|
end
|
||||||
|
|
||||||
# Process persistent job handler
|
# Process persistent job handler
|
||||||
persist_handler = File.open(Msf::Config.persist_file,"r").readlines.map!(&:chomp) rescue nil
|
begin
|
||||||
|
restore_handlers = JSON.parse(File.read(Msf::Config.persist_file))
|
||||||
|
rescue Errno::ENOENT, JSON::ParserError
|
||||||
|
restore_handlers = nil
|
||||||
|
end
|
||||||
|
|
||||||
unless persist_handler.blank?
|
unless restore_handlers.nil?
|
||||||
persist_handler.map!{|handler|JSON.parse(handler)}
|
print_status("Starting persistent handler(s)...")
|
||||||
print_status("Starting persistent handler...")
|
|
||||||
|
|
||||||
persist_handler.each do |handler_opts|
|
restore_handlers.each do |handler_opts|
|
||||||
handler = framework.modules.create(handler_opts['mod_name'])
|
handler = framework.modules.create(handler_opts['mod_name'])
|
||||||
handler.exploit_simple(handler_opts['mod_options'])
|
handler.exploit_simple(handler_opts['mod_options'])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Process any additional startup commands
|
# Process any additional startup commands
|
||||||
if opts['XCommands'] and opts['XCommands'].kind_of? Array
|
if opts['XCommands'] and opts['XCommands'].kind_of? Array
|
||||||
opts['XCommands'].each { |c|
|
opts['XCommands'].each { |c|
|
||||||
|
|
Loading…
Reference in New Issue