pwn 0.4.452 → 0.4.456
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- 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/msr206.rb +70 -0
- data/lib/pwn/plugins/nessus_cloud.rb +36 -23
- data/lib/pwn/plugins.rb +1 -0
- data/lib/pwn/version.rb +1 -1
- data/spec/lib/pwn/plugins/msr206_spec.rb +15 -0
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3b1843c0855572815309240a50172a80b69cb45ac5deb69680209ad1a8c7d67
|
4
|
+
data.tar.gz: 943a67a010803ace7adc4aac78c18b43c168dfb5014a29058a7245a84ae07424
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f46dc1fa6e26ddab03a457400456670b6ce163669ed26b89932d27f22e597535f0b4e92d95035df91bb0eec7b2650e3a2e8d8a05eef01b71716433cc83a10b5
|
7
|
+
data.tar.gz: 1732ba89f610c2a50c20f932bee5fb9707e292ca3cb667f4bd937b7aa7fd27e80a8a431bc0a5032866c41d215d0f8e95b55a6407e3daacf32962a3d3ccadebca
|
data/Gemfile
CHANGED
@@ -67,7 +67,7 @@ gem 'ruby-nmap', '0.10.0'
|
|
67
67
|
gem 'ruby-saml', '1.14.0'
|
68
68
|
gem 'rvm', '1.11.3.9'
|
69
69
|
gem 'savon', '2.12.1'
|
70
|
-
gem 'selenium-devtools', '0.
|
70
|
+
gem 'selenium-devtools', '0.102.0'
|
71
71
|
gem 'serialport', '1.3.2'
|
72
72
|
gem 'sinatra', '2.2.0'
|
73
73
|
gem 'slack-ruby-client', '1.0.0'
|
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.456]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[![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
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
53
53
|
$ gem install --verbose pwn
|
54
54
|
$ pwn
|
55
|
-
pwn[v0.4.
|
55
|
+
pwn[v0.4.456]: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
|
)
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PWN
|
4
|
+
module Plugins
|
5
|
+
# This plugin is used for interacting with a three track
|
6
|
+
# MSR206 Magnetic Stripe Reader / Writer
|
7
|
+
module MSR206
|
8
|
+
# Supported Method Parameters::
|
9
|
+
# msr206_obj = PWN::Plugins::MSR206.connect(
|
10
|
+
# block_dev: 'optional - serial block device path (defaults to /dev/ttyUSB0)',
|
11
|
+
# baud: 'optional - (defaults to 9600)',
|
12
|
+
# data_bits: 'optional - (defaults to 8)',
|
13
|
+
# stop_bits: 'optional - (defaults to 1)',
|
14
|
+
# parity: 'optional - (defaults to SerialPort::NONE)',
|
15
|
+
# flow_control: 'optional - (defaults to SerialPort::HARD) SerialPort::NONE|SerialPort::SOFT|SerialPort::HARD'
|
16
|
+
# )
|
17
|
+
|
18
|
+
public_class_method def self.connect(opts = {})
|
19
|
+
# Default Baud Rate for this Device is 19200
|
20
|
+
opts[:baud] = 19_200 if opts[:baud].nil?
|
21
|
+
msr206_obj = PWN::Plugins::Serial.connect(opts)
|
22
|
+
rescue StandardError => e
|
23
|
+
disconnect(msr206_obj: msr206_obj) unless msr206_obj.nil?
|
24
|
+
raise e
|
25
|
+
end
|
26
|
+
|
27
|
+
# Supported Method Parameters::
|
28
|
+
# PWN::Plugins::MSR206.disconnect(
|
29
|
+
# msr206_obj: 'required - msr206_obj returned from #connect method'
|
30
|
+
# )
|
31
|
+
|
32
|
+
public_class_method def self.disconnect(opts = {})
|
33
|
+
PWN::Plugins::Serial.disconnect(
|
34
|
+
serial_obj: opts[:msr206_obj]
|
35
|
+
)
|
36
|
+
rescue StandardError => e
|
37
|
+
raise e
|
38
|
+
end
|
39
|
+
|
40
|
+
# Author(s):: 0day Inc. <request.pentest@0dayinc.com>
|
41
|
+
|
42
|
+
public_class_method def self.authors
|
43
|
+
"AUTHOR(S):
|
44
|
+
0day Inc. <request.pentest@0dayinc.com>
|
45
|
+
"
|
46
|
+
end
|
47
|
+
|
48
|
+
# Display Usage for this Module
|
49
|
+
|
50
|
+
public_class_method def self.help
|
51
|
+
puts "USAGE:
|
52
|
+
msr206_obj = #{self}.connect(
|
53
|
+
block_dev: 'optional serial block device path (defaults to /dev/ttyUSB0)',
|
54
|
+
baud: 'optional (defaults to 9600)',
|
55
|
+
data_bits: 'optional (defaults to 8)',
|
56
|
+
stop_bits: 'optional (defaults to 1)',
|
57
|
+
parity: 'optional (defaults to SerialPort::NONE)',
|
58
|
+
flow_control: 'optional (defaults to SerialPort::NONE)'
|
59
|
+
)
|
60
|
+
|
61
|
+
#{self}.disconnect(
|
62
|
+
msr206_obj: 'required msr206_obj returned from #connect method'
|
63
|
+
)
|
64
|
+
|
65
|
+
#{self}.authors
|
66
|
+
"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -46,6 +46,19 @@ module PWN
|
|
46
46
|
verify_ssl: false
|
47
47
|
)
|
48
48
|
|
49
|
+
when :put
|
50
|
+
response = rest_client.execute(
|
51
|
+
method: :put,
|
52
|
+
url: "#{base_nessus_cloud_api_uri}/#{rest_call}",
|
53
|
+
headers: {
|
54
|
+
x_apikeys: "accessKey=#{access_key}; secretKey=#{secret_key}",
|
55
|
+
accept: 'application/json',
|
56
|
+
content_type: 'application/json; charset=UTF-8'
|
57
|
+
},
|
58
|
+
payload: http_body,
|
59
|
+
verify_ssl: false
|
60
|
+
)
|
61
|
+
|
49
62
|
when :post
|
50
63
|
response = rest_client.execute(
|
51
64
|
method: :post,
|
@@ -445,7 +458,7 @@ module PWN
|
|
445
458
|
# Supported Method Parameters::
|
446
459
|
# PWN::Plugins::NessusCloud.update_scan(
|
447
460
|
# nessus_obj: 'required - nessus_obj returned from #login method',
|
448
|
-
#
|
461
|
+
# scan_id: 'required - the scan id to update. Run #get_scans for a list',
|
449
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',
|
450
463
|
# settings: 'required - settings object as defined by https://developer.tenable.com/reference/scans-create',
|
451
464
|
# credentials: 'required - credentials object as defined by https://developer.tenable.com/reference/scans-create',
|
@@ -454,7 +467,7 @@ module PWN
|
|
454
467
|
|
455
468
|
public_class_method def self.update_scan(opts = {})
|
456
469
|
nessus_obj = opts[:nessus_obj]
|
457
|
-
|
470
|
+
scan_id = opts[:scan_id]
|
458
471
|
scan_template_uuid = opts[:scan_template_uuid]
|
459
472
|
settings = opts[:settings]
|
460
473
|
credentials = opts[:credentials]
|
@@ -470,7 +483,7 @@ module PWN
|
|
470
483
|
update_scan_resp = nessus_cloud_rest_call(
|
471
484
|
http_method: :put,
|
472
485
|
nessus_obj: nessus_obj,
|
473
|
-
rest_call: "scans/#{
|
486
|
+
rest_call: "scans/#{scan_id}",
|
474
487
|
http_body: http_body
|
475
488
|
).body
|
476
489
|
|
@@ -482,17 +495,17 @@ module PWN
|
|
482
495
|
# Supported Method Parameters::
|
483
496
|
# PWN::Plugins::NessusCloud.launch_scan(
|
484
497
|
# nessus_obj: 'required - nessus_obj returned from #login method',
|
485
|
-
#
|
498
|
+
# scan_id: 'required - scan uuid to launch'
|
486
499
|
# )
|
487
500
|
|
488
501
|
public_class_method def self.launch_scan(opts = {})
|
489
502
|
nessus_obj = opts[:nessus_obj]
|
490
|
-
|
503
|
+
scan_id = opts[:scan_id]
|
491
504
|
|
492
505
|
launch_scan_resp = nessus_cloud_rest_call(
|
493
506
|
http_method: :post,
|
494
507
|
nessus_obj: nessus_obj,
|
495
|
-
rest_call: "scans/#{
|
508
|
+
rest_call: "scans/#{scan_id}/launch"
|
496
509
|
).body
|
497
510
|
|
498
511
|
JSON.parse(launch_scan_resp, symbolize_names: true)
|
@@ -503,16 +516,16 @@ module PWN
|
|
503
516
|
# Supported Method Parameters::
|
504
517
|
# PWN::Plugins::NessusCloud.get_scan_status(
|
505
518
|
# nessus_obj: 'required - nessus_obj returned from #login method',
|
506
|
-
#
|
519
|
+
# scan_id: 'required - scan uuid to retrieve status'
|
507
520
|
# )
|
508
521
|
|
509
522
|
public_class_method def self.get_scan_status(opts = {})
|
510
523
|
nessus_obj = opts[:nessus_obj]
|
511
|
-
|
524
|
+
scan_id = opts[:scan_id]
|
512
525
|
|
513
526
|
scan_status_resp = nessus_cloud_rest_call(
|
514
527
|
nessus_obj: nessus_obj,
|
515
|
-
rest_call: "scans/#{
|
528
|
+
rest_call: "scans/#{scan_id}/latest-status"
|
516
529
|
).body
|
517
530
|
|
518
531
|
JSON.parse(scan_status_resp, symbolize_names: true)
|
@@ -555,16 +568,16 @@ module PWN
|
|
555
568
|
# Supported Method Parameters::
|
556
569
|
# PWN::Plugins::NessusCloud.get_scan_history(
|
557
570
|
# nessus_obj: 'required - nessus_obj returned from #login method'
|
558
|
-
#
|
571
|
+
# scan_id: 'required - scan uuid to launch'
|
559
572
|
# )
|
560
573
|
|
561
574
|
public_class_method def self.get_scan_history(opts = {})
|
562
575
|
nessus_obj = opts[:nessus_obj]
|
563
|
-
|
576
|
+
scan_id = opts[:scan_id]
|
564
577
|
|
565
578
|
scan_hist_resp = nessus_cloud_rest_call(
|
566
579
|
nessus_obj: nessus_obj,
|
567
|
-
rest_call: "scans/#{
|
580
|
+
rest_call: "scans/#{scan_id}/history"
|
568
581
|
).body
|
569
582
|
|
570
583
|
JSON.parse(scan_hist_resp, symbolize_names: true)
|
@@ -575,7 +588,7 @@ module PWN
|
|
575
588
|
# Supported Method Parameters::
|
576
589
|
# PWN::Plugins::NessusCloud.export_scan_results(
|
577
590
|
# nessus_obj: 'required - nessus_obj returned from #login method',
|
578
|
-
#
|
591
|
+
# scan_id: 'required - scan uuid to export',
|
579
592
|
# path_to_export: 'required - filename to export results',
|
580
593
|
# history_id: 'optional - defaults to last scan',
|
581
594
|
# format: 'optional - :csv|:db|:html|:nessus|:pdf (defaults to :csv')
|
@@ -583,14 +596,14 @@ module PWN
|
|
583
596
|
|
584
597
|
public_class_method def self.export_scan_results(opts = {})
|
585
598
|
nessus_obj = opts[:nessus_obj]
|
586
|
-
|
599
|
+
scan_id = opts[:scan_id]
|
587
600
|
path_to_export = opts[:path_to_export]
|
588
601
|
if opts[:history_id]
|
589
602
|
history_id = opts[:history_id]
|
590
603
|
else
|
591
604
|
scan_history_resp = get_scan_history(
|
592
605
|
nessus_obj: nessus_obj,
|
593
|
-
|
606
|
+
scan_id: scan_id
|
594
607
|
)
|
595
608
|
|
596
609
|
if scan_history_resp[:history].empty?
|
@@ -605,7 +618,7 @@ module PWN
|
|
605
618
|
format = opts[:format].to_s.to_sym if opts[:format]
|
606
619
|
|
607
620
|
http_body = {
|
608
|
-
|
621
|
+
scan_id: scan_id,
|
609
622
|
history_id: history_id,
|
610
623
|
format: format
|
611
624
|
}.to_json
|
@@ -613,7 +626,7 @@ module PWN
|
|
613
626
|
export_scan_resp = nessus_cloud_rest_call(
|
614
627
|
http_method: :post,
|
615
628
|
nessus_obj: nessus_obj,
|
616
|
-
rest_call: "scans/#{
|
629
|
+
rest_call: "scans/#{scan_id}/export",
|
617
630
|
http_body: http_body
|
618
631
|
).body
|
619
632
|
|
@@ -624,7 +637,7 @@ module PWN
|
|
624
637
|
|
625
638
|
download_export_resp = nessus_cloud_rest_call(
|
626
639
|
nessus_obj: nessus_obj,
|
627
|
-
rest_call: "scans/#{
|
640
|
+
rest_call: "scans/#{scan_id}/export/#{file_id}/download"
|
628
641
|
).body
|
629
642
|
|
630
643
|
File.open(path_to_export, 'wb') do |f|
|
@@ -707,7 +720,7 @@ module PWN
|
|
707
720
|
|
708
721
|
#{self}.update_scan(
|
709
722
|
nessus_obj: 'required - nessus_obj returned from #login method',
|
710
|
-
|
723
|
+
scan_id: 'required - the scan id to update. Run #get_scans for a list',
|
711
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',
|
712
725
|
settings: 'required - settings object as defined by https://developer.tenable.com/reference/scans-create',
|
713
726
|
credentials: 'required - credentials object as defined by https://developer.tenable.com/reference/scans-create',
|
@@ -716,12 +729,12 @@ module PWN
|
|
716
729
|
|
717
730
|
#{self}.launch_scan(
|
718
731
|
nessus_obj: 'required - nessus_obj returned from #login method',
|
719
|
-
|
732
|
+
scan_id: 'required - scan uuid to launch'
|
720
733
|
)
|
721
734
|
|
722
735
|
#{self}.get_scan_status(
|
723
736
|
nessus_obj: 'required - nessus_obj returned from #login method',
|
724
|
-
|
737
|
+
scan_id: 'required - scan uuid to retrieve status'
|
725
738
|
)
|
726
739
|
|
727
740
|
#{self}.create_tag(
|
@@ -733,12 +746,12 @@ module PWN
|
|
733
746
|
|
734
747
|
#{self}.get_scan_history(
|
735
748
|
nessus_obj: 'required - nessus_obj returned from #login method'
|
736
|
-
|
749
|
+
scan_id: 'required - scan uuid to launch'
|
737
750
|
)
|
738
751
|
|
739
752
|
#{self}.export_scan_results(
|
740
753
|
nessus_obj: 'required - nessus_obj returned from #login method',
|
741
|
-
|
754
|
+
scan_id: 'required - scan uuid to export',
|
742
755
|
path_to_export: 'required - filename to export results',
|
743
756
|
history_id: 'optional - defaults to last scan',
|
744
757
|
format: 'optional - :csv|:db|:html|:nessus|:pdf (defaults to :csv')
|
data/lib/pwn/plugins.rb
CHANGED
@@ -32,6 +32,7 @@ module PWN
|
|
32
32
|
autoload :JSONPathify, 'pwn/plugins/json_pathify'
|
33
33
|
autoload :MailAgent, 'pwn/plugins/mail_agent'
|
34
34
|
autoload :Metasploit, 'pwn/plugins/metasploit'
|
35
|
+
autoload :MSR206, 'pwn/plugins/msr206'
|
35
36
|
autoload :NessusCloud, 'pwn/plugins/nessus_cloud'
|
36
37
|
autoload :NexposeVulnScan, 'pwn/plugins/nexpose_vuln_scan'
|
37
38
|
autoload :NmapIt, 'pwn/plugins/nmap_it'
|
data/lib/pwn/version.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe PWN::Plugins::MSR206 do
|
6
|
+
it 'should display information for authors' do
|
7
|
+
authors_response = PWN::Plugins::MSR206
|
8
|
+
expect(authors_response).to respond_to :authors
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should display information for existing help method' do
|
12
|
+
help_response = PWN::Plugins::MSR206
|
13
|
+
expect(help_response).to respond_to :help
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.456
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -786,14 +786,14 @@ dependencies:
|
|
786
786
|
requirements:
|
787
787
|
- - '='
|
788
788
|
- !ruby/object:Gem::Version
|
789
|
-
version: 0.
|
789
|
+
version: 0.102.0
|
790
790
|
type: :runtime
|
791
791
|
prerelease: false
|
792
792
|
version_requirements: !ruby/object:Gem::Requirement
|
793
793
|
requirements:
|
794
794
|
- - '='
|
795
795
|
- !ruby/object:Gem::Version
|
796
|
-
version: 0.
|
796
|
+
version: 0.102.0
|
797
797
|
- !ruby/object:Gem::Dependency
|
798
798
|
name: serialport
|
799
799
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1531,6 +1531,7 @@ files:
|
|
1531
1531
|
- lib/pwn/plugins/json_pathify.rb
|
1532
1532
|
- lib/pwn/plugins/mail_agent.rb
|
1533
1533
|
- lib/pwn/plugins/metasploit.rb
|
1534
|
+
- lib/pwn/plugins/msr206.rb
|
1534
1535
|
- lib/pwn/plugins/nessus_cloud.rb
|
1535
1536
|
- lib/pwn/plugins/nexpose_vuln_scan.rb
|
1536
1537
|
- lib/pwn/plugins/nmap_it.rb
|
@@ -1827,6 +1828,7 @@ files:
|
|
1827
1828
|
- spec/lib/pwn/plugins/json_pathify_spec.rb
|
1828
1829
|
- spec/lib/pwn/plugins/mail_agent_spec.rb
|
1829
1830
|
- spec/lib/pwn/plugins/metasploit_spec.rb
|
1831
|
+
- spec/lib/pwn/plugins/msr206_spec.rb
|
1830
1832
|
- spec/lib/pwn/plugins/nessus_cloud_spec.rb
|
1831
1833
|
- spec/lib/pwn/plugins/nexpose_vuln_scan_spec.rb
|
1832
1834
|
- spec/lib/pwn/plugins/nmap_it_spec.rb
|
@@ -2096,6 +2098,7 @@ test_files:
|
|
2096
2098
|
- spec/lib/pwn/plugins/json_pathify_spec.rb
|
2097
2099
|
- spec/lib/pwn/plugins/mail_agent_spec.rb
|
2098
2100
|
- spec/lib/pwn/plugins/metasploit_spec.rb
|
2101
|
+
- spec/lib/pwn/plugins/msr206_spec.rb
|
2099
2102
|
- spec/lib/pwn/plugins/nessus_cloud_spec.rb
|
2100
2103
|
- spec/lib/pwn/plugins/nexpose_vuln_scan_spec.rb
|
2101
2104
|
- spec/lib/pwn/plugins/nmap_it_spec.rb
|