add the run_command and open_uri commands back in
git-svn-id: file:///home/svn/framework3/trunk@12767 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
1ba8db7321
commit
840b20a371
|
@ -40,8 +40,8 @@ class Plugin::Lab < Msf::Plugin
|
|||
"lab_stop" => "lab_stop [vmid+|all] stop the specified vm.",
|
||||
"lab_revert" => "lab_revert [vmid+|all] [snapshot] revert the specified vm.",
|
||||
"lab_snapshot" => "lab_snapshot [vmid+|all] [snapshot] snapshot all targets for this exploit."
|
||||
#"lab_run_command" => "lab_run_command [vmid+|all] [command] run a command on all targets.",
|
||||
#"lab_browse_to" => "lab_browse_to [vmid+|all] [uri] use the default browser to browse to a uri."
|
||||
"lab_run_command" => "lab_run_command [vmid+|all] [command] run a command on all targets.",
|
||||
"lab_browse_to" => "lab_browse_to [vmid+|all] [uri] use the default browser to browse to a uri."
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -282,13 +282,31 @@ class Plugin::Lab < Msf::Plugin
|
|||
def cmd_lab_run_command(*args)
|
||||
return lab_usage if args.empty?
|
||||
command = args[args.count-1]
|
||||
print_line "not implemented"
|
||||
if args[0] == "all"
|
||||
print_line "Running command #{command} on all vms."
|
||||
@controller.each{ |vm| vm.run_command(command) }
|
||||
else
|
||||
args[0..-2].each do |vmid_arg|
|
||||
next unless @controller.includes_vmid? vmid_arg
|
||||
print_line "#{vmid_arg} running command: #{command}."
|
||||
@controller[vmid_arg].run_command(command)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def cmd_lab_browse_to(*args)
|
||||
return lab_usage if args.empty?
|
||||
uri = args[args.count-1]
|
||||
print_line "not implemented"
|
||||
if args[0] == "all"
|
||||
print_line "Opening: #{uri} on all vms."
|
||||
@controller.each{ |vm| vm.open_uri(snapshot) }
|
||||
else
|
||||
args[0..-2].each do |vmid_arg|
|
||||
next unless @controller.includes_vmid? vmid_arg
|
||||
print_line "#{vmid_arg} opening to uri: #{uri}."
|
||||
@controller[vmid_arg].open_uri(snapshot)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in New Issue