pwn 0.5.230 → 0.5.232
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/pwn/plugins/flipper_zero.rb +127 -0
- data/lib/pwn/plugins/serial.rb +1 -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: 88d9926d542dcfc18e99ff1e9c8698a0af64a3f3386e3a96bdad3896bfa969cb
|
4
|
+
data.tar.gz: 00c08c68a1a3e6a5a2c8ee2f983ffcddcde5427cef2a5c8492a56a88f2e5f6f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e9c2d88aa036800bb1738db4f2619116b559886722f78c7e4208910518b889674d52ab83a4e5c171bfcc5ae126fc5a438c4d89c557b741dba46b97118bde8f2
|
7
|
+
data.tar.gz: 91a814b5f408ea3be3e7903af55bd6ba01947f144b1cc2d3cc38bdbfc593f005f2958521b33d8ea5d735e3d8c93cd96b475bcb679c8602f4d3b7c106e319abdd
|
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.232]: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.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.232]: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.232]: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,127 @@
|
|
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
|
+
response_before = PWN::Plugins::Serial.dump_session_data
|
61
|
+
|
62
|
+
PWN::Plugins::Serial.request(
|
63
|
+
serial_obj: serial_obj,
|
64
|
+
payload: payload
|
65
|
+
)
|
66
|
+
# response = PWN::Plugins::Serial.dump_session_data.clone
|
67
|
+
puts response.join
|
68
|
+
PWN::Plugins::Serial.flush_session_data
|
69
|
+
|
70
|
+
# response
|
71
|
+
rescue StandardError => e
|
72
|
+
disconnect(flipper_zero_obj: opts[:flipper_zero_obj]) unless opts[:flipper_zero_obj].nil?
|
73
|
+
raise e
|
74
|
+
end
|
75
|
+
|
76
|
+
# Supported Method Parameters::
|
77
|
+
# PWN::Plugins::FlipperZero.disconnect(
|
78
|
+
# flipper_zero_obj: 'required - flipper_zero_obj returned from #connect method'
|
79
|
+
# )
|
80
|
+
|
81
|
+
public_class_method def self.disconnect(opts = {})
|
82
|
+
PWN::Plugins::Serial.disconnect(
|
83
|
+
serial_obj: opts[:flipper_zero_obj]
|
84
|
+
)
|
85
|
+
rescue StandardError => e
|
86
|
+
raise e
|
87
|
+
end
|
88
|
+
|
89
|
+
# Author(s):: 0day Inc. <support@0dayinc.com>
|
90
|
+
|
91
|
+
public_class_method def self.authors
|
92
|
+
"AUTHOR(S):
|
93
|
+
0day Inc. <support@0dayinc.com>
|
94
|
+
"
|
95
|
+
end
|
96
|
+
|
97
|
+
# Display Usage for this Module
|
98
|
+
|
99
|
+
public_class_method def self.help
|
100
|
+
puts "USAGE:
|
101
|
+
#{self}.connect_via_screen(
|
102
|
+
block_dev: 'optional serial block device path (defaults to /dev/ttyUSB0)'
|
103
|
+
)
|
104
|
+
|
105
|
+
flipper_zero_obj = #{self}.connect(
|
106
|
+
block_dev: 'optional serial block device path (defaults to /dev/ttyUSB0)',
|
107
|
+
baud: 'optional (defaults to 9600)',
|
108
|
+
data_bits: 'optional (defaults to 8)',
|
109
|
+
stop_bits: 'optional (defaults to 1)',
|
110
|
+
parity: 'optional - :even||:odd|:none (defaults to :none)'
|
111
|
+
)
|
112
|
+
|
113
|
+
response = #{self}.request(
|
114
|
+
flipper_zero_obj: 'required - flipper_zero_obj returned from #connect method',
|
115
|
+
payload: 'required - payload to send to the device'
|
116
|
+
)
|
117
|
+
|
118
|
+
#{self}.disconnect(
|
119
|
+
flipper_zero_obj: 'required - flipper_zero_obj returned from #connect method'
|
120
|
+
)
|
121
|
+
|
122
|
+
#{self}.authors
|
123
|
+
"
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
data/lib/pwn/plugins/serial.rb
CHANGED
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.232
|
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
|