pwn 0.5.297 → 0.5.298

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: be4a660a466617ce369499193c9480e167218321a3228cf93c330b7524f1b447
4
+ data.tar.gz: 005c66a5e7324753917f9af6e0928234348363e7b4e21afeef011e25fc3692aa
5
5
  SHA512:
6
- metadata.gz: 016cd67f87c5889557383311d6ea0d3a73f772c187ed2e8714983a452957d753a4a08b13f5a5c0831c0babf1df80e4ede655163309f6a0ca2298ea75770368d2
7
- data.tar.gz: a0ab7b93947a1243a4fee67fe413f3de98497c0e1d0a9a9a373e5d7f08623d70cd633c43a14facd94b07b3db4b5e9f85a04304702e049777aa5b7530204b4e26
6
+ metadata.gz: 35a10cb79b1cc2758faad2d95932e75b261993e0d6463fee4ecd3cc1213b0e94e8ab99ef1a03fb897c100986d8546c60925dd2f14bcd7718d87a1086199c4dad
7
+ data.tar.gz: e23f6cb197d77102e5bc19007c7d3bd06c38284f163b678c43d4e8e6a8ca9167dd53dd6e893a63273a591822067f5f312f612a0dca3316a42d92c30441191ff6
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.298]: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.298]: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.298]: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,40 @@ 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
+ # )
153
+
154
+ public_class_method def self.get_user(opts = {})
155
+ base_api_uri = opts[:base_api_uri]
156
+
157
+ token = opts[:token]
158
+ token ||= PWN::Plugins::AuthenticationHelper.mask_password(
159
+ prompt: 'Personal Access Token'
160
+ )
161
+
162
+ username = opts[:username]
163
+ raise 'ERROR: username cannot be nil.' if username.nil?
164
+
165
+ params = { username: username }
166
+
167
+ rest_call(
168
+ base_api_uri: base_api_uri,
169
+ token: token,
170
+ rest_call: 'user',
171
+ params: params
172
+ )
173
+ rescue StandardError => e
174
+ raise e
175
+ end
176
+
147
177
  # Supported Method Parameters::
148
178
  # issue_resp = PWN::Plugins::JiraServer.get_issue(
149
179
  # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
150
- # token: 'required - bearer token',
180
+ # token: 'required - personal access token',
151
181
  # issue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',
152
182
  # params: 'optional - additional parameters to pass in the URI (e.g. fields, expand, etc.)'
153
183
  # )
@@ -178,7 +208,7 @@ module PWN
178
208
  # Supported Method Parameters::
179
209
  # issue_resp = PWN::Plugins::JiraServer.create_issue(
180
210
  # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
181
- # token: 'required - bearer token',
211
+ # token: 'required - personal access token',
182
212
  # project_key: 'required - project key (e.g. PWN)',
183
213
  # summary: 'required - summary of the issue (e.g. Epic for PWN-1337)',
184
214
  # issue_type: 'required - issue type (e.g. :epic, :story, :bug)',
@@ -266,8 +296,9 @@ module PWN
266
296
  # Supported Method Parameters::
267
297
  # issue_resp = PWN::Plugins::JiraServer.update_issue(
268
298
  # 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.)'
299
+ # token: 'required - personal access token',
300
+ # fields: 'required - fields to update in the issue (e.g. summary, description, labels, components, custom fields, etc.)',
301
+ # attachments: 'optional - array of attachment paths to upload to the issue (e.g. ["/path/to/file1.txt", "/path/to/file2.png"])'
271
302
  # )
272
303
 
273
304
  public_class_method def self.update_issue(opts = {})
@@ -283,15 +314,34 @@ module PWN
283
314
  fields = opts[:fields] ||= { fields: {} }
284
315
  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
316
 
317
+ attachments = opts[:attachments] ||= []
318
+
286
319
  http_body = fields
287
320
 
288
- rest_call(
321
+ issue_resp = rest_call(
289
322
  http_method: :put,
290
323
  base_api_uri: base_api_uri,
291
324
  token: token,
292
325
  rest_call: "issue/#{issue}",
293
326
  http_body: http_body
294
327
  )
328
+
329
+ if attachments.any?
330
+ http_body = {
331
+ multipart: true,
332
+ file: attachments.map { |attachment| File.new(attachment, 'rb') }
333
+ }
334
+
335
+ rest_call(
336
+ http_method: :post,
337
+ base_api_uri: base_api_uri,
338
+ token: token,
339
+ rest_call: "issue/#{issue}/attachments",
340
+ http_body: http_body
341
+ )
342
+ end
343
+
344
+ issue_resp
295
345
  rescue StandardError => e
296
346
  raise e
297
347
  end
@@ -299,7 +349,7 @@ module PWN
299
349
  # Supported Method Parameters::
300
350
  # issue_resp = PWN::Plugins::JiraServer.delete_issue(
301
351
  # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
302
- # token: 'required - bearer token',
352
+ # token: 'required - personal access token',
303
353
  # issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'
304
354
  # )
305
355
 
@@ -339,38 +389,45 @@ module PWN
339
389
  puts "USAGE:
340
390
  all_fields = #{self}.get_all_fields(
341
391
  base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
342
- token: 'required - bearer token'
392
+ token: 'required - personal access token'
393
+ )
394
+
395
+ user = #{self}.get_user(
396
+ base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
397
+ token: 'required - personal access token',
398
+ username: 'required - username to lookup (e.g. jane.doe')'
343
399
  )
344
400
 
345
401
  issue_resp = #{self}.get_issue(
346
402
  base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
347
- token: 'required - bearer token',
403
+ token: 'required - personal access token',
348
404
  issue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',
349
405
  params: 'optional - additional parameters to pass in the URI'
350
406
  )
351
407
 
352
408
  issue_resp = #{self}.create_issue(
353
409
  base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
354
- token: 'required - bearer token',
410
+ token: 'required - personal access token',
355
411
  project_key: 'required - project key (e.g. PWN)',
356
412
  summary: 'required - summary of the issue (e.g. Epic for PWN-1337)',
357
413
  issue_type: 'required - issue type (e.g. :epic, :story, :bug)',
358
414
  description: 'optional - description of the issue',
359
415
  epic_name: 'optional - name of the epic',
360
416
  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'])'
417
+ attachments: 'optional - array of attachment paths to upload to the issue (e.g. [\"/path/to/file1.txt\", \"/path/to/file2.png\"])'
362
418
  )
363
419
 
364
420
  issue_resp = #{self}.update_issue(
365
421
  base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
366
- token: 'required - bearer token',
422
+ token: 'required - personal access token',
367
423
  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.)'
424
+ fields: 'required - fields to update in the issue (e.g. summary, description, labels, components, custom fields, etc.)',
425
+ attachments: 'optional - array of attachment paths to upload to the issue (e.g. [\"/path/to/file1.txt\", \"/path/to/file2.png\"])'
369
426
  )
370
427
 
371
428
  issue_resp = #{self}.delete_issue(
372
429
  base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
373
- token: 'required - bearer token',
430
+ token: 'required - personal access token',
374
431
  issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'
375
432
  )
376
433
 
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.298'
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.298
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