pwn 0.5.464 → 0.5.465
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6792689d167c339a391cc45b7d41fe467aa653fd6418ddc7e53b49c5fb1de1ad
|
4
|
+
data.tar.gz: 26afab02dd6c618dc80694baec6048abdf979ca08c77005bd7a2106e6e892f07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b0b7c19d91dbae303dee707debef817ee50022fce9cead6c47d5c1a84f8fa734e365e6e6b94716c69e139a8574c208be6375ef6417520fe3e1b68d1d2d22ef2
|
7
|
+
data.tar.gz: c2a9fc67b025a47538c6a93eda0b2ed0b49b41bdbe4c68466b0e34785e59f154e05b8d7f53c45c32c344676f1016e4b47d343b82076ab7c899ed1972d496bac5
|
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.465]: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.465]: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.465]: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:
|
data/lib/pwn/config.rb
CHANGED
@@ -9,7 +9,7 @@ module PWN
|
|
9
9
|
# the 'rest' browser type of PWN::Plugins::TransparentBrowser.
|
10
10
|
# This is based on the following Jira API Specification:
|
11
11
|
# https://developer.atlassian.com/server/jira/platform/rest-apis/
|
12
|
-
module
|
12
|
+
module JiraDataCenter
|
13
13
|
@@logger = PWN::Plugins::PWNLogger.create
|
14
14
|
|
15
15
|
# Supported Method Parameters::
|
@@ -22,7 +22,7 @@ module PWN
|
|
22
22
|
# )
|
23
23
|
|
24
24
|
private_class_method def self.rest_call(opts = {})
|
25
|
-
jserver = PWN::Env[:plugins][:
|
25
|
+
jserver = PWN::Env[:plugins][:jira_data_center]
|
26
26
|
raise 'ERROR: Jira Server Hash not found in PWN::Env. Run i`pwn -Y default.yaml`, then `PWN::Env` for usage.' if jserver.nil?
|
27
27
|
|
28
28
|
base_uri = jserver[:base_uri]
|
@@ -131,7 +131,7 @@ module PWN
|
|
131
131
|
end
|
132
132
|
|
133
133
|
# Supported Method Parameters::
|
134
|
-
# all_fields = PWN::Plugins::
|
134
|
+
# all_fields = PWN::Plugins::JiraDataCenter.get_all_fields
|
135
135
|
|
136
136
|
public_class_method def self.get_all_fields
|
137
137
|
rest_call(rest_call: 'field')
|
@@ -140,7 +140,7 @@ module PWN
|
|
140
140
|
end
|
141
141
|
|
142
142
|
# Supported Method Parameters::
|
143
|
-
# user = PWN::Plugins::
|
143
|
+
# user = PWN::Plugins::JiraDataCenter.get_user(
|
144
144
|
# username: 'required - username to lookup (e.g. jane.doe)',
|
145
145
|
# params: 'optional - additional parameters to pass in the URI (e.g. expand, etc.)'
|
146
146
|
# )
|
@@ -163,7 +163,7 @@ module PWN
|
|
163
163
|
end
|
164
164
|
|
165
165
|
# Supported Method Parameters::
|
166
|
-
# issue_resp = PWN::Plugins::
|
166
|
+
# issue_resp = PWN::Plugins::JiraDataCenter.get_issue(
|
167
167
|
# issue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',
|
168
168
|
# params: 'optional - additional parameters to pass in the URI (e.g. fields, expand, etc.)'
|
169
169
|
# )
|
@@ -183,7 +183,7 @@ module PWN
|
|
183
183
|
end
|
184
184
|
|
185
185
|
# Supported Method Parameters::
|
186
|
-
# issue_resp = PWN::Plugins::
|
186
|
+
# issue_resp = PWN::Plugins::JiraDataCenter.create_issue(
|
187
187
|
# project_key: 'required - project key (e.g. PWN)',
|
188
188
|
# summary: 'required - summary of the issue (e.g. Epic for PWN-1337)',
|
189
189
|
# issue_type: 'required - issue type (e.g. :epic, :story, :bug)',
|
@@ -287,7 +287,7 @@ module PWN
|
|
287
287
|
end
|
288
288
|
|
289
289
|
# Supported Method Parameters::
|
290
|
-
# issue_resp = PWN::Plugins::
|
290
|
+
# issue_resp = PWN::Plugins::JiraDataCenter.update_issue(
|
291
291
|
# fields: 'required - fields to update in the issue (e.g. summary, description, labels, components, custom fields, etc.)',
|
292
292
|
# attachments: 'optional - array of attachment paths to upload to the issue (e.g. ["/tmp/file1.txt", "/tmp/file2.txt"])',
|
293
293
|
# )
|
@@ -335,7 +335,7 @@ module PWN
|
|
335
335
|
end
|
336
336
|
|
337
337
|
# Supported Method Parameters::
|
338
|
-
# issue_resp = PWN::Plugins::
|
338
|
+
# issue_resp = PWN::Plugins::JiraDataCenter.issue_comment(
|
339
339
|
# issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)',
|
340
340
|
# comment_action: 'required - action to perform on the issue comment (e.g. :delete, :add, :update - Defaults to :add)',
|
341
341
|
# comment_id: 'optional - comment ID to delete or update (e.g. 10000)',
|
@@ -385,7 +385,7 @@ module PWN
|
|
385
385
|
end
|
386
386
|
|
387
387
|
# Supported Method Parameters::
|
388
|
-
# issue_type_metadata = PWN::Plugins::
|
388
|
+
# issue_type_metadata = PWN::Plugins::JiraDataCenter.get_issue_type_metadata(
|
389
389
|
# project_key: 'required - project key (e.g. PWN)',
|
390
390
|
# issue_type_id: 'required - issue type ID (e.g. issue[:fields][:issuetype][:id] from #get_issue method)'
|
391
391
|
# )
|
@@ -403,7 +403,7 @@ module PWN
|
|
403
403
|
end
|
404
404
|
|
405
405
|
# Supported Method Parameters::
|
406
|
-
# issue_resp = PWN::Plugins::
|
406
|
+
# issue_resp = PWN::Plugins::JiraDataCenter.clone_issue(
|
407
407
|
# issue: 'required - issue to clone (e.g. Bug, Issue, Story, or Epic ID)'
|
408
408
|
# )
|
409
409
|
|
@@ -416,49 +416,51 @@ module PWN
|
|
416
416
|
project_key = issue_data[:fields][:project][:key]
|
417
417
|
summary = "CLONE - #{issue_data[:fields][:summary]}"
|
418
418
|
|
419
|
-
|
419
|
+
issue_type = issue_data[:fields][:issuetype][:name].downcase.to_sym
|
420
|
+
issue_type_id = issue_data[:fields][:issuetype][:id]
|
420
421
|
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
# epic_name = nil
|
430
|
-
# if issue_type == :epic
|
431
|
-
# all_fields = get_all_fields
|
432
|
-
# epic_name_field_key = all_fields.find { |field| field[:name] == 'Epic Name' }[:id]
|
433
|
-
# epic_name = issue_data[:fields][epic_name_field_key.to_sym]
|
434
|
-
# end
|
435
|
-
# description = issue_data[:fields][:description]
|
422
|
+
epic_name = nil
|
423
|
+
if issue_type == :epic
|
424
|
+
all_fields = get_all_fields
|
425
|
+
epic_name_field_key = all_fields.find { |field| field[:name] == 'Epic Name' }[:id]
|
426
|
+
epic_name = issue_data[:fields][epic_name_field_key.to_sym]
|
427
|
+
end
|
428
|
+
description = issue_data[:fields][:description]
|
436
429
|
# TODO: Better Field Handling:
|
437
430
|
# GET issue/createmeta/{projectIdOrKey}/issuetypes/{issueTypeId}
|
438
431
|
# to discover required/allowed fields dynamically before
|
439
432
|
# building the payload. Copy only what makes sense—some fields
|
440
433
|
# (e.g., status, created date) can't be set on creation.
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
434
|
+
issue_type_metadata = get_issue_type_metadata(
|
435
|
+
project_key: project_key,
|
436
|
+
issue_type_id: issue_type_id
|
437
|
+
)
|
438
|
+
issue_type_metadata_filter = issue_type_metadata[:fields].select do |field_key, field_value|
|
439
|
+
issue_data[:fields].key?(field_key.to_sym) &&
|
440
|
+
!field_value[:required] == false &&
|
441
|
+
!%w[status created updated resolution].include?(field_key)
|
442
|
+
end
|
443
|
+
|
444
|
+
filtered_fields = issue_type_metadata_filter.each_with_object({}) do |(field_key, _field_value), acc|
|
445
|
+
acc[field_key.to_sym] = issue_data[:fields][field_key.to_sym]
|
446
|
+
end
|
447
|
+
|
448
|
+
additional_fields = { fields: filtered_fields }
|
449
|
+
|
450
|
+
create_issue(
|
451
|
+
project_key: project_key,
|
452
|
+
summary: summary,
|
453
|
+
issue_type: issue_type,
|
454
|
+
epic_name: epic_name,
|
455
|
+
description: description,
|
456
|
+
additional_fields: additional_fields
|
457
|
+
)
|
456
458
|
rescue StandardError => e
|
457
459
|
raise e
|
458
460
|
end
|
459
461
|
|
460
462
|
# Supported Method Parameters::
|
461
|
-
# issue_resp = PWN::Plugins::
|
463
|
+
# issue_resp = PWN::Plugins::JiraDataCenter.delete_issue(
|
462
464
|
# issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'
|
463
465
|
# )
|
464
466
|
|
@@ -475,7 +477,7 @@ module PWN
|
|
475
477
|
end
|
476
478
|
|
477
479
|
# Supported Method Parameters::
|
478
|
-
# issue_resp = PWN::Plugins::
|
480
|
+
# issue_resp = PWN::Plugins::JiraDataCenter.delete_attachment(
|
479
481
|
# id: 'required - attachment ID to delete (e.g. 10000) found in #get_issue method'
|
480
482
|
# )
|
481
483
|
|
data/lib/pwn/plugins.rb
CHANGED
@@ -35,7 +35,7 @@ module PWN
|
|
35
35
|
autoload :IPInfo, 'pwn/plugins/ip_info'
|
36
36
|
autoload :IRC, 'pwn/plugins/irc'
|
37
37
|
autoload :Jenkins, 'pwn/plugins/jenkins'
|
38
|
-
autoload :
|
38
|
+
autoload :JiraDataCenter, 'pwn/plugins/jira_data_center'
|
39
39
|
autoload :JSONPathify, 'pwn/plugins/json_pathify'
|
40
40
|
autoload :Log, 'pwn/plugins/log'
|
41
41
|
autoload :MailAgent, 'pwn/plugins/mail_agent'
|
data/lib/pwn/version.rb
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe PWN::Plugins::
|
5
|
+
describe PWN::Plugins::JiraDataCenter do
|
6
6
|
it 'should display information for authors' do
|
7
|
-
authors_response = PWN::Plugins::
|
7
|
+
authors_response = PWN::Plugins::JiraDataCenter
|
8
8
|
expect(authors_response).to respond_to :authors
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'should display information for existing help method' do
|
12
|
-
help_response = PWN::Plugins::
|
12
|
+
help_response = PWN::Plugins::JiraDataCenter
|
13
13
|
expect(help_response).to respond_to :help
|
14
14
|
end
|
15
15
|
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.
|
4
|
+
version: 0.5.465
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
@@ -1893,7 +1893,7 @@ files:
|
|
1893
1893
|
- lib/pwn/plugins/ip_info.rb
|
1894
1894
|
- lib/pwn/plugins/irc.rb
|
1895
1895
|
- lib/pwn/plugins/jenkins.rb
|
1896
|
-
- lib/pwn/plugins/
|
1896
|
+
- lib/pwn/plugins/jira_data_center.rb
|
1897
1897
|
- lib/pwn/plugins/json_pathify.rb
|
1898
1898
|
- lib/pwn/plugins/log.rb
|
1899
1899
|
- lib/pwn/plugins/mail_agent.rb
|
@@ -2246,7 +2246,7 @@ files:
|
|
2246
2246
|
- spec/lib/pwn/plugins/ip_info_spec.rb
|
2247
2247
|
- spec/lib/pwn/plugins/irc_spec.rb
|
2248
2248
|
- spec/lib/pwn/plugins/jenkins_spec.rb
|
2249
|
-
- spec/lib/pwn/plugins/
|
2249
|
+
- spec/lib/pwn/plugins/jira_data_center_spec.rb
|
2250
2250
|
- spec/lib/pwn/plugins/json_pathify_spec.rb
|
2251
2251
|
- spec/lib/pwn/plugins/log_spec.rb
|
2252
2252
|
- spec/lib/pwn/plugins/mail_agent_spec.rb
|