pwn 0.5.297 → 0.5.299

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: d2a882d84c8a39cad218cec303b531edc9b7a0b8f8318a8d14731a666b898101
4
- data.tar.gz: a87c7ff03ea231c405454b4e0f98df6d51648cb272a772bf4b518f5e2dbc7a6d
3
+ metadata.gz: af46a593739423417d1dd15c931f7f37c55ed52926549f004968d546e7586205
4
+ data.tar.gz: 8692d44970df90db4f6a93a14918b7af5ef77fa10082e3f222431ce8b0ab230f
5
5
  SHA512:
6
- metadata.gz: 016cd67f87c5889557383311d6ea0d3a73f772c187ed2e8714983a452957d753a4a08b13f5a5c0831c0babf1df80e4ede655163309f6a0ca2298ea75770368d2
7
- data.tar.gz: a0ab7b93947a1243a4fee67fe413f3de98497c0e1d0a9a9a373e5d7f08623d70cd633c43a14facd94b07b3db4b5e9f85a04304702e049777aa5b7530204b4e26
6
+ metadata.gz: 8836abe59e41a4cca98606832090f847cc3b4882b3009fd758745ec4743eda1f09464c0a06182f1761d136be8689b6fdc644d2a6a4d01ca6a0457f0ac4bb6eff
7
+ data.tar.gz: 1297d4272044241237fc52d22a8bd6d00e9c9e39e67e9144685bf387819be86e3df1f9695fc5a3ef464502c57a2ed8ad75f54129695343d923dccec84ad93cfe
data/Gemfile CHANGED
@@ -27,7 +27,7 @@ gem 'colorize', '1.1.0'
27
27
  gem 'credit_card_validations', '7.0.0'
28
28
  gem 'eventmachine', '1.2.7'
29
29
  gem 'executable-hooks', '1.7.1'
30
- gem 'faker', '3.5.1'
30
+ gem 'faker', '3.5.2'
31
31
  gem 'faye-websocket', '0.12.0'
32
32
  gem 'ffi', '1.17.2'
33
33
  gem 'fftw3', '0.3'
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.297]:001 >>> PWN.help
40
+ pwn[v0.5.299]: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.297]:001 >>> PWN.help
55
+ pwn[v0.5.299]: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.297]:001 >>> PWN.help
65
+ pwn[v0.5.299]: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:
@@ -14,7 +14,7 @@ module PWN
14
14
 
15
15
  # Supported Method Parameters::
16
16
  # rest_call(
17
- # token: 'required - bearer token',
17
+ # token: 'required - personal access token',
18
18
  # http_method: 'optional HTTP method (defaults to GET)',
19
19
  # rest_call: 'required rest call to make per the schema',
20
20
  # params: 'optional params passed in the URI or HTTP Headers',
@@ -124,7 +124,7 @@ module PWN
124
124
  # Supported Method Parameters::
125
125
  # all_fields = PWN::Plugins::JiraServer.get_all_fields(
126
126
  # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
127
- # token: 'required - bearer token'
127
+ # token: 'required - personal access token'
128
128
  # )
129
129
 
130
130
  public_class_method def self.get_all_fields(opts = {})
@@ -144,10 +144,44 @@ module PWN
144
144
  raise e
145
145
  end
146
146
 
147
+ # Supported Method Parameters::
148
+ # user = PWN::Plugins::JiraServer.get_user(
149
+ # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
150
+ # token: 'required - personal access token',
151
+ # username: 'required - username to lookup (e.g. jane.doe)',
152
+ # params: 'optional - additional parameters to pass in the URI (e.g. expand, etc.)'
153
+ # )
154
+
155
+ public_class_method def self.get_user(opts = {})
156
+ base_api_uri = opts[:base_api_uri]
157
+
158
+ token = opts[:token]
159
+ token ||= PWN::Plugins::AuthenticationHelper.mask_password(
160
+ prompt: 'Personal Access Token'
161
+ )
162
+
163
+ username = opts[:username]
164
+ raise 'ERROR: username cannot be nil.' if username.nil?
165
+
166
+ params = { key: username }
167
+ additional_params = opts[:params]
168
+
169
+ params.merge!(additional_params) if additional_params.is_a?(Hash)
170
+
171
+ rest_call(
172
+ base_api_uri: base_api_uri,
173
+ token: token,
174
+ rest_call: 'user',
175
+ params: params
176
+ )
177
+ rescue StandardError => e
178
+ raise e
179
+ end
180
+
147
181
  # Supported Method Parameters::
