Module: Nessus::Client::Scan
- Included in:
- Nessus::Client
- Defined in:
- lib/nessus/client/scan.rb
Overview
Instance Method Summary collapse
-
#scan_list ⇒ Array<Hash>
GET /scan/list.
-
#scan_new(target, policy_id, scan_name, seq = nil, description = nil) ⇒ Hash
POST /scan/new.
-
#scan_pause(scan_uuid) ⇒ Object
POST /scan/pause.
-
#scan_resume(scan_uuid) ⇒ Object
POST /scan/resume.
-
#scan_stop(scan_uuid) ⇒ Object
POST /scan/stop.
-
#scan_template_new(template_name, policy_id, target, seq = nil, start_time = nil, rrules = nil) ⇒ Object
POST /scan/template/new.
Instance Method Details
#scan_list ⇒ Array<Hash>
GET /scan/list
33 34 35 36 |
# File 'lib/nessus/client/scan.rb', line 33 def scan_list response = get '/scan/list' response['reply']['contents'] end |
#scan_new(target, policy_id, scan_name, seq = nil, description = nil) ⇒ Hash
POST /scan/new
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/nessus/client/scan.rb', line 13 def scan_new(target, policy_id, scan_name, seq = nil, description = nil) payload = { :custom_targets => target, :policy_id => policy_id, :name => scan_name } payload[:seq] = seq if seq payload[:description] = description if description response = post '/scan/new', payload if response['error'] raise Nessus::UnknownError, response['error'] end response['reply']['contents'] # ['scan'] end |
#scan_pause(scan_uuid) ⇒ Object
POST /scan/pause
53 54 55 56 |
# File 'lib/nessus/client/scan.rb', line 53 def scan_pause(scan_uuid) response = post '/scan/pause', :scan_uuid => scan_uuid response['reply']['contents'] end |
#scan_resume(scan_uuid) ⇒ Object
POST /scan/resume
63 64 65 66 |
# File 'lib/nessus/client/scan.rb', line 63 def scan_resume(scan_uuid) response = post '/scan/resume', :scan_uuid => scan_uuid response['reply']['contents'] end |
#scan_stop(scan_uuid) ⇒ Object
POST /scan/stop
43 44 45 46 |
# File 'lib/nessus/client/scan.rb', line 43 def scan_stop(scan_uuid) response = post '/scan/stop', :scan_uuid => scan_uuid response['reply']['contents'] end |
#scan_template_new(template_name, policy_id, target, seq = nil, start_time = nil, rrules = nil) ⇒ Object
POST /scan/template/new
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/nessus/client/scan.rb', line 75 def scan_template_new(template_name, policy_id, target, seq = nil, start_time = nil, rrules = nil) payload = { :template_name => template_name, :policy_id => policy_id, :target => target } payload[:seq] = seq if seq payload[:startTime] = start_time if start_time payload[:rRules] = rrules if rrules response = post '/scan/template/new', payload if response['reply']['status'].eql? 'ERROR' raise Nessus::UnknownError, response['reply']['contents'] end response['reply']['contents'] # ['scan'] end |