pwn 0.4.466 → 0.4.467

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b22a31f1952951d9c3bd1a8dd912b58e1b6ccf39d93a55327b10e285729e67de
4
- data.tar.gz: a15ab49fbf548031599248380aca04bb05e9220357d771d27de63d477af33038
3
+ metadata.gz: 6c3c8162a975f70b29fef9ca0c1e9e3089bc625345dfd2a3183c8925bacd96cf
4
+ data.tar.gz: 874976297d57b765cbe21b6c582f6a51c77bf1a1bd758376bfe33820eb6b5b0d
5
5
  SHA512:
6
- metadata.gz: 360eab449207970607c8052dfd3ee9beae9026ed19c41f690f2874cdc932eb8981c341792d37316bc202a5feb2332cdf86686f39416dd001b0338d8b19dbad72
7
- data.tar.gz: d85c5f1785095b00c058727366896774a47afcb107aa69d0115aa4d501b83daa71df4699983f51acafdc46fa91fc9bcba52bdd7cb770fade67ac5ba85e3ecf9d
6
+ metadata.gz: efaae24fa8eabb639a90c7ce675aedc5323fcf91ba2aebf24f2f84243c00b67422a92ee4aeafd7260d9ff4515069c187c01903ad3221e623dbf139874daa1831
7
+ data.tar.gz: e7905ef924e48fc92d589cd3dbe1bfcab64c89ef8585edc1f239423588b1a1ec20672171ec23ddeea2adacecff66cf00017a3fd7f2a09c1c5ca0dcc901c5bb12
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.466]:001 >>> PWN.help
40
+ pwn[v0.4.467]: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.466]:001 >>> PWN.help
55
+ pwn[v0.4.467]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -3,6 +3,7 @@
3
3
 
4
4
  require 'pwn'
5
5
  require 'optparse'
6
+ require 'json'
6
7
 
7
8
  opts = {}
8
9
  OptionParser.new do |options|
@@ -81,7 +82,7 @@ begin
81
82
  # 4 |Track 3 Write not present|Track 3 Write present
82
83
  # 5 |Track 2 Write not present|Track 2 Write present
83
84
  # 6 |Track 1 Write not present|Track 1 Write present
