pwn 0.5.293 → 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: 1b7343c36fed4d4a0795c1513c2c42a2ec7aac80ddbb9d7b751945aff0c7d4cd
4
- data.tar.gz: 4203c947d2645b357d8e6fe832f163c632218af25fa27a20a4868784f23e6a9f
3
+ metadata.gz: 6566980d42184b4c0ef1c4c8d110baf0e4492b3f059a2cf792f259fcb7139188
4
+ data.tar.gz: 993d8b37e6682844c751b999eaabe348592802a84632dd6fcf7eabe7033dd2ba
5
5
  SHA512:
6
- metadata.gz: ef66a32ee77051d89127d61eabd4d03d930daf3e07816190c2d6fdd1084051889ac3f121c1b488693653a223aac17ddf0377ddc94cbbc4cd43ff49b6dd323e53
7
- data.tar.gz: 2f806df0065c13644e9b2572bfb3911e472aebd178d508cf72b60ead6b5b63656f3ca2a25ac2dc649b32e25139dc65272a7f9705049ba216b823907d95854976
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.293]: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.293]: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.293]: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',
@@ -168,10 +168,10 @@ module PWN
168
168
  issue_type = opts[:issue_type]
169
169
  raise 'ERROR: issue_type values must be one of :epic, :story, or :bug.' unless %i[epic story bug].include?(issue_type)
170
170
 
171
- description = opts[:description]
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.293'
4
+ VERSION = '0.5.295'
5
5
  end
@@ -665,9 +665,10 @@
665
665
  {"messages":[{"role":"user","content":"PWN::Plugins::Jenkins.list_nested_jobs Usage"},{"role":"assistant","content":"`PWN::Plugins::Jenkins.list_nested_jobs`: Supported Method Parameters\n\nPWN::Plugins::Jenkins.list_nested_jobs(\n\njenkins_obj: 'required jenkins_obj returned from #connect method',\nview_path: 'required view path to list jobs'\n\n)\n"}]}
666
666
  {"messages":[{"role":"user","content":"PWN::Plugins::Jenkins.list_nested_views Usage"},{"role":"assistant","content":"`PWN::Plugins::Jenkins.list_nested_views`: Supported Method Parameters\n\nPWN::Plugins::Jenkins.list_nested_views(\n\njenkins_obj: 'required jenkins_obj returned from #connect method',\nview_path: 'required view path list sub-views'\n\n)\n"}]}
667
667
  {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.authors Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
668
- {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.get_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.get_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraServer.get_issue(\n\nbase_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',\ntoken: 'required - bearer token',\nissue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',\nparams: 'optional - additional parameters to pass in the URI'\n\n)\n"}]}
668
+ {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.create_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.create_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraServer.create_issue(\n\nbase_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',\ntoken: 'required - bearer token',\nproject_key: 'required - project key (e.g. PWN)',\nsummary: 'required - summary of the issue (e.g. Epic for PWN-1337)',\nissue_type: 'required - issue type (e.g. :epic, :story, :bug)',\ndescription: 'optional - description of the issue',\nepic_name: 'optional - name of the epic',\nadditional_fields: 'optional - additional fields to set in the issue (e.g. labels, components, custom fields, etc.)'\n\n)\n"}]}
669
+ {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.get_all_fields Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.get_all_fields`: Supported Method Parameters\n\nall_fields = PWN::Plugins::JiraServer.get_all_fields(\n\nbase_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',\ntoken: 'required - bearer token'\n\n)\n"}]}
670
+ {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.get_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.get_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraServer.get_issue(\n\nbase_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',\ntoken: 'required - bearer token',\nissue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',\nparams: 'optional - additional parameters to pass in the URI (e.g. fields, expand, etc.)'\n\n)\n"}]}
669
671
  {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.help Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.help`: "}]}
670
- {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.manual_call Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.manual_call`: Supported Method Parameters\n\njira_resp = PWN::Plugins::JiraServer.manual_call(\n\nbase_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',\ntoken: 'required - bearer token',\npath: 'required - API path to call, without beginning forward slash',\nparams: 'optional - additional parameters to pass in the URI'\n\n)\n"}]}
671
672
  {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.rest_call Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.rest_call`: Supported Method Parameters\n\nrest_call(\n\ntoken: 'required - bearer token',\nhttp_method: 'optional HTTP method (defaults to GET)',\nrest_call: 'required rest call to make per the schema',\nparams: 'optional params passed in the URI or HTTP Headers',\nhttp_body: 'optional HTTP body sent in HTTP methods that support it e.g. POST'\n\n)\n"}]}
672
673
  {"messages":[{"role":"user","content":"PWN::Plugins::Log.append Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.append`: Supported Method Parameters\n\nPWN::Log.create( )\n"}]}
673
674
  {"messages":[{"role":"user","content":"PWN::Plugins::Log.authors Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
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.293
4
+ version: 0.5.295
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.