pwn 0.5.230 → 0.5.231

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7af8e67a2f1debdf6740514a5c0f0b447d8b2e3020ec722c089ad7686492c760
4
- data.tar.gz: 26fcb204bd1248eda0e941df4b0c7c55dacc8efa718fb67af994d3a3e66785a9
3
+ metadata.gz: d675dc77a942b4bd3de91ba881adf1e4527c72540ac4b895ab4eb4811f46653a
4
+ data.tar.gz: e308821bcd440f215af4016aeeedaaacf5bd42db8a4a10386905005a22a0c925
5
5
  SHA512:
6
- metadata.gz: a3df6c9362495ef739f14ad4730624722639cbf60e666f2c75d9026b36d1b419edda106c8b03f03e8e958e2786354a05c71d1bbc4f1a92df9a64f34c62bcca42
7
- data.tar.gz: e954c806a59456360e755695c0290acd2e067fde05982d6b81a2cd21b3fa22c95c6549e64e2b964e387eb265f86673d7b2c82e4b6b8d7b736483e6dcb9f3b3d1
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.230]:001 >>> PWN.help
40
+ pwn[v0.5.231]: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.230]:001 >>> PWN.help
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.230]:001 >>> PWN.help
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.5.230'
4
+ VERSION = '0.5.231'
5
5
  end
@@ -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.230
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-14 00:00:00.000000000 Z
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