Updated script for new methods
git-svn-id: file:///home/svn/framework3/trunk@8736 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
bfe0e013da
commit
b0da8cf6d3
|
@ -22,10 +22,12 @@ def script_exec(session,scrptlst)
|
|||
print_status("Running script List ...")
|
||||
scrptlst.each_line do |scrpt|
|
||||
begin
|
||||
script_components = scrpt.split(" ")
|
||||
script = script_components.shift
|
||||
script_args = script_components.join(" ")
|
||||
script_path = Msf::Sessions::Meterpreter.find_script_path(script)
|
||||
print_status "\trunning script #{scrpt.chomp}"
|
||||
client = session
|
||||
args = scrpt.chomp.split
|
||||
session.execute_script(args.shift,binding)
|
||||
session.execute_script(script_path, script_args)
|
||||
rescue ::Exception => e
|
||||
print_error("Error: #{e.class} #{e}")
|
||||
print_error("Error in script: #{scrpt}")
|
||||
|
@ -40,11 +42,11 @@ end
|
|||
|
||||
################## Main ##################
|
||||
@@exec_opts.parse(args) do |opt, idx, val|
|
||||
case opt
|
||||
case opt
|
||||
|
||||
when "-c"
|
||||
when "-c"
|
||||
commands = val.gsub(/;/,"\n")
|
||||
when "-s"
|
||||
when "-s"
|
||||
script = val
|
||||
if not ::File.exists?(script)
|
||||
raise "Script List File does not exists!"
|
||||
|
@ -53,9 +55,9 @@ when "-s"
|
|||
commands << line
|
||||
end
|
||||
end
|
||||
when "-h"
|
||||
when "-h"
|
||||
help = 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if args.length == 0 or help == 1
|
||||
|
|
Loading…
Reference in New Issue