pwn 0.5.294 → 0.5.295

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: ceafe0b454fd9c71a3f1fa0cfd17eea562bf2bec920e455098d349539c6eb359
4
- data.tar.gz: 92becb6c401010f224ed010bcc28c9800cccacbf1c6fba80010b211ac635de54
3
+ metadata.gz: 6566980d42184b4c0ef1c4c8d110baf0e4492b3f059a2cf792f259fcb7139188
4
+ data.tar.gz: 993d8b37e6682844c751b999eaabe348592802a84632dd6fcf7eabe7033dd2ba
5
5
  SHA512:
6
- metadata.gz: f3590c9ca8a67466e1db5e41025860f060615a9e232312df4906ca48d02eb664c7fb7b7f8e87adb6b8f5b9e7506dc40b97248b33fa6c2835e45ab8222ffebeae
7
- data.tar.gz: e2df1bdf36cfe2f3494f7f18c7767cea1fc18c2dd7859f3a31ff07a999d640f14710c45026c1a26097d3e5fc0f1bc872a91700a4c320db6e02ce966ac0b24f11
6
+ metadata.gz: e39119ed85012beac51422fc4bc8608d6922f82863f5a8172162ea429fc076be5e17809c7d787a1fc932f9413ec6efccb204e5a2e7d36f01646137fdbd14e343
7
+ data.tar.gz: 19f370fc5a9141fe134e7bdd7cb4b891886ae6b94d92eb16a078d7529391b920263e7e393e5f4072ae155b0bb4ad325c3f80dcd4f77046bfc8a0ff8c8616e0f5
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.294]:001 >>> PWN.help
40
+ pwn[v0.5.295]: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.294]:001 >>> PWN.help
55
+ pwn[v0.5.295]: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.294]:001 >>> PWN.help
65
+ pwn[v0.5.295]: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:
@@ -43,9 +43,9 @@ module PWN
43
43
  spinner.auto_spin
44
44
 
45
45
  case http_method
46
- when :get
46
+ when :delete, :get
47
47
  response = rest_client.execute(
48
- method: :get,
48
+ method: http_method,
49
49
  url: "#{base_api_uri}/#{rest_call}",
50
50
  headers: {
51
51
  content_type: 'application/json; charset=UTF-8',
@@ -55,9 +55,9 @@ module PWN
55
55
  verify_ssl: false
56
56
  )
57
57
 
58
- when :post
58
+ when :post, :put
59
59
  response = rest_client.execute(
60
- method: :post,
60
+ method: http_method,
61
61
  url: "#{base_api_uri}/#{rest_call}",
62
62
  headers: {
63
63
  content_type: 'application/json; charset=UTF-8',
@@ -171,7 +171,7 @@ module PWN
171
171
  description = opts[:description].to_s.scrub
172
172
 
173
173
  additional_fields = opts[:additional_fields] ||= { fields: {} }
174
- raise 'ERROR: additional_fields Hash must contain a :fields key.' unless additional_fields.is_a?(Hash) && additional_fields.key?(:fields)
174
+ raise 'ERROR: additional_fields Hash must contain a :fields key that is also a Hash.' unless additional_fields.is_a?(Hash) && additional_fields.key?(:fields) && additional_fields[:fields].is_a?(Hash)
175
175
 
176
176
  all_fields = get_all_fields(base_api_uri: base_api_uri, token: token)
177
177
  epic_name_field_key = all_fields.find { |field| field[:name] == 'Epic Name' }[:id]
@@ -205,6 +205,68 @@ module PWN
205
205
  raise e
206
206
  end
207
207
 
208
+ # Supported Method Parameters::
209
+ # issue_resp = PWN::Plugins::JiraServer.update_issue(
210
+ # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
211
+ # token: 'required - bearer token',
212
+ # fields: 'required - fields to update in the issue (e.g. summary, description, labels, components, custom fields, etc.)'
213
+ # )
214
+
215
+ public_class_method def self.update_issue(opts = {})
216
+ base_api_uri = opts[:base_api_uri]
217
+
218
+ token = opts[:token]
219
+ token ||= PWN::Plugins::AuthenticationHelper.mask_password(
220
+ prompt: 'Personal Access Token'
221
+ )
222
+ issue = opts[:issue]
223
+ raise 'ERROR: project_key cannot be nil.' if issue.nil?
224
+
225
+ fields = opts[:fields] ||= { fields: {} }
226
+ raise 'ERROR: fields Hash must contain a :fields key that is also a Hash.' unless fields.is_a?(Hash) && fields.key?(:fields) && fields[:fields].is_a?(Hash)
227
+
228
+ http_body = fields
229
+
230
+ rest_call(
231
+ http_method: :put,
232
+ base_api_uri: base_api_uri,
233
+ token: token,
234
+ rest_call: "issue/#{issue}",
235
+ http_body: http_body
236
+ )
237
+ rescue StandardError => e
238
+ raise e
239
+ end
240
+
241
+ # Supported Method Parameters::
242
+ # issue_resp = PWN::Plugins::JiraServer.delete_issue(
243
+ # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
244
+ # token: 'required - bearer token',
245
+ # issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'
246
+ # )
247
+
248
+ public_class_method def self.delete_issue(opts = {})
249
+ base_api_uri = opts[:base_api_uri]
250
+
251
+ token = opts[:token]
252
+ token ||= PWN::Plugins::AuthenticationHelper.mask_password(
253
+ prompt: 'Personal Access Token'
254
+ )
255
+
256
+ issue = opts[:issue]
257
+
258
+ raise 'ERROR: issue cannot be nil.' if issue.nil?
259
+
260
+ rest_call(
261
+ http_method: :delete,
262
+ base_api_uri: base_api_uri,
263
+ token: token,
264
+ rest_call: "issue/#{issue}"
265
+ )
266
+ rescue StandardError => e
267
+ raise e
268
+ end
269
+
208
270
  # Author(s):: 0day Inc. <support@0dayinc.com>
209
271
 
210
272
  public_class_method def self.authors
@@ -240,6 +302,13 @@ module PWN
240
302
  additional_fields: 'optional - additional fields to set in the issue (e.g. labels, components, custom fields, etc.)'
241
303
  )
242
304
 
305
+ issue_resp = #{self}.update_issue(
306
+ base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
307
+ token: 'required - bearer token',
308
+ issue: 'required - issue to update (e.g. Bug, Issue, Story, or Epic ID)',
309
+ fields: 'required - fields to update in the issue (e.g. summary, description, labels, components, custom fields, etc.)'
310
+ )
311
+
243
312
  **********************************************************************
244
313
  * For more information on the Jira Server REST API, see:
245
314
  * https://developer.atlassian.com/server/jira/platform/rest-apis/
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.294'
4
+ VERSION = '0.5.295'
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.294
4
+ version: 0.5.295
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.