148
182
  # issue_resp = PWN::Plugins::JiraServer.get_issue(
149
183
  # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
150
- # token: 'required - bearer token',
184
+ # token: 'required - personal access token',
151
185
  # issue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',
152
186
  # params: 'optional - additional parameters to pass in the URI (e.g. fields, expand, etc.)'
153
187
  # )
@@ -178,7 +212,7 @@ module PWN
178
212
  # Supported Method Parameters::
179
213
  # issue_resp = PWN::Plugins::JiraServer.create_issue(
180
214
  # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
181
- # token: 'required - bearer token',
215
+ # token: 'required - personal access token',
182
216
  # project_key: 'required - project key (e.g. PWN)',
183
217
  # summary: 'required - summary of the issue (e.g. Epic for PWN-1337)',
184
218
  # issue_type: 'required - issue type (e.g. :epic, :story, :bug)',
@@ -246,7 +280,7 @@ module PWN
246
280
 
247
281
  http_body = {
248
282
  multipart: true,
249
- file: attachments.map { |attachment| File.new(attachment, 'rb') }
283
+ file: attachments.map { |attachment| File.binread(attachment) }
250
284
  }
251
285
 
252
286
  rest_call(
@@ -266,8 +300,9 @@ module PWN
266
300
  # Supported Method Parameters::
267
301
  # issue_resp = PWN::Plugins::JiraServer.update_issue(
268
302
  # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
269
- # token: 'required - bearer token',
270
- # fields: 'required - fields to update in the issue (e.g. summary, description, labels, components, custom fields, etc.)'
303
+ # token: 'required - personal access token',
304
+ # fields: 'required - fields to update in the issue (e.g. summary, description, labels, components, custom fields, etc.)',
305
+ # attachments: 'optional - array of attachment paths to upload to the issue (e.g. ["/path/to/file1.txt", "/path/to/file2.png"])'
271
306
  # )
272
307
 
273
308
  public_class_method def self.update_issue(opts = {})
@@ -283,15 +318,34 @@ module PWN
283
318
  fields = opts[:fields] ||= { fields: {} }
284
319
  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)
285
320
 
321
+ attachments = opts[:attachments] ||= []
322
+
286
323
  http_body = fields
287
324
 
288
- rest_call(
325
+ issue_resp = rest_call(
289
326
  http_method: :put,
290
327
  base_api_uri: base_api_uri,
291
328
  token: token,
292
329
  rest_call: "issue/#{issue}",
293
330
  http_body: http_body
294
331
  )
332
+
333
+ if attachments.any?
334
+ http_body = {
335
+ multipart: true,
336
+ file: attachments.map { |attachment| File.binread(attachment) }
337
+ }
338
+
339
+ rest_call(
340
+ http_method: :post,
341
+ base_api_uri: base_api_uri,
342
+ token: token,
343
+ rest_call: "issue/#{issue}/attachments",
344
+ http_body: http_body
345
+ )
346
+ end
347
+
348
+ issue_resp
295
349
  rescue StandardError => e
296
350
  raise e
297
351
  end
@@ -299,7 +353,7 @@ module PWN
299
353
  # Supported Method Parameters::
300
354
  # issue_resp = PWN::Plugins::JiraServer.delete_issue(
301
355
  # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
302
- # token: 'required - bearer token',
356
+ # token: 'required - personal access token',
303
357
  # issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'
304
358
  # )
305
359
 
@@ -339,38 +393,46 @@ module PWN
339
393
  puts "USAGE:
340
394
  all_fields = #{self}.get_all_fields(
341
395
  base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
342
- token: 'required - bearer token'
396
+ token: 'required - personal access token'
397
+ )
398
+
399
+ user = #{self}.get_user(
400
+ base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
401
+ token: 'required - personal access token',
402
+ username: 'required - username to lookup (e.g. jane.doe')',
403
+ params: 'optional - additional parameters to pass in the URI (e.g. expand, etc.)'
343
404
  )
