Refactor "et"-Hashmap in nessus.rb

bug/bundler_fix
Dennis Herrmann 2016-12-13 22:36:03 +01:00
parent ac324cb371
commit 8c99a1a00d
1 changed files with 24 additions and 21 deletions

View File

@ -968,13 +968,14 @@ module Msf
end end
if valid_policy(uuid) if valid_policy(uuid)
print_status("Creating scan from policy number #{uuid}, called #{scan_name} - #{description} and scanning #{targets}") print_status("Creating scan from policy number #{uuid}, called #{scan_name} - #{description} and scanning #{targets}")
et=Hash.new et = {
et['enabled']=false 'enabled' => false,
et['launch']='ONETIME' 'launch' => 'ONETIME',
et['name']=scan_name 'name' => scan_name,
et['text_targets']=targets 'text_targets' => targets,
et['description']=description 'description' => description,
et['launch_now']=false 'launch_now' => false
}
scan = @n.scan_create(uuid, et) scan = @n.scan_create(uuid, et)
tbl = Rex::Text::Table.new( tbl = Rex::Text::Table.new(
'Columns' => [ 'Columns' => [
@ -1077,13 +1078,14 @@ module Msf
end end
targets.chop! targets.chop!
print_status("Creating scan from policy #{policy_id}, called \"#{name}\" and scanning all hosts in all the workspaces") print_status("Creating scan from policy #{policy_id}, called \"#{name}\" and scanning all hosts in all the workspaces")
et=Hash.new et = {
et['enabled']=false 'enabled' => false,
et['launch']='ONETIME' 'launch' => 'ONETIME',
et['name']=name 'name' => name,
et['text_targets']=targets 'text_targets' => targets,
et['description']=desc 'description' => desc,
et['launch_now']=true 'launch_now' => true
}
scan = @n.scan_create(policy_id, et) scan = @n.scan_create(policy_id, et)
if !scan["error"] if !scan["error"]
scan = scan["scan"] scan = scan["scan"]
@ -1136,13 +1138,14 @@ module Msf
end end
targets.chop! targets.chop!
print_status("Creating scan from policy #{policy_id}, called \"#{name}\" and scanning all hosts in #{framework.db.workspace.name}") print_status("Creating scan from policy #{policy_id}, called \"#{name}\" and scanning all hosts in #{framework.db.workspace.name}")
et=Hash.new et = {
et['enabled']=false 'enabled' => false,
et['launch']='ONETIME' 'launch' => 'ONETIME',
et['name']=name 'name' => name,
et['text_targets']=targets 'text_targets' => targets,
et['description']=desc 'description' => desc,
et['launch_now']=false 'launch_now' => false
}
scan = @n.scan_create(policy_id, et) scan = @n.scan_create(policy_id, et)
if !scan["error"] if !scan["error"]
scan = scan["scan"] scan = scan["scan"]