Skip to content

Commit 8c99a1a

Browse files
author
Dennis Herrmann
committed
Refactor "et"-Hashmap in nessus.rb
1 parent ac324cb commit 8c99a1a

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

plugins/nessus.rb

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -968,13 +968,14 @@ def cmd_nessus_scan_new(*args)
968968
end
969969
if valid_policy(uuid)
970970
print_status("Creating scan from policy number #{uuid}, called #{scan_name} - #{description} and scanning #{targets}")
971-
et=Hash.new
972-
et['enabled']=false
973-
et['launch']='ONETIME'
974-
et['name']=scan_name
975-
et['text_targets']=targets
976-
et['description']=description
977-
et['launch_now']=false
971+
et = {
972+
'enabled' => false,
973+
'launch' => 'ONETIME',
974+
'name' => scan_name,
975+
'text_targets' => targets,
976+
'description' => description,
977+
'launch_now' => false
978+
}
978979
scan = @n.scan_create(uuid, et)
979980
tbl = Rex::Text::Table.new(
980981
'Columns' => [
@@ -1077,13 +1078,14 @@ def cmd_nessus_db_scan(*args)
10771078
end
10781079
targets.chop!
10791080
print_status("Creating scan from policy #{policy_id}, called \"#{name}\" and scanning all hosts in all the workspaces")
1080-
et=Hash.new
1081-
et['enabled']=false
1082-
et['launch']='ONETIME'
1083-
et['name']=name
1084-
et['text_targets']=targets
1085-
et['description']=desc
1086-
et['launch_now']=true
1081+
et = {
1082+
'enabled' => false,
1083+
'launch' => 'ONETIME',
1084+
'name' => name,
1085+
'text_targets' => targets,
1086+
'description' => desc,
1087+
'launch_now' => true
1088+
}
10871089
scan = @n.scan_create(policy_id, et)
10881090
if !scan["error"]
10891091
scan = scan["scan"]
@@ -1136,13 +1138,14 @@ def cmd_nessus_db_scan_workspace(*args)
11361138
end
11371139
targets.chop!
11381140
print_status("Creating scan from policy #{policy_id}, called \"#{name}\" and scanning all hosts in #{framework.db.workspace.name}")
1139-
et=Hash.new
1140-
et['enabled']=false
1141-
et['launch']='ONETIME'
1142-
et['name']=name
1143-
et['text_targets']=targets
1144-
et['description']=desc
1145-
et['launch_now']=false
1141+
et = {
1142+
'enabled' => false,
1143+
'launch' => 'ONETIME',
1144+
'name' => name,
1145+
'text_targets' => targets,
1146+
'description' => desc,
1147+
'launch_now' => false
1148+
}
11461149
scan = @n.scan_create(policy_id, et)
11471150
if !scan["error"]
11481151
scan = scan["scan"]

0 commit comments

Comments
 (0)