pwn 0.5.230 → 0.5.231
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 +3 -3
- data/lib/pwn/plugins/flipper_zero.rb +124 -0
- data/lib/pwn/plugins.rb +1 -0
- data/lib/pwn/version.rb +1 -1
- data/spec/lib/pwn/plugins/flipper_zero_spec.rb +15 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d675dc77a942b4bd3de91ba881adf1e4527c72540ac4b895ab4eb4811f46653a
|
4
|
+
data.tar.gz: e308821bcd440f215af4016aeeedaaacf5bd42db8a4a10386905005a22a0c925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dba513ab987854314a5dc81e2da1b3034e5a680d40d5c8fd030da7be131876fcbb8115b55e32b025f285a4e294c76d3c755ee58fb508f2f65b725edd06cb6105
|
7
|
+
data.tar.gz: 5a52df8f8efcd105e32ff80f025058814303c349e78da1384104db4bf879c0a0d21b1ec36ead39e416c3b08ede56b7022b10bab28227d06e0247810410f949d9
|
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.231]: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.231]: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.231]: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:
|
@@ -0,0 +1,124 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PWN
|
4
|
+
module Plugins
|
5
|
+
# This plugin is used for interacting with Bus Pirate v3.6
|
6
|
+
# This plugin may be compatible with other versions, however,
|
7
|
+
# has not been tested with anything other than v3.6.
|
8
|
+
module FlipperZero
|
9
|
+
# Supported Method Parameters::
|
10
|
+
# PWN::Plugins::FlipperZero.connect_via_screen(
|
11
|
+
# block_dev: 'optional - serial block device path (defaults to /dev/ttyACM0)'
|
12
|
+
# )
|
13
|
+
|
14
|
+
public_class_method def self.connect_via_screen(opts = {})
|
15
|
+
block_dev = opts[:block_dev].to_s if File.exist?(
|
16
|
+
opts[:block_dev].to_s
|
17
|
+
)
|
18
|
+
|
19
|
+
block_dev ||= '/dev/ttyACM0'
|
20
|
+
|
21
|
+
screen_bin = '/usr/bin/screen'
|
22
|
+
raise "ERROR: #{screen_bin} not found." unless File.exist?(screen_bin)
|
23
|
+
|
24
|
+
system(
|
25
|
+
screen_bin,
|
26
|
+
block_dev,
|
27
|
+
'115200',
|
28
|
+
'8',
|
29
|
+
'N',
|
30
|
+
'1'
|
31
|
+
)
|
32
|
+
rescue StandardError => e
|
33
|
+
raise e
|
34
|
+
end
|
35
|
+
|
36
|
+
# Supported Method Parameters::
|
37
|
+
# flipper_zero_obj = PWN::Plugins::FlipperZero.connect(
|
38
|
+
# block_dev: 'optional serial block device path (defaults to /dev/ttyACM0)',
|
39
|
+
# baud: 'optional (defaults to 9600)',
|
40
|
+
# data_bits: 'optional (defaults to 8)',
|
41
|
+
# stop_bits: 'optional (defaults to 1)',
|
42
|
+
# parity: 'optional - :even||:odd|:none (defaults to :none)'
|
43
|
+
# )
|
44
|
+
|
45
|
+
public_class_method def self.connect(opts = {})
|
46
|
+
PWN::Plugins::Serial.connect(opts)
|
47
|
+
rescue StandardError => e
|
48
|
+
disconnect(flipper_zero_obj: opts[:flipper_zero_obj]) unless opts[:flipper_zero_obj].nil?
|
49
|
+
raise e
|
50
|
+
end
|
51
|
+
|
52
|
+
# Supported Method Parameters::
|
53
|
+
# response = PWN::Plugins::FlipperZero.request(
|
54
|
+
# flipper_zero_obj: 'required - flipper_zero_obj returned from #connect method',
|
55
|
+
# payload: 'required - payload to send to the device'
|
56
|
+
# )
|
57
|
+
public_class_method def self.request(opts = {})
|
58
|
+
serial_obj = opts[:flipper_zero_obj]
|
59
|
+
payload = "#{opts[:payload]}\r\n" if opts[:payload]
|
60
|
+
PWN::Plugins::Serial.request(
|
61
|
+
serial_obj: serial_obj,
|
62
|
+
payload: payload
|
63
|
+
)
|
64
|
+
response = PWN::Plugins::Serial.dump_session_data
|
65
|
+
puts response.join
|
66
|
+
PWN::Plugins::Serial.flush_session_data
|
67
|
+
response
|
68
|
+
rescue StandardError => e
|
69
|
+
disconnect(flipper_zero_obj: opts[:flipper_zero_obj]) unless opts[:flipper_zero_obj].nil?
|
70
|
+
raise e
|
71
|
+
end
|
72
|
+
|
73
|
+
# Supported Method Parameters::
|
74
|
+
# PWN::Plugins::FlipperZero.disconnect(
|
75
|
+
# flipper_zero_obj: 'required - flipper_zero_obj returned from #connect method'
|
76
|
+
# )
|
77
|
+
|
78
|
+
public_class_method def self.disconnect(opts = {})
|
79
|
+
PWN::Plugins::Serial.disconnect(
|
80
|
+
serial_obj: opts[:flipper_zero_obj]
|
81
|
+
)
|
82
|
+
rescue StandardError => e
|
83
|
+
raise e
|
84
|
+
end
|
85
|
+
|
86
|
+
# Author(s):: 0day Inc. <support@0dayinc.com>
|
87
|
+
|
88
|
+
public_class_method def self.authors
|
89
|
+
"AUTHOR(S):
|
90
|
+
0day Inc. <support@0dayinc.com>
|
91
|
+
"
|
92
|
+
end
|
93
|
+
|
94
|
+
# Display Usage for this Module
|
95
|
+
|
96
|
+
public_class_method def self.help
|
97
|
+
puts "USAGE:
|
98
|
+
#{self}.connect_via_screen(
|
99
|
+
block_dev: 'optional serial block device path (defaults to /dev/ttyUSB0)'
|
100
|
+
)
|
101
|
+
|
102
|
+
flipper_zero_obj = #{self}.connect(
|
103
|
+
block_dev: 'optional serial block device path (defaults to /dev/ttyUSB0)',
|
104
|
+
baud: 'optional (defaults to 9600)',
|
105
|
+
data_bits: 'optional (defaults to 8)',
|
106
|
+
stop_bits: 'optional (defaults to 1)',
|
107
|
+
parity: 'optional - :even||:odd|:none (defaults to :none)'
|
108
|
+
)
|
109
|
+
|
110
|
+
response = #{self}.request(
|
111
|
+
flipper_zero_obj: 'required - flipper_zero_obj returned from #connect method',
|
112
|
+
payload: 'required - payload to send to the device'
|
113
|
+
)
|
114
|
+
|
115
|
+
#{self}.disconnect(
|
116
|
+
flipper_zero_obj: 'required - flipper_zero_obj returned from #connect method'
|
117
|
+
)
|
118
|
+
|
119
|
+
#{self}.authors
|
120
|
+
"
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
data/lib/pwn/plugins.rb
CHANGED
@@ -25,6 +25,7 @@ module PWN
|
|
25
25
|
autoload :DetectOS, 'pwn/plugins/detect_os'
|
26
26
|
autoload :EIN, 'pwn/plugins/ein'
|
27
27
|
autoload :FileFu, 'pwn/plugins/file_fu'
|
28
|
+
autoload :FlipperZero, 'pwn/plugins/flipper_zero'
|
28
29
|
autoload :Fuzz, 'pwn/plugins/fuzz'
|
29
30
|
autoload :Git, 'pwn/plugins/git'
|
30
31
|
autoload :Github, 'pwn/plugins/github'
|
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::FlipperZero do
|
6
|
+
it 'should display information for authors' do
|
7
|
+
authors_response = PWN::Plugins::FlipperZero
|
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::FlipperZero
|
13
|
+
expect(help_response).to respond_to :help
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.231
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-01-
|
10
|
+
date: 2025-01-15 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: activesupport
|
@@ -1828,6 +1828,7 @@ files:
|
|
1828
1828
|
- lib/pwn/plugins/detect_os.rb
|
1829
1829
|
- lib/pwn/plugins/ein.rb
|
1830
1830
|
- lib/pwn/plugins/file_fu.rb
|
1831
|
+
- lib/pwn/plugins/flipper_zero.rb
|
1831
1832
|
- lib/pwn/plugins/fuzz.rb
|
1832
1833
|
- lib/pwn/plugins/git.rb
|
1833
1834
|
- lib/pwn/plugins/github.rb
|
@@ -2163,6 +2164,7 @@ files:
|
|
2163
2164
|
- spec/lib/pwn/plugins/detect_os_spec.rb
|
2164
2165
|
- spec/lib/pwn/plugins/ein_spec.rb
|
2165
2166
|
- spec/lib/pwn/plugins/file_fu_spec.rb
|
2167
|
+
- spec/lib/pwn/plugins/flipper_zero_spec.rb
|
2166
2168
|
- spec/lib/pwn/plugins/fuzz_spec.rb
|
2167
2169
|
- spec/lib/pwn/plugins/git_spec.rb
|
2168
2170
|
- spec/lib/pwn/plugins/github_spec.rb
|