344
405
 
345
406
  issue_resp = #{self}.get_issue(
346
407
  base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
347
- token: 'required - bearer token',
408
+ token: 'required - personal access token',
348
409
  issue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',
349
410
  params: 'optional - additional parameters to pass in the URI'
350
411
  )
351
412
 
352
413
  issue_resp = #{self}.create_issue(
353
414
  base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
354
- token: 'required - bearer token',
415
+ token: 'required - personal access token',
355
416
  project_key: 'required - project key (e.g. PWN)',
356
417
  summary: 'required - summary of the issue (e.g. Epic for PWN-1337)',
357
418
  issue_type: 'required - issue type (e.g. :epic, :story, :bug)',
358
419
  description: 'optional - description of the issue',
359
420
  epic_name: 'optional - name of the epic',
360
421
  additional_fields: 'optional - additional fields to set in the issue (e.g. labels, components, custom fields, etc.)',
361
- attachments: 'optional - array of attachment paths to upload to the issue (e.g. ['/path/to/file1.txt', '/path/to/file2.png'])'
422
+ attachments: 'optional - array of attachment paths to upload to the issue (e.g. [\"/path/to/file1.txt\", \"/path/to/file2.png\"])'
362
423
  )
363
424
 
364
425
  issue_resp = #{self}.update_issue(
365
426
  base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
366
- token: 'required - bearer token',
427
+ token: 'required - personal access token',
367
428
  issue: 'required - issue to update (e.g. Bug, Issue, Story, or Epic ID)',
368
- fields: 'required - fields to update in the issue (e.g. summary, description, labels, components, custom fields, etc.)'
429
+ fields: 'required - fields to update in the issue (e.g. summary, description, labels, components, custom fields, etc.)',
430
+ attachments: 'optional - array of attachment paths to upload to the issue (e.g. [\"/path/to/file1.txt\", \"/path/to/file2.png\"])'
369
431
  )
370
432
 
371
433
  issue_resp = #{self}.delete_issue(
372
434
  base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
373
- token: 'required - bearer token',
435
+ token: 'required - personal access token',
374
436
  issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'
375
437
  )
376
438
 
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.297'
4
+ VERSION = '0.5.299'
5
5
  end
@@ -665,11 +665,13 @@
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.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"}]}
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.)'\nattachments: 'optional - array of attachment paths to upload to the issue (e.g. [\"/path/to/file1.txt\", \"/path/to/file2.png\"])'\n\n)\n"}]}
669
+ {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.delete_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.delete_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraServer.delete_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 delete (e.g. Bug, Issue, Story, or Epic ID)'\n\n)\n"}]}
669
670
  {"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
671
  {"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"}]}
671
672
  {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.help Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.help`: "}]}
672
673
  {"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"}]}
674
+ {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.update_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.update_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraServer.update_issue(\n\nbase_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',\ntoken: 'required - bearer token',\nfields: 'required - fields to update in the issue (e.g. summary, description, labels, components, custom fields, etc.)'\n\n)\n"}]}
673
675
  {"messages":[{"role":"user","content":"PWN::Plugins::Log.append Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.append`: Supported Method Parameters\n\nPWN::Log.create( )\n"}]}
674
676
  {"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"}]}
675
677
  {"messages":[{"role":"user","content":"PWN::Plugins::Log.help Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.help`: "}]}
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.297
4
+ version: 0.5.299
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
@@ -225,14 +225,14 @@ dependencies:
225
225
  requirements:
226
226
  - - '='
227
227
  - !ruby/object:Gem::Version
228
- version: 3.5.1
228
+ version: 3.5.2
229
229
  type: :runtime
230
230
  prerelease: false
231
231
  version_requirements: !ruby/object:Gem::Requirement
232
232
  requirements:
233
233
  - - '='
234
234
  - !ruby/object:Gem::Version
235
- version: 3.5.1
235
+ version: 3.5.2
236
236
  - !ruby/object:Gem::Dependency
237
237
  name: faye-websocket
238
238
  requirement: !ruby/object:Gem::Requirement