pwn 0.5.479 → 0.5.480

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: 46bdd92940f5057f6b82e630831a4093fab6663faf52a0ec132bd76ee51d4e7b
4
- data.tar.gz: 15d6da128800eccfdcb442ba83f2d2b590ea78824c27afdb5cdb5185798857b8
3
+ metadata.gz: be16c14d474f80d808e7389475a17ec6d7dc52cb4da44395ef516810a7054ae2
4
+ data.tar.gz: 4e33ef6a047b000581e6fa1aa94ac177f00324ef011f60b43ad0fa2a01435c11
5
5
  SHA512:
6
- metadata.gz: 1f85fef86b43520d167d4ee6fd2270aff7c665b21c9011691aab17fb944f52ee1bbc9a66e6daa2fefaae83c05dbca5631f636b82a62169d4db42cb7f21ae4ebf
7
- data.tar.gz: 964c7ac4f2b29c3b8807dc29e23a90ad6a1ce60ca2d99f4bffd49fc3104aa2abed45f97bd42a04e44784e0c8c05a3918e6e9438e4261f3dbd9277d6407fd271a
6
+ metadata.gz: 1c561adc55354180fc0d53ca294e83693ee8ddcd625fe75f99b357e5cfb697bc95fdb9326c01e939c22f2cf2f80ff1bc00fe8a4b111e3eb889bffa02992dd248
7
+ data.tar.gz: 841188de9b7921592cf1baa653e74eab49a7039468506930d095cdbe6076bfcd55071c99554d010ce1642e88d9730bf623fa912d67ee05a30ae4902c4790d7ef
data/Gemfile CHANGED
@@ -48,7 +48,7 @@ gem 'json_schemer', '2.4.0'
48
48
  gem 'jwt', '3.1.2'
49
49
  gem 'libusb', '0.7.2'
50
50
  gem 'luhn', '3.0.0'
51
- gem 'mail', '2.8.1'
51
+ gem 'mail', '2.9.0'
52
52
  gem 'meshtastic', '0.0.132'
53
53
  gem 'metasm', '1.0.5'
54
54
  gem 'mongo', '2.21.3'
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.479]:001 >>> PWN.help
40
+ pwn[v0.5.480]: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.4@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.479]:001 >>> PWN.help
55
+ pwn[v0.5.480]: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.4@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.479]:001 >>> PWN.help
65
+ pwn[v0.5.480]: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:
@@ -220,65 +220,85 @@ module PWN
220
220
  epic_name = opts[:epic_name]
221
221
  raise 'ERROR: epic_name cannot be nil when issue_type is :epic.' if issue_type == :epic && epic_name.nil?
222
222
 
