Skip to content

Commit 15fb720

Browse files
committed
pwn_nessus_cloud_scan_crud && pwn_nessus_cloud_vulnscan Drivers - rename pwn_nessus_cloud_create_scan to reflect ability to create, read, update, & delete scans #bugfix
1 parent 68a92cc commit 15fb720

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ rvm use ruby-3.1.2@pwn
3737
$ rvm list gemsets
3838
$ gem install --verbose pwn
3939
$ pwn
40-
pwn[v0.4.453]:001 >>> PWN.help
40+
pwn[v0.4.454]:001 >>> PWN.help
4141
```
4242

4343
[![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](https://youtu.be/G7iLUY4FzsI)
@@ -52,7 +52,7 @@ $ rvm use ruby-3.1.2@pwn
5252
$ gem uninstall --all --executables pwn
5353
$ gem install --verbose pwn
5454
$ pwn
55-
pwn[v0.4.453]:001 >>> PWN.help
55+
pwn[v0.4.454]:001 >>> PWN.help
5656
```
5757

5858

bin/pwn_nessus_cloud_scan_crud

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,10 @@ begin
314314
name: scan_name
315315
)
316316
if scan.any?
317-
scan_uuid = scan[:uuid]
317+
scan_id = scan[:id]
318318
update_scan_resp = PWN::Plugins::NessusCloud.update_scan(
319319
nessus_obj: nessus_obj,
320-
scan_uuid: scan_uuid,
320+
scan_id: scan_id,
321321
scan_template_uuid: scan_template_uuid,
322322
settings: settings,
323323
credentials: credentials,

bin/pwn_nessus_cloud_vulnscan

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ begin
5858
nessus_obj: nessus_obj,
5959
name: scan_name
6060
)
61-
scan_uuid = scan[:uuid]
61+
scan_id = scan[:id]
6262

6363
PWN::Plugins::NessusCloud.launch_scan(
6464
nessus_obj: nessus_obj,
65-
scan_uuid: scan_uuid
65+
scan_id: scan_id
6666
)
6767

6868
scan_status = 'initializing'
@@ -73,7 +73,7 @@ begin
7373

7474
scan_status_resp = PWN::Plugins::NessusCloud.get_scan_status(
7575
nessus_obj: nessus_obj,
76-
scan_uuid: scan_uuid
76+
scan_id: scan_id
7777
)
7878

7979
scan_status = scan_status_resp[:status]
@@ -87,7 +87,7 @@ begin
8787
print "Exporting results to #{path_to_export}..."
8888
PWN::Plugins::NessusCloud.export_scan_results(
8989
nessus_obj: nessus_obj,
90-
scan_uuid: scan_uuid,
90+
scan_id: scan_id,
9191
path_to_export: path_to_export,
9292
format: format
9393
)

lib/pwn/plugins/nessus_cloud.rb

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ module NessusCloud
458458
# Supported Method Parameters::
459459
# PWN::Plugins::NessusCloud.update_scan(
460460
# nessus_obj: 'required - nessus_obj returned from #login method',
461-
# scan_uuid: 'required - the scan UUID to update. Run #get_scans for a list of UUIDs',
461+
# scan_id: 'required - the scan id to update. Run #get_scans for a list',
462462
# scan_template_uuid: 'required - the UUID for the Tenable-provided scan template to use. Run #get_canned_scan_templates for a list of UUIDs',
463463
# settings: 'required - settings object as defined by https://developer.tenable.com/reference/scans-create',
464464
# credentials: 'required - credentials object as defined by https://developer.tenable.com/reference/scans-create',
@@ -467,7 +467,7 @@ module NessusCloud
467467

