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 +4 -4
- data/Gemfile +1 -1
- data/README.md +3 -3
- data/lib/pwn/plugins/jira_data_center.rb +79 -84
- data/lib/pwn/plugins/repl.rb +2 -2
- data/lib/pwn/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be16c14d474f80d808e7389475a17ec6d7dc52cb4da44395ef516810a7054ae2
|
4
|
+
data.tar.gz: 4e33ef6a047b000581e6fa1aa94ac177f00324ef011f60b43ad0fa2a01435c11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c561adc55354180fc0d53ca294e83693ee8ddcd625fe75f99b357e5cfb697bc95fdb9326c01e939c22f2cf2f80ff1bc00fe8a4b111e3eb889bffa02992dd248
|
7
|
+
data.tar.gz: 841188de9b7921592cf1baa653e74eab49a7039468506930d095cdbe6076bfcd55071c99554d010ce1642e88d9730bf623fa912d67ee05a30ae4902c4790d7ef
|
data/Gemfile
CHANGED
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.480]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](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.
|
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.
|
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
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
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
|
-
|
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
|
-
|
251
|
-
|
252
|
-
|
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
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
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
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
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
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
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
|
-
|
280
|
-
|
281
|
-
|
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
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
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
|
data/lib/pwn/plugins/repl.rb
CHANGED
@@ -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,
|
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}
|
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
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.
|
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.
|
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.
|
529
|
+
version: 2.9.0
|
530
530
|
- !ruby/object:Gem::Dependency
|
531
531
|
name: meshtastic
|
532
532
|
requirement: !ruby/object:Gem::Requirement
|