223
- http_body = {
224
- fields: {
225
- project: {
226
- key: project_key
227
- },
228
- summary: summary,
229
- issuetype: {
230
- name: issue_type.to_s.capitalize
231
- },
232
- "#{epic_name_field_key}": epic_name,
233
- description: description
223
+ # Attempt create, dynamically omit unlicensed fields on failure
224
+ create_attempts, get_issue_attempts = 1
225
+ max_create_attempts, max_get_issue_attempts = 7
226
+ created_issue = nil
227
+ begin
228
+ http_body = {
229
+ fields: {
230
+ project: {
231
+ key: project_key
232
+ },
233
+ summary: summary,
234
+ issuetype: {
235
+ name: issue_type.to_s.capitalize
236
+ },
237
+ "#{epic_name_field_key}": epic_name,
238
+ description: description
239
+ }
234
240
  }
235
- }
236
-
237
- http_body[:fields].merge!(additional_fields[:fields])
238
-
239
- issue_resp = rest_call(
240
- http_method: :post,
241
- rest_call: 'issue',
242
- http_body: http_body
243
- )
244
- issue = issue_resp[:key]
245
241
 
246
- if attachments.any?
247
- attachments.each do |attachment|
248
- raise "ERROR: #{attachment} not found." unless File.exist?(attachment)
242
+ http_body[:fields].merge!(additional_fields[:fields])
249
243
 
250
- http_body = {
251
- multipart: true,
252
- file: File.new(attachment, 'rb')
253
- }
244
+ issue_resp = rest_call(
245
+ http_method: :post,
246
+ rest_call: 'issue',
247
+ http_body: http_body
248
+ )
249
+ issue = issue_resp[:key]
250
+
251
+ if attachments.any?
252
+ attachments.each do |attachment|
253
+ raise "ERROR: #{attachment} not found." unless File.exist?(attachment)
254
+
255
+ http_body = {
256
+ multipart: true,
257
+ file: File.new(attachment, 'rb')
258
+ }
259
+
260
+ rest_call(
261
+ http_method: :post,
262
+ rest_call: "issue/#{issue}/attachments",
263
+ http_body: http_body
264
+ )
265
+ end
266
+ end
254
267
 
255
- rest_call(
256
- http_method: :post,
257
- rest_call: "issue/#{issue}/attachments",
258
- http_body: http_body
268
+ if comment
269
+ issue_comment(
270
+ issue: issue,
271
+ comment_action: :add,
272
+ comment: comment
259
273
  )
260
274
  end
261
- end
262
275
 
263
- if comment
264
- issue_comment(
265
- issue: issue,
266
- comment_action: :add,
267
- comment: comment
268
- )
269
- end
276
+ begin
277
+ created_issue = get_issue(issue: issue)
278
+ rescue RuntimeError
279
+ raise 'ERROR: Max attempts reached for retrieving created issue.' if get_issue_attempts > max_get_issue_attempts
270
280
 
271
- created_issue = nil
272
- get_issue_attempts = 0
273
- max_get_issue_attempts = 7
274
- begin
275
- created_issue = get_issue(issue: issue)
276
- rescue RuntimeError
277
- raise 'ERROR: Max attempts reached for retrieving created issue.' if get_issue_attempts > max_get_issue_attempts
281
+ get_issue_attempts += 1
282
+ sleep 3
283
+ retry
284
+ end
285
+ rescue RestClient::ExceptionWithResponse => e
286
+ raise e if create_attempts >= max_create_attempts || e.response.body.to_s.empty?
278
287
 
279
- get_issue_attempts += 1
280
- sleep 7
281
- retry
288
+ json = JSON.parse(e.response.body, symbolize_names: true)
289
+ errors_hash = json[:errors] if json.is_a?(Hash)
290
+ if errors_hash.is_a?(Hash)
291
+ unlicensed_field_keys = errors_hash.select { |_fk, msg| msg.to_s =~ /unlicensed/i }.keys
292
+ if unlicensed_field_keys.any?
293
+ unlicensed_field_keys.each do |fk|
294
+ additional_fields[:fields].delete(fk.to_sym)
295
+ additional_fields[:fields].delete(fk.to_s)
296
+ end
297
+ @@logger.warn("Omitting unlicensed fields: #{unlicensed_field_keys.join(', ')} (attempt #{create_attempts}/#{max_create_attempts}). Retrying issue creation.") if defined?(@@logger)
298
+ create_attempts += 1
299
+ retry
300
+ end
301
+ end
282
302
  end
283
303
 
284
304
  created_issue
@@ -530,40 +550,15 @@ module PWN
530
550
  end
531
551
  end
532
552
 
533
- # Attempt create, dynamically omit unlicensed fields on failure
534
- attempt = 1
535
- max_attempts = 5
536
- cloned_issue = nil
537
- begin
538
- cloned_issue = create_issue(
539
- project_key: project_key,
540
- summary: summary,
541
- issue_type: issue_type,
542
- epic_name: epic_name,
543
- description: description,
544
- additional_fields: additional_fields,
545
- attachments: attachments
546
- )
547
- rescue RestClient::ExceptionWithResponse => e
548
- raise e if attempt >= max_attempts || e.response.body.to_s.empty?
549
-
550
- json = JSON.parse(e.response.body, symbolize_names: true)
551
- errors_hash = json[:errors] if json.is_a?(Hash)
552
- if errors_hash.is_a?(Hash)
553
- unlicensed_field_keys = errors_hash.select { |_fk, msg| msg.to_s =~ /unlicensed/i }.keys
554
- if unlicensed_field_keys.any?
555
- unlicensed_field_keys.each do |fk|
556
- additional_fields[:fields].delete(fk.to_sym)
557
- additional_fields[:fields].delete(fk.to_s)
558
- end
559
- @@logger.warn("Omitting unlicensed fields: #{unlicensed_field_keys.join(', ')} (attempt #{attempt}/#{max_attempts}). Retrying clone.") if defined?(@@logger)
560
- attempt += 1
561
- retry
562
- end
563
- end
564
- end
565
-
566
- cloned_issue
553
+ create_issue(
554
+ project_key: project_key,
555
+ summary: summary,
556
+ issue_type: issue_type,
557
+ epic_name: epic_name,
558
+ description: description,
559
+ additional_fields: additional_fields,
560
+ attachments: attachments
561
+ )
567
562
  rescue StandardError => e
568
563
  raise e
569
564
  end
@@ -478,11 +478,11 @@ module PWN
478
478
  Curses.use_default_colors
479
479
 
480
480
  rx_height = Curses.lines - 4
481
- rx_win = Curses::Window.new(rx_height, Curses.cols, 0, 0)
481
+ rx_win = Curses::Window.new(rx_height, Curses.cols, 2, 0)
482
482
  rx_win.scrollok(true)
483
483
  rx_win.nodelay = true
484
484
  rx_win.box('|', "\u2500")
485
- rx_win.addstr("#{host}:#{port} >>> #{region}/#{topic}:#{channel_num} >>> Messages >>>\n")
485
+ rx_win.addstr("<<< #{host}:#{port} | #{region}/#{topic} | ch:#{channel_num} >>>\n")
486
486
  rx_win.refresh
487
487
 
488
488
  tx_win = Curses::Window.new(4, Curses.cols, rx_height, 0)
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.479'
4
+ VERSION = '0.5.480'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.479
4
+ version: 0.5.480
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
@@ -519,14 +519,14 @@ dependencies:
519
519
  requirements:
520
520
  - - '='
521
521
  - !ruby/object:Gem::Version
522
- version: 2.8.1
522
+ version: 2.9.0
523
523
  type: :runtime
524
524
  prerelease: false
525
525
  version_requirements: !ruby/object:Gem::Requirement
526
526
  requirements:
527
527
  - - '='
528
528
  - !ruby/object:Gem::Version
529
- version: 2.8.1
529
+ version: 2.9.0
530
530
  - !ruby/object:Gem::Dependency
531
531
  name: meshtastic
532
532
  requirement: !ruby/object:Gem::Requirement