468468
public_class_method def self.update_scan(opts = {})
469469
nessus_obj = opts[:nessus_obj]
470-
scan_uuid = opts[:scan_uuid]
470+
scan_id = opts[:scan_id]
471471
scan_template_uuid = opts[:scan_template_uuid]
472472
settings = opts[:settings]
473473
credentials = opts[:credentials]
@@ -483,7 +483,7 @@ module NessusCloud
483483
update_scan_resp = nessus_cloud_rest_call(
484484
http_method: :put,
485485
nessus_obj: nessus_obj,
486-
rest_call: "scans/#{scan_uuid}",
486+
rest_call: "scans/#{scan_id}",
487487
http_body: http_body
488488
).body
489489

@@ -495,17 +495,17 @@ module NessusCloud
495495
# Supported Method Parameters::
496496
# PWN::Plugins::NessusCloud.launch_scan(
497497
# nessus_obj: 'required - nessus_obj returned from #login method',
498-
# scan_uuid: 'required - scan uuid to launch'
498+
# scan_id: 'required - scan uuid to launch'
499499
# )
500500

501501
public_class_method def self.launch_scan(opts = {})
502502
nessus_obj = opts[:nessus_obj]
503-
scan_uuid = opts[:scan_uuid]
503+
scan_id = opts[:scan_id]
504504

505505
launch_scan_resp = nessus_cloud_rest_call(
506506
http_method: :post,
507507
nessus_obj: nessus_obj,
508-
rest_call: "scans/#{scan_uuid}/launch"
508+
rest_call: "scans/#{scan_id}/launch"
509509
).body
510510

511511
JSON.parse(launch_scan_resp, symbolize_names: true)
@@ -516,16 +516,16 @@ module NessusCloud
516516
# Supported Method Parameters::
517517
# PWN::Plugins::NessusCloud.get_scan_status(
518518
# nessus_obj: 'required - nessus_obj returned from #login method',
519-
# scan_uuid: 'required - scan uuid to retrieve status'
519+
# scan_id: 'required - scan uuid to retrieve status'
520520
# )
521521

522522
public_class_method def self.get_scan_status(opts = {})
523523
nessus_obj = opts[:nessus_obj]
524-
scan_uuid = opts[:scan_uuid]
524+
scan_id = opts[:scan_id]
525525

526526
scan_status_resp = nessus_cloud_rest_call(
527527
nessus_obj: nessus_obj,
528-
rest_call: "scans/#{scan_uuid}/latest-status"
528+
rest_call: "scans/#{scan_id}/latest-status"
529529
).body
530530

531531
JSON.parse(scan_status_resp, symbolize_names: true)
@@ -568,16 +568,16 @@ module NessusCloud
568568
# Supported Method Parameters::
569569
# PWN::Plugins::NessusCloud.get_scan_history(
570570
# nessus_obj: 'required - nessus_obj returned from #login method'
571-
# scan_uuid: 'required - scan uuid to launch'
571+
# scan_id: 'required - scan uuid to launch'
572572
# )
573573

574574
public_class_method def self.get_scan_history(opts = {})
575575
nessus_obj = opts[:nessus_obj]
576-
scan_uuid = opts[:scan_uuid]
576+
scan_id = opts[:scan_id]
577577

578578
scan_hist_resp = nessus_cloud_rest_call(
579579
nessus_obj: nessus_obj,
580-
rest_call: "scans/#{scan_uuid}/history"
580+
rest_call: "scans/#{scan_id}/history"
581581
).body
582582

583583
JSON.parse(scan_hist_resp, symbolize_names: true)
@@ -588,22 +588,22 @@ module NessusCloud
588588
# Supported Method Parameters::
589589
# PWN::Plugins::NessusCloud.export_scan_results(
590590
# nessus_obj: 'required - nessus_obj returned from #login method',
591-
# scan_uuid: 'required - scan uuid to export',
591+
# scan_id: 'required - scan uuid to export',
592592
# path_to_export: 'required - filename to export results',
593593
# history_id: 'optional - defaults to last scan',
594594
# format: 'optional - :csv|:db|:html|:nessus|:pdf (defaults to :csv')
595595
# )
596596

