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 +4 -4
- data/Gemfile +1 -1
- data/README.md +3 -3
- data/lib/pwn/plugins/jira_server.rb +78 -16
- data/lib/pwn/version.rb +1 -1
- data/third_party/pwn_rdoc.jsonl +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af46a593739423417d1dd15c931f7f37c55ed52926549f004968d546e7586205
|
4
|
+
data.tar.gz: 8692d44970df90db4f6a93a14918b7af5ef77fa10082e3f222431ce8b0ab230f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8836abe59e41a4cca98606832090f847cc3b4882b3009fd758745ec4743eda1f09464c0a06182f1761d136be8689b6fdc644d2a6a4d01ca6a0457f0ac4bb6eff
|
7
|
+
data.tar.gz: 1297d4272044241237fc52d22a8bd6d00e9c9e39e67e9144685bf387819be86e3df1f9695fc5a3ef464502c57a2ed8ad75f54129695343d923dccec84ad93cfe
|
data/Gemfile
CHANGED
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.
|
40
|
+
pwn[v0.5.299]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](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.
|
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.
|
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 -
|
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 -
|
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 -
|
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 -
|
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.
|
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 -
|
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 -
|
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 -
|
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 -
|
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 -
|
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. [
|
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 -
|
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 -
|
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
data/third_party/pwn_rdoc.jsonl
CHANGED
@@ -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.
|
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.
|
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.
|
235
|
+
version: 3.5.2
|
236
236
|
- !ruby/object:Gem::Dependency
|
237
237
|
name: faye-websocket
|
238
238
|
requirement: !ruby/object:Gem::Requirement
|