pwn 0.5.259 → 0.5.261
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/.rubocop_todo.yml +3 -2
- data/README.md +3 -3
- data/lib/pwn/plugins/msr206.rb +1 -1
- data/lib/pwn/plugins/son_micro_rfid.rb +54 -37
- 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: a9c22ecc8e5ce9a02da49a22288572cede1eeb407125769c905c39adcea333cc
|
4
|
+
data.tar.gz: e70d1286edf8cba818e2b8b194cd6bb2781f76b455a3e0ac06f0f84ae8eb3d0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 230d6425720c0fc61dea6b0404cf81614b739b309edd4f6f92e8a6d83b625b7c74fb4464c39c02cb67d13580292347a5fc4723eb4d040cb395e51b9887ee693d
|
7
|
+
data.tar.gz: 321b015fc9e68ccd447718dc501d4e9f5bce0d4f2fae3a85cb6815617ba0da36eac3039df9f089d309bd38002fa114353c7483afb4b018b6fd00f1ebb253ea03
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2025-04-22
|
3
|
+
# on 2025-04-22 22:15:44 UTC using RuboCop version 1.75.3.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -65,10 +65,11 @@ Metrics/BlockLength:
|
|
65
65
|
- 'lib/pwn/plugins/repl.rb'
|
66
66
|
- 'lib/pwn/sast/banned_function_calls_c.rb'
|
67
67
|
|
68
|
-
# Offense count:
|
68
|
+
# Offense count: 2
|
69
69
|
# Configuration parameters: CountBlocks, CountModifierForms, Max.
|
70
70
|
Metrics/BlockNesting:
|
71
71
|
Exclude:
|
72
|
+
- 'lib/pwn/plugins/son_micro_rfid.rb'
|
72
73
|
- 'lib/pwn/plugins/tor.rb'
|
73
74
|
|
74
75
|
# Offense count: 1
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ $ cd /opt/pwn
|
|
37
37
|
$ ./install.sh
|
38
38
|
$ ./install.sh ruby-gem
|
39
39
|
$ pwn
|
40
|
-
pwn[v0.5.
|
40
|
+
pwn[v0.5.261]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.4.1@pwn
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
53
53
|
$ gem install --verbose pwn
|
54
54
|
$ pwn
|
55
|
-
pwn[v0.5.
|
55
|
+
pwn[v0.5.261]:001 >>> PWN.help
|
56
56
|
```
|
57
57
|
|
58
58
|
If you're using a multi-user install of RVM do:
|
@@ -62,7 +62,7 @@ $ rvm use ruby-3.4.1@pwn
|
|
62
62
|
$ rvmsudo gem uninstall --all --executables pwn
|
63
63
|
$ rvmsudo gem install --verbose pwn
|
64
64
|
$ pwn
|
65
|
-
pwn[v0.5.
|
65
|
+
pwn[v0.5.261]:001 >>> PWN.help
|
66
66
|
```
|
67
67
|
|
68
68
|
PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
|
data/lib/pwn/plugins/msr206.rb
CHANGED
@@ -10,7 +10,7 @@ module PWN
|
|
10
10
|
module SonMicroRFID
|
11
11
|
# Logger instance for auditing and debugging
|
12
12
|
private_class_method def self.logger
|
13
|
-
@logger ||= Logger.new('sonmicro_rfid.log')
|
13
|
+
@logger ||= Logger.new('/tmp/pwn-sonmicro_rfid.log')
|
14
14
|
end
|
15
15
|
|
16
16
|
# Supported Method Parameters::
|
@@ -335,11 +335,16 @@ module PWN
|
|
335
335
|
|
336
336
|
# Supported Method Parameters::
|
337
337
|
# PWN::Plugins::SonMicroRFID.read_tag(
|
338
|
-
# son_micro_rfid_obj: 'required - son_micro_rfid_obj returned from #connect method'
|
338
|
+
# son_micro_rfid_obj: 'required - son_micro_rfid_obj returned from #connect method',
|
339
|
+
# authn: 'optional - authentication flag (default: false)',
|
340
|
+
# key: 'optional - key for authentication (default: [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF])'
|
339
341
|
# )
|
340
342
|
|
341
343
|
public_class_method def self.read_tag(opts = {})
|
342
344
|
son_micro_rfid_obj = opts[:son_micro_rfid_obj]
|
345
|
+
authn = opts[:authn] ||= false
|
346
|
+
key = opts[:key] ||= [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]
|
347
|
+
|
343
348
|
logger.info('Starting read_tag')
|
344
349
|
|
345
350
|
print 'Reader Activated. Please Scan Tag...'
|
@@ -349,7 +354,7 @@ module PWN
|
|
349
354
|
)
|
350
355
|
|
351
356
|
rfid_data = exec_resp.last
|
352
|
-
logger.info(
|
357
|
+
logger.info(rfid_data)
|
353
358
|
|
354
359
|
if rfid_data[:resp_code_desc] == :no_tag_present
|
355
360
|
logger.error('No RFID tag detected')
|
@@ -366,21 +371,23 @@ module PWN
|
|
366
371
|
)
|
367
372
|
rfid_data[:block_data] = exec_resp.last[:block_data] if exec_resp.last[:resp_code_desc] == :read_success
|
368
373
|
when :mifare_classic_1k, :mifare_classic_4k
|
369
|
-
|
370
|
-
son_micro_rfid_obj: son_micro_rfid_obj,
|
371
|
-
cmd: :authenticate,
|
372
|
-
params: { block: 0, key_type: :key_a, key: [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] }
|
373
|
-
)
|
374
|
-
if exec_resp.last[:resp_code_desc] == :auth_success
|
374
|
+
if authn
|
375
375
|
exec_resp = exec(
|
376
376
|
son_micro_rfid_obj: son_micro_rfid_obj,
|
377
|
-
cmd: :
|
378
|
-
params: { block: 0 }
|
377
|
+
cmd: :authenticate,
|
378
|
+
params: { block: 0, key_type: :key_a, key: key }
|
379
379
|
)
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
380
|
+
if exec_resp.last[:resp_code_desc] == :auth_success
|
381
|
+
exec_resp = exec(
|
382
|
+
son_micro_rfid_obj: son_micro_rfid_obj,
|
383
|
+
cmd: :read_block,
|
384
|
+
params: { block: 0 }
|
385
|
+
)
|
386
|
+
rfid_data[:block_data] = exec_resp.last[:block_data] if exec_resp.last[:resp_code_desc] == :read_success
|
387
|
+
else
|
388
|
+
logger.error("Authentication failed for #{rfid_data[:resp_code_desc]}")
|
389
|
+
raise 'Authentication failed'
|
390
|
+
end
|
384
391
|
end
|
385
392
|
end
|
386
393
|
|
@@ -397,12 +404,16 @@ module PWN
|
|
397
404
|
# Supported Method Parameters::
|
398
405
|
# PWN::Plugins::SonMicroRFID.write_tag(
|
399
406
|
# son_micro_rfid_obj: 'required - son_micro_rfid_obj returned from #connect method',
|
400
|
-
# rfid_data: 'required - RFID data to write (see #read_tag for structure)'
|
407
|
+
# rfid_data: 'required - RFID data to write (see #read_tag for structure)',
|
408
|
+
# authn: 'optional - authentication flag (default: false)',
|
409
|
+
# key: 'optional - key for authentication (default: [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF])'
|
401
410
|
# )
|
402
411
|
|
403
412
|
public_class_method def self.write_tag(opts = {})
|
404
413
|
son_micro_rfid_obj = opts[:son_micro_rfid_obj]
|
405
414
|
rfid_data = opts[:rfid_data]
|
415
|
+
authn = opts[:authn] ||= false
|
416
|
+
key = opts[:key] ||= [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]
|
406
417
|
logger.info('Starting write_tag')
|
407
418
|
|
408
419
|
unless rfid_data.is_a?(Hash) && rfid_data[:resp_code_desc] && rfid_data[:tag_id]
|
@@ -444,27 +455,29 @@ module PWN
|
|
444
455
|
end
|
445
456
|
end
|
446
457
|
when :mifare_classic_1k, :mifare_classic_4k
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
if
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
458
|
+
if authn
|
459
|
+
exec_resp = exec(
|
460
|
+
son_micro_rfid_obj: son_micro_rfid_obj,
|
461
|
+
cmd: :authenticate,
|
462
|
+
params: { block: 0, key_type: :key_a, key: key }
|
463
|
+
)
|
464
|
+
if exec_resp.last[:resp_code_desc] == :auth_success
|
465
|
+
if rfid_data[:block_data]
|
466
|
+
data = rfid_data[:block_data].split.map { |b| b.to_i(16) }
|
467
|
+
exec_resp = exec(
|
468
|
+
son_micro_rfid_obj: son_micro_rfid_obj,
|
469
|
+
cmd: :write_block,
|
470
|
+
params: { block: 0, data: data }
|
471
|
+
)
|
472
|
+
unless exec_resp.last[:resp_code_desc] == :write_success
|
473
|
+
logger.error('Failed to write block for Classic')
|
474
|
+
raise 'Failed to write block'
|
475
|
+
end
|
463
476
|
end
|
477
|
+
else
|
478
|
+
logger.error("Authentication failed for #{rfid_data[:resp_code_desc]}")
|
479
|
+
raise 'Authentication failed'
|
464
480
|
end
|
465
|
-
else
|
466
|
-
logger.error("Authentication failed for #{rfid_data[:resp_code_desc]}")
|
467
|
-
raise 'Authentication failed'
|
468
481
|
end
|
469
482
|
else
|
470
483
|
logger.error("Unsupported tag type: #{rfid_data[:resp_code_desc]}")
|
@@ -720,12 +733,16 @@ module PWN
|
|
720
733
|
)
|
721
734
|
|
722
735
|
rfid_data = #{self}.read_tag(
|
723
|
-
son_micro_rfid_obj: 'required son_micro_rfid_obj returned from #connect method'
|
736
|
+
son_micro_rfid_obj: 'required son_micro_rfid_obj returned from #connect method',
|
737
|
+
authn: 'optional - authentication flag (default: false)',
|
738
|
+
key: 'optional - key for authentication (default: [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF])'
|
724
739
|
)
|
725
740
|
|
726
741
|
rfid_data = #{self}.write_tag(
|
727
742
|
son_micro_rfid_obj: 'required son_micro_rfid_obj returned from #connect method',
|
728
|
-
rfid_data: 'required - RFID data to write'
|
743
|
+
rfid_data: 'required - RFID data to write',
|
744
|
+
authn: 'optional - authentication flag (default: false)',
|
745
|
+
key: 'optional - key for authentication (default: [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF])'
|
729
746
|
)
|
730
747
|
|
731
748
|
rfid_data = #{self}.backup_tag(
|
data/lib/pwn/version.rb
CHANGED