597597
public_class_method def self.export_scan_results(opts = {})
598598
nessus_obj = opts[:nessus_obj]
599-
scan_uuid = opts[:scan_uuid]
599+
scan_id = opts[:scan_id]
600600
path_to_export = opts[:path_to_export]
601601
if opts[:history_id]
602602
history_id = opts[:history_id]
603603
else
604604
scan_history_resp = get_scan_history(
605605
nessus_obj: nessus_obj,
606-
scan_uuid: scan_uuid
606+
scan_id: scan_id
607607
)
608608

609609
if scan_history_resp[:history].empty?
@@ -618,15 +618,15 @@ module NessusCloud
618618
format = opts[:format].to_s.to_sym if opts[:format]
619619

620620
http_body = {
621-
scan_uuid: scan_uuid,
621+
scan_id: scan_id,
622622
history_id: history_id,
623623
format: format
624624
}.to_json
625625

626626
export_scan_resp = nessus_cloud_rest_call(
627627
http_method: :post,
628628
nessus_obj: nessus_obj,
629-
rest_call: "scans/#{scan_uuid}/export",
629+
rest_call: "scans/#{scan_id}/export",
630630
http_body: http_body
631631
).body
632632

@@ -637,7 +637,7 @@ module NessusCloud
637637

638638
download_export_resp = nessus_cloud_rest_call(
639639
nessus_obj: nessus_obj,
640-
rest_call: "scans/#{scan_uuid}/export/#{file_id}/download"
640+
rest_call: "scans/#{scan_id}/export/#{file_id}/download"
641641
).body
642642

643643
File.open(path_to_export, 'wb') do |f|
@@ -720,7 +720,7 @@ module NessusCloud
720720
721721
#{self}.update_scan(
722722
nessus_obj: 'required - nessus_obj returned from #login method',
723-
scan_uuid: 'required - the scan UUID to update. Run #get_scans for a list of UUIDs',
723+
scan_id: 'required - the scan id to update. Run #get_scans for a list',
724724
scan_template_uuid: 'required - the UUID for the Tenable-provided scan template to use. Run #get_canned_scan_templates for a list of UUIDs',
725725
settings: 'required - settings object as defined by https://developer.tenable.com/reference/scans-create',
726726
credentials: 'required - credentials object as defined by https://developer.tenable.com/reference/scans-create',
@@ -729,12 +729,12 @@ module NessusCloud
729729
730730
#{self}.launch_scan(
731731
nessus_obj: 'required - nessus_obj returned from #login method',
732-
scan_uuid: 'required - scan uuid to launch'
732+
scan_id: 'required - scan uuid to launch'
733733
)
734734
735735
#{self}.get_scan_status(
736736
nessus_obj: 'required - nessus_obj returned from #login method',
737-
scan_uuid: 'required - scan uuid to retrieve status'
737+
scan_id: 'required - scan uuid to retrieve status'
738738
)
739739
740740
#{self}.create_tag(
@@ -746,12 +746,12 @@ module NessusCloud
746746
747747
#{self}.get_scan_history(
748748
nessus_obj: 'required - nessus_obj returned from #login method'
749-
scan_uuid: 'required - scan uuid to launch'
749+
scan_id: 'required - scan uuid to launch'
750750
)
751751
752752
#{self}.export_scan_results(
753753
nessus_obj: 'required - nessus_obj returned from #login method',
754-
scan_uuid: 'required - scan uuid to export',
754+
scan_id: 'required - scan uuid to export',
755755
path_to_export: 'required - filename to export results',
756756
history_id: 'optional - defaults to last scan',
757757
format: 'optional - :csv|:db|:html|:nessus|:pdf (defaults to :csv')

lib/pwn/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module PWN
4-
VERSION = '0.4.453'
4+
VERSION = '0.4.454'
55
end

0 commit comments

Comments
 (0)