pwn 0.5.463 → 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: 5780100847051667d337b384cd5fc617fe46cface20e5903cd62dc23d59536cd
4
- data.tar.gz: 8607ae725c223b7cd7c84a41d2532baf7cb6f9b623d184706ffa9e2a1c3a998e
3
+ metadata.gz: 6792689d167c339a391cc45b7d41fe467aa653fd6418ddc7e53b49c5fb1de1ad
4
+ data.tar.gz: 26afab02dd6c618dc80694baec6048abdf979ca08c77005bd7a2106e6e892f07
5
5
  SHA512:
6
- metadata.gz: d2add06f66b9dd45458d2aa6b8c1ca0ad31f4af264e8a2c8edb8f9e861b10390244f48dea601bfdf65a29e536201c4b09ab8cb85f523d024498568879a79d556
7
- data.tar.gz: dc0c22a8f9f089c455fdceb78ffc429fb8a3647a8b4a0a7a903d7b5da1e6eb975133e0d2cbea9402cb7455eb32230ac4b1fd6c7581a975e5beff02464766d035
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.463]:001 >>> PWN.help
40
+ pwn[v0.5.465]: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.463]:001 >>> PWN.help
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.463]:001 >>> PWN.help
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
@@ -85,7 +85,7 @@ module PWN
85
85
  }
86
86
  },
87
87
  hunter: { api_key: 'hunter.how API Key' },
88
- jira_server: {
88
+ jira_data_center: {
89
89
  base_uri: 'Jira Server Base API URI (e.g. https://jira.company.com/rest/api/latest)',
90
90
  token: 'Jira Server API Token'
91
91
  },
@@ -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 JiraServer
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][:jira_server]
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::JiraServer.get_all_fields
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::JiraServer.get_user(
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::JiraServer.get_issue(
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::JiraServer.create_issue(
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::JiraServer.update_issue(
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::JiraServer.issue_comment(
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,9 +385,9 @@ module PWN
385
385
  end
386
386
 
387
387
  # Supported Method Parameters::
388
- # issue_type_metadata = PWN::Plugins::JiraServer.get_issue_type_metadata(
388
+ # issue_type_metadata = PWN::Plugins::JiraDataCenter.get_issue_type_metadata(
389
389
  # project_key: 'required - project key (e.g. PWN)',
390
- # issue_type_id: 'required - issue type ID (e.g. 10000)'
390
+ # issue_type_id: 'required - issue type ID (e.g. issue[:fields][:issuetype][:id] from #get_issue method)'
391
391
  # )
392
392
 
393
393
  public_class_method def self.get_issue_type_metadata(opts = {})
@@ -403,7 +403,7 @@ module PWN
403
403
  end
404
404
 
405
405
  # Supported Method Parameters::
406
- # issue_resp = PWN::Plugins::JiraServer.clone_issue(
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
 
@@ -415,6 +415,7 @@ module PWN
415
415
 
416
416
  project_key = issue_data[:fields][:project][:key]
417
417
  summary = "CLONE - #{issue_data[:fields][:summary]}"
418
+
418
419
  issue_type = issue_data[:fields][:issuetype][:name].downcase.to_sym
419
420
  issue_type_id = issue_data[:fields][:issuetype][:id]
420
421
 
@@ -434,7 +435,16 @@ module PWN
434
435
  project_key: project_key,
435
436
  issue_type_id: issue_type_id
436
437
  )
437
- filtered_fields = issue_data[:fields].compact
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
+
438
448
  additional_fields = { fields: filtered_fields }
439
449
 
440
450
  create_issue(
@@ -450,7 +460,7 @@ module PWN
450
460
  end
451
461
 
452
462
  # Supported Method Parameters::
453
- # issue_resp = PWN::Plugins::JiraServer.delete_issue(
463
+ # issue_resp = PWN::Plugins::JiraDataCenter.delete_issue(
454
464
  # issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'
455
465
  # )
456
466
 
@@ -467,7 +477,7 @@ module PWN
467
477
  end
468
478
 
469
479
  # Supported Method Parameters::
470
- # issue_resp = PWN::Plugins::JiraServer.delete_attachment(
480
+ # issue_resp = PWN::Plugins::JiraDataCenter.delete_attachment(
471
481
  # id: 'required - attachment ID to delete (e.g. 10000) found in #get_issue method'
472
482
  # )
473
483
 
@@ -534,7 +544,7 @@ module PWN
534
544
 
535
545
  issue_type_metadata = #{self}.get_issue_type_metadata(
536
546
  project_key: 'required - project key (e.g. PWN)',
537
- issue_type_id: 'required - issue type ID (e.g. 10000)'
547
+ issue_type_id: 'required - issue type ID (e.g. issue[:fields][:issuetype][:id] from #get_issue method)'
538
548
  )
539
549
 
540
550
  issue_resp = #{self}.clone_issue(
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 :JiraServer, 'pwn/plugins/jira_server'
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.5.463'
4
+ VERSION = '0.5.465'
5
5
  end
@@ -2,14 +2,14 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- describe PWN::Plugins::JiraServer do
5
+ describe PWN::Plugins::JiraDataCenter do
6
6
  it 'should display information for authors' do
7
- authors_response = PWN::Plugins::JiraServer
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::JiraServer
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.463
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/jira_server.rb
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/jira_server_spec.rb
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