From d8beb8cfefe1802e9c68144c52fce76751877a8c Mon Sep 17 00:00:00 2001 From: Y1Daa <1147042405@qq.com> Date: Sun, 7 May 2023 21:27:50 +0800 Subject: [PATCH 1/2] fix nessus_db_import & nessus_scan_export bugs --- plugins/nessus.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/nessus.rb b/plugins/nessus.rb index 5620dbbbdc6c..2308e7509cdd 100644 --- a/plugins/nessus.rb +++ b/plugins/nessus.rb @@ -1190,6 +1190,7 @@ def cmd_nessus_db_import(*args) if is_scan_complete(scan_id) print_status("Exporting scan ID #{scan_id} is Nessus format...") export = @n.scan_export(scan_id, 'nessus') + status = nil if export['file'] file_id = export['file'] print_good("The export file ID for scan ID #{scan_id} is #{file_id}") @@ -1485,6 +1486,7 @@ def cmd_nessus_scan_export(*args) end if format.in?(['nessus', 'html', 'pdf', 'csv', 'db']) export = @n.scan_export(scan_id, format) + status = nil if export['file'] file_id = export['file'] print_good("The export file ID for scan ID #{scan_id} is #{file_id}") @@ -1526,6 +1528,7 @@ def cmd_nessus_scan_export_status(*args) when 2 scan_id = args[0] file_id = args[1] + status = nil loop do status = @n.scan_export_status(scan_id, file_id) print_status('Export status: ' + status['status']) From d91a9638fc3da764c1299da0cf8381a959d02b33 Mon Sep 17 00:00:00 2001 From: Simon Janusz Date: Mon, 11 Sep 2023 15:20:18 +0100 Subject: [PATCH 2/2] Use empty hash instead of nil for nessus status --- plugins/nessus.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/nessus.rb b/plugins/nessus.rb index 2308e7509cdd..9a881e7ee669 100644 --- a/plugins/nessus.rb +++ b/plugins/nessus.rb @@ -1190,7 +1190,7 @@ def cmd_nessus_db_import(*args) if is_scan_complete(scan_id) print_status("Exporting scan ID #{scan_id} is Nessus format...") export = @n.scan_export(scan_id, 'nessus') - status = nil + status = {} if export['file'] file_id = export['file'] print_good("The export file ID for scan ID #{scan_id} is #{file_id}") @@ -1486,7 +1486,7 @@ def cmd_nessus_scan_export(*args) end if format.in?(['nessus', 'html', 'pdf', 'csv', 'db']) export = @n.scan_export(scan_id, format) - status = nil + status = {} if export['file'] file_id = export['file'] print_good("The export file ID for scan ID #{scan_id} is #{file_id}") @@ -1528,7 +1528,7 @@ def cmd_nessus_scan_export_status(*args) when 2 scan_id = args[0] file_id = args[1] - status = nil + status = {} loop do status = @n.scan_export_status(scan_id, file_id) print_status('Export status: ' + status['status'])