84
- # 7 |parity bit** |parity bit**
85
+ # 7 |parity bit** |parity bit**
85
86
  exec_resp = PWN::Plugins::MSR206.exec(
86
87
  msr206_obj: msr206_obj,
87
88
  cmd: :configuration_request
@@ -120,14 +121,14 @@ begin
120
121
  when :R
121
122
  menu_msg = 'READY TO READ - PLEASE SWIPE CARD'
122
123
  # Read Card
123
- PWN::Plugins::MSR206.wait_for_swipe(
124
+ track_data = PWN::Plugins::MSR206.wait_for_swipe(
124
125
  msr206_obj: msr206_obj,
125
126
  type: :arm_to_read
126
127
  )
127
128
  when :C
128
129
  menu_msg = 'READY TO COPY - PLEASE SWIPE ORIGINAL CARD'
129
130
  # Read Original Card
130
- PWN::Plugins::MSR206.wait_for_swipe(
131
+ track_data = PWN::Plugins::MSR206.wait_for_swipe(
131
132
  msr206_obj: msr206_obj,
132
133
  type: :arm_to_read
133
134
  )
@@ -138,7 +139,7 @@ begin
138
139
  when :E
139
140
  menu_msg = 'READY TO EDIT - PLEASE SWIPE TARGET CARD'
140
141
  # Read Target Card
141
- PWN::Plugins::MSR206.wait_for_swipe(
142
+ track_data = PWN::Plugins::MSR206.wait_for_swipe(
142
143
  msr206_obj: msr206_obj,
143
144
  type: :arm_to_read
144
145
  )
@@ -149,10 +150,21 @@ begin
149
150
  when :B
150
151
  menu_msg = 'READY TO BACKUP - PLEASE SWIPE CARD'
151
152
  # Read Card
152
- PWN::Plugins::MSR206.wait_for_swipe(
153
+ track_data = PWN::Plugins::MSR206.wait_for_swipe(
153
154
  msr206_obj: msr206_obj,
154
155
  type: :arm_to_read
155
156
  )
157
+ file = ''
158
+ loop do
159
+ print 'Enter File Name to Save Backup: '
160
+ file = gets.scrub.chomp.strip
161
+ file_dir = File.dirname(file)
162
+ break if Dir.exist?(file_dir)
163
+
164
+ puts "\nDirectory #{file_dir} for #{file} does not exist."
165
+ end
166
+ File.write(file, "#{track_data.to_json}\n")
167
+ puts 'complete.'
156
168
  when :W
157
169
  exec_resp = PWN::Plugins::MSR206.exec(
158
170
  msr206_obj: msr206_obj,
@@ -319,7 +319,7 @@ module PWN
319
319
  binary_byte_arr = []
320
320
  if raw_byte_arr
321
321
  raw_byte_arr.first.split.each do |byte_str|
322
- binary_byte_arr.push([byte_str].pack('H*').unpack('B*').first.reverse)
322
+ binary_byte_arr.push([byte_str].pack('H*').unpack1('B*').reverse)
323
323
  end
324
324
  end
325
325
 
@@ -555,6 +555,7 @@ module PWN
555
555
  # Supported Method Parameters::
556
556
  # PWN::Plugins::MSR206.wait_for_swipe(
557
557
  # msr206_obj: 'required - msr206_obj returned from #connect method'
558
+ # type: 'required - swipe type'
558
559
  # )
559
560
 
560
561
  public_class_method def self.wait_for_swipe(opts = {})
@@ -570,6 +571,8 @@ module PWN
570
571
 
571
572
  raise "ERROR Unsupported type in #wait_for_swipe - #{type}. Valid types:\n#{types_arr}" unless types_arr.include?(type)
572
573
 
574
+ track_data = {}
575
+
573
576
  exec_resp = exec(
574
577
  msr206_obj: msr206_obj,
575
578
  cmd: :red_off
@@ -613,6 +616,7 @@ module PWN
613
616
  )
614
617
  puts exec_resp[:decoded]
615
618
  puts exec_resp.inspect
619
+ track_data[:track1] = exec_resp
616
620
 
617
621
  # (1..3).each do |n|
618
622
  # print ">> Track 1 (ALT DATA) ISO Track Format: #{n}\n"
@@ -631,6 +635,7 @@ module PWN
631
635
  )
632
636
  puts exec_resp[:decoded]
633
637
  puts exec_resp.inspect
638
+ track_data[:track2] = exec_resp
634
639
 
635
640
  # (1..3).each do |n|
636
641
  # print ">> Track 2 (ALT DATA) ISO Track Format: #{n}\n"
@@ -649,6 +654,7 @@ module PWN
649
654
  )
650
655
  puts exec_resp[:decoded]
651
656
  puts exec_resp.inspect
657
+ track_data[:track3] = exec_resp
652
658
 
653
659
  # (1..3).each do |n|
654
660
  # print ">> Track 3 (ALT DATA) ISO Track Format: #{n}\n"
@@ -659,7 +665,7 @@ module PWN
659
665
  # )
660
666
  # puts exec_resp.inspect
661
667
  # end
662
-
668
+ track_data
663
669
  rescue StandardError => e
664
670
  raise e
665
671
  ensure
data/lib/pwn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.4.466'
4
+ VERSION = '0.4.467'
5
5
  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.466
4
+ version: 0.4.467
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-06-01 00:00:00.000000000 Z
11
+ date: 2022-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -1972,7 +1972,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1972
1972
  - !ruby/object:Gem::Version
1973
1973
  version: '0'
1974
1974
  requirements: []
1975
- rubygems_version: 3.3.14
1975
+ rubygems_version: 3.3.15
1976
1976
  signing_key:
1977
1977
  specification_version: 4
1978
1978
  summary: Automated Security Testing for CI/CD Pipelines & Beyond