pwn 0.4.453 → 0.4.454
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/bin/pwn_nessus_cloud_scan_crud +2 -2
- data/bin/pwn_nessus_cloud_vulnscan +4 -4
- data/lib/pwn/plugins/nessus_cloud.rb +23 -23
- data/lib/pwn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7706d2f67e06a72947df5fba37be484be147119aee1d537a5172b650619ee753
|
|
4
|
+
data.tar.gz: 1254894deed2a1e8c72dc0c90e9924abd5d56d22a84a2d8f7305d8c22b94a8ed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b05ab90c4110617d5bf15bfa590e32af4fe19bf70e7791d8571c2907c45dbe53470ae1364a0568e04366bfcf7c7eda13f18fdf0f5a639e6502d482fd88a364e
|
|
7
|
+
data.tar.gz: 07bddeec0fd64dd636c738f644ea32f843bcf4237755a596fd9c4a80c1945cd6e8fe43e185e9716ba40d19e5731baf1ce427f93364c1d760d6e002b834908969
|
data/README.md
CHANGED
|
@@ -37,7 +37,7 @@ $ rvm use ruby-3.1.2@pwn
|
|
|
37
37
|
$ rvm list gemsets
|
|
38
38
|
$ gem install --verbose pwn
|
|
39
39
|
$ pwn
|
|
40
|
-
pwn[v0.4.
|
|
40
|
+
pwn[v0.4.454]:001 >>> PWN.help
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.1.2@pwn
|
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
|
53
53
|
$ gem install --verbose pwn
|
|
54
54
|
$ pwn
|
|
55
|
-
pwn[v0.4.
|
|
55
|
+
pwn[v0.4.454]:001 >>> PWN.help
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
|
|
@@ -314,10 +314,10 @@ begin
|
|
|
314
314
|
name: scan_name
|
|
315
315
|
)
|
|
316
316
|
if scan.any?
|
|
317
|
-
|
|
317
|
+
scan_id = scan[:id]
|
|
318
318
|
update_scan_resp = PWN::Plugins::NessusCloud.update_scan(
|
|
319
319
|
nessus_obj: nessus_obj,
|
|
320
|
-
|
|
320
|
+
scan_id: scan_id,
|
|
321
321
|
scan_template_uuid: scan_template_uuid,
|
|
322
322
|
settings: settings,
|
|
323
323
|
credentials: credentials,
|
|
@@ -58,11 +58,11 @@ begin
|
|
|
58
58
|
nessus_obj: nessus_obj,
|
|
59
59
|
name: scan_name
|
|
60
60
|
)
|
|
61
|
-
|
|
61
|
+
scan_id = scan[:id]
|
|
62
62
|
|
|
63
63
|
PWN::Plugins::NessusCloud.launch_scan(
|
|
64
64
|
nessus_obj: nessus_obj,
|
|
65
|
-
|
|
65
|
+
scan_id: scan_id
|
|
66
66
|
)
|
|
67
67
|
|
|
68
68
|
scan_status = 'initializing'
|
|
@@ -73,7 +73,7 @@ begin
|
|
|
73
73
|
|
|
74
74
|
scan_status_resp = PWN::Plugins::NessusCloud.get_scan_status(
|
|
75
75
|
nessus_obj: nessus_obj,
|
|
76
|
-
|
|
76
|
+
scan_id: scan_id
|
|
77
77
|
)
|
|
78
78
|
|
|
79
79
|
scan_status = scan_status_resp[:status]
|
|
@@ -87,7 +87,7 @@ begin
|
|
|
87
87
|
print "Exporting results to #{path_to_export}..."
|
|
88
88
|
PWN::Plugins::NessusCloud.export_scan_results(
|
|
89
89
|
nessus_obj: nessus_obj,
|
|
90
|
-
|
|
90
|
+
scan_id: scan_id,
|
|
91
91
|
path_to_export: path_to_export,
|
|
92
92
|
format: format
|
|
93
93
|
)
|
|
@@ -458,7 +458,7 @@ module PWN
|
|
|
458
458
|
# Supported Method Parameters::
|
|
459
459
|
# PWN::Plugins::NessusCloud.update_scan(
|
|
460
460
|
# nessus_obj: 'required - nessus_obj returned from #login method',
|
|
461
|
-
#
|
|
461
|
+
# scan_id: 'required - the scan id to update. Run #get_scans for a list',
|
|
462
462
|
# scan_template_uuid: 'required - the UUID for the Tenable-provided scan template to use. Run #get_canned_scan_templates for a list of UUIDs',
|
|
463
463
|
# settings: 'required - settings object as defined by https://developer.tenable.com/reference/scans-create',
|
|
464
464
|
# credentials: 'required - credentials object as defined by https://developer.tenable.com/reference/scans-create',
|
|
@@ -467,7 +467,7 @@ module PWN
|
|
|
467
467
|
|
|
468
468
|
public_class_method def self.update_scan(opts = {})
|
|
469
469
|
nessus_obj = opts[:nessus_obj]
|
|
470
|
-
|
|
470
|
+
scan_id = opts[:scan_id]
|
|
471
471
|
scan_template_uuid = opts[:scan_template_uuid]
|
|
472
472
|
settings = opts[:settings]
|
|
473
473
|
credentials = opts[:credentials]
|
|
@@ -483,7 +483,7 @@ module PWN
|
|
|
483
483
|
update_scan_resp = nessus_cloud_rest_call(
|
|
484
484
|
http_method: :put,
|
|
485
485
|
nessus_obj: nessus_obj,
|
|
486
|
-
rest_call: "scans/#{
|
|
486
|
+
rest_call: "scans/#{scan_id}",
|
|
487
487
|
http_body: http_body
|
|
488
488
|
).body
|
|
489
489
|
|
|
@@ -495,17 +495,17 @@ module PWN
|
|
|
495
495
|
# Supported Method Parameters::
|
|
496
496
|
# PWN::Plugins::NessusCloud.launch_scan(
|
|
497
497
|
# nessus_obj: 'required - nessus_obj returned from #login method',
|
|
498
|
-
#
|
|
498
|
+
# scan_id: 'required - scan uuid to launch'
|
|
499
499
|
# )
|
|
500
500
|
|
|
501
501
|
public_class_method def self.launch_scan(opts = {})
|
|
502
502
|
nessus_obj = opts[:nessus_obj]
|
|
503
|
-
|
|
503
|
+
scan_id = opts[:scan_id]
|
|
504
504
|
|
|
505
505
|
launch_scan_resp = nessus_cloud_rest_call(
|
|
506
506
|
http_method: :post,
|
|
507
507
|
nessus_obj: nessus_obj,
|
|
508
|
-
rest_call: "scans/#{
|
|
508
|
+
rest_call: "scans/#{scan_id}/launch"
|
|
509
509
|
).body
|
|
510
510
|
|
|
511
511
|
JSON.parse(launch_scan_resp, symbolize_names: true)
|
|
@@ -516,16 +516,16 @@ module PWN
|
|
|
516
516
|
# Supported Method Parameters::
|
|
517
517
|
# PWN::Plugins::NessusCloud.get_scan_status(
|
|
518
518
|
# nessus_obj: 'required - nessus_obj returned from #login method',
|
|
519
|
-
#
|
|
519
|
+
# scan_id: 'required - scan uuid to retrieve status'
|
|
520
520
|
# )
|
|
521
521
|
|
|
522
522
|
public_class_method def self.get_scan_status(opts = {})
|
|
523
523
|
nessus_obj = opts[:nessus_obj]
|
|
524
|
-
|
|
524
|
+
scan_id = opts[:scan_id]
|
|
525
525
|
|
|
526
526
|
scan_status_resp = nessus_cloud_rest_call(
|
|
527
527
|
nessus_obj: nessus_obj,
|
|
528
|
-
rest_call: "scans/#{
|
|
528
|
+
rest_call: "scans/#{scan_id}/latest-status"
|
|
529
529
|
).body
|
|
530
530
|
|
|
531
531
|
JSON.parse(scan_status_resp, symbolize_names: true)
|
|
@@ -568,16 +568,16 @@ module PWN
|
|
|
568
568
|
# Supported Method Parameters::
|
|
569
569
|
# PWN::Plugins::NessusCloud.get_scan_history(
|
|
570
570
|
# nessus_obj: 'required - nessus_obj returned from #login method'
|
|
571
|
-
#
|
|
571
|
+
# scan_id: 'required - scan uuid to launch'
|
|
572
572
|
# )
|
|
573
573
|
|
|
574
574
|
public_class_method def self.get_scan_history(opts = {})
|
|
575
575
|
nessus_obj = opts[:nessus_obj]
|
|
576
|
-
|
|
576
|
+
scan_id = opts[:scan_id]
|
|
577
577
|
|
|
578
578
|
scan_hist_resp = nessus_cloud_rest_call(
|
|
579
579
|
nessus_obj: nessus_obj,
|
|
580
|
-
rest_call: "scans/#{
|
|
580
|
+
rest_call: "scans/#{scan_id}/history"
|
|
581
581
|
).body
|
|
582
582
|
|
|
583
583
|
JSON.parse(scan_hist_resp, symbolize_names: true)
|
|
@@ -588,7 +588,7 @@ module PWN
|
|
|
588
588
|
# Supported Method Parameters::
|
|
589
589
|
# PWN::Plugins::NessusCloud.export_scan_results(
|
|
590
590
|
# nessus_obj: 'required - nessus_obj returned from #login method',
|
|
591
|
-
#
|
|
591
|
+
# scan_id: 'required - scan uuid to export',
|
|
592
592
|
# path_to_export: 'required - filename to export results',
|
|
593
593
|
# history_id: 'optional - defaults to last scan',
|
|
594
594
|
# format: 'optional - :csv|:db|:html|:nessus|:pdf (defaults to :csv')
|
|
@@ -596,14 +596,14 @@ module PWN
|
|
|
596
596
|
|
|
597
597
|
public_class_method def self.export_scan_results(opts = {})
|
|
598
598
|
nessus_obj = opts[:nessus_obj]
|
|
599
|
-
|
|
599
|
+
scan_id = opts[:scan_id]
|
|
600
600
|
path_to_export = opts[:path_to_export]
|
|
601
601
|
if opts[:history_id]
|
|
602
602
|
history_id = opts[:history_id]
|
|
603
603
|
else
|
|
604
604
|
scan_history_resp = get_scan_history(
|
|
605
605
|
nessus_obj: nessus_obj,
|
|
606
|
-
|
|
606
|
+
scan_id: scan_id
|
|
607
607
|
)
|
|
608
608
|
|
|
609
609
|
if scan_history_resp[:history].empty?
|
|
@@ -618,7 +618,7 @@ module PWN
|
|
|
618
618
|
format = opts[:format].to_s.to_sym if opts[:format]
|
|
619
619
|
|
|
620
620
|
http_body = {
|
|
621
|
-
|
|
621
|
+
scan_id: scan_id,
|
|
622
622
|
history_id: history_id,
|
|
623
623
|
format: format
|
|
624
624
|
}.to_json
|
|
@@ -626,7 +626,7 @@ module PWN
|
|
|
626
626
|
export_scan_resp = nessus_cloud_rest_call(
|
|
627
627
|
http_method: :post,
|
|
628
628
|
nessus_obj: nessus_obj,
|
|
629
|
-
rest_call: "scans/#{
|
|
629
|
+
rest_call: "scans/#{scan_id}/export",
|
|
630
630
|
http_body: http_body
|
|
631
631
|
).body
|
|
632
632
|
|
|
@@ -637,7 +637,7 @@ module PWN
|
|
|
637
637
|
|
|
638
638
|
download_export_resp = nessus_cloud_rest_call(
|
|
639
639
|
nessus_obj: nessus_obj,
|
|
640
|
-
rest_call: "scans/#{
|
|
640
|
+
rest_call: "scans/#{scan_id}/export/#{file_id}/download"
|
|
641
641
|
).body
|
|
642
642
|
|
|
643
643
|
File.open(path_to_export, 'wb') do |f|
|
|
@@ -720,7 +720,7 @@ module PWN
|
|
|
720
720
|
|
|
721
721
|
#{self}.update_scan(
|
|
722
722
|
nessus_obj: 'required - nessus_obj returned from #login method',
|
|
723
|
-
|
|
723
|
+
scan_id: 'required - the scan id to update. Run #get_scans for a list',
|
|
724
724
|
scan_template_uuid: 'required - the UUID for the Tenable-provided scan template to use. Run #get_canned_scan_templates for a list of UUIDs',
|
|
725
725
|
settings: 'required - settings object as defined by https://developer.tenable.com/reference/scans-create',
|
|
726
726
|
credentials: 'required - credentials object as defined by https://developer.tenable.com/reference/scans-create',
|
|
@@ -729,12 +729,12 @@ module PWN
|
|
|
729
729
|
|
|
730
730
|
#{self}.launch_scan(
|
|
731
731
|
nessus_obj: 'required - nessus_obj returned from #login method',
|
|
732
|
-
|
|
732
|
+
scan_id: 'required - scan uuid to launch'
|
|
733
733
|
)
|
|
734
734
|
|
|
735
735
|
#{self}.get_scan_status(
|
|
736
736
|
nessus_obj: 'required - nessus_obj returned from #login method',
|
|
737
|
-
|
|
737
|
+
scan_id: 'required - scan uuid to retrieve status'
|
|
738
738
|
)
|
|
739
739
|
|
|
740
740
|
#{self}.create_tag(
|
|
@@ -746,12 +746,12 @@ module PWN
|
|
|
746
746
|
|
|
747
747
|
#{self}.get_scan_history(
|
|
748
748
|
nessus_obj: 'required - nessus_obj returned from #login method'
|
|
749
|
-
|
|
749
|
+
scan_id: 'required - scan uuid to launch'
|
|
750
750
|
)
|
|
751
751
|
|
|
752
752
|
#{self}.export_scan_results(
|
|
753
753
|
nessus_obj: 'required - nessus_obj returned from #login method',
|
|
754
|
-
|
|
754
|
+
scan_id: 'required - scan uuid to export',
|
|
755
755
|
path_to_export: 'required - filename to export results',
|
|
756
756
|
history_id: 'optional - defaults to last scan',
|
|
757
757
|
format: 'optional - :csv|:db|:html|:nessus|:pdf (defaults to :csv')
|
data/lib/pwn/version.rb
CHANGED