pwn 0.5.296 → 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 +4 -4
- data/Gemfile +1 -1
- data/README.md +3 -3
- data/lib/pwn/plugins/jira_server.rb +77 -17
- 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: be4a660a466617ce369499193c9480e167218321a3228cf93c330b7524f1b447
|
4
|
+
data.tar.gz: 005c66a5e7324753917f9af6e0928234348363e7b4e21afeef011e25fc3692aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35a10cb79b1cc2758faad2d95932e75b261993e0d6463fee4ecd3cc1213b0e94e8ab99ef1a03fb897c100986d8546c60925dd2f14bcd7718d87a1086199c4dad
|
7
|
+
data.tar.gz: e23f6cb197d77102e5bc19007c7d3bd06c38284f163b678c43d4e8e6a8ca9167dd53dd6e893a63273a591822067f5f312f612a0dca3316a42d92c30441191ff6
|
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.298]: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.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.
|
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 -
|
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',
|
@@ -64,7 +64,7 @@ module PWN
|
|
64
64
|
if http_body.is_a?(Hash)
|
65
65
|
if http_body.key?(:multipart)
|
66
66
|
headers[:content_type] = 'multipart/form-data'
|
67
|
-
headers[:x_atlassian_token]
|
67
|
+
headers[:x_atlassian_token] = 'no-check'
|
68
68
|
else
|
69
69
|
http_body = http_body.to_json
|
70
70
|
end
|
@@ -82,7 +82,10 @@ module PWN
|
|
82
82
|
raise @@logger.error("Unsupported HTTP Method #{http_method} for #{self} Plugin")
|
83
83
|
end
|
84
84
|
|
85
|
-
|
85
|
+
jira_response = response if response.is_a?(RestClient::Response) && response.code == 204
|
86
|
+
jira_response = JSON.parse(response, symbolize_names: true) if response.is_a?(RestClient::Response) && response.code != 204
|
87
|
+
|
88
|
+
jira_response
|
86
89
|
rescue RestClient::ExceptionWithResponse => e
|
87
90
|
if e.response
|
88
91
|
puts "HTTP BASE URL: #{base_api_uri}"
|
@@ -121,7 +124,7 @@ module PWN
|
|
121
124
|
# Supported Method Parameters::
|
122
125
|
# all_fields = PWN::Plugins::JiraServer.get_all_fields(
|
123
126
|
# base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
|
124
|
-
# token: 'required -
|
127
|
+
# token: 'required - personal access token'
|
125
128
|
# )
|
126
129
|
|
127
130
|
public_class_method def self.get_all_fields(opts = {})
|
@@ -141,10 +144,40 @@ module PWN
|
|
141
144
|
raise e
|
142
145
|
end
|
143
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
|
+
|
144
177
|
# Supported Method Parameters::
|
145
178
|
# issue_resp = PWN::Plugins::JiraServer.get_issue(
|
146
179
|
# base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
|
147
|
-
# token: 'required -
|
180
|
+
# token: 'required - personal access token',
|
148
181
|
# issue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',
|
149
182
|
# params: 'optional - additional parameters to pass in the URI (e.g. fields, expand, etc.)'
|
150
183
|
# )
|
@@ -175,7 +208,7 @@ module PWN
|
|
175
208
|
# Supported Method Parameters::
|
176
209
|
# issue_resp = PWN::Plugins::JiraServer.create_issue(
|
177
210
|
# base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
|
178
|
-
# token: 'required -
|
211
|
+
# token: 'required - personal access token',
|
179
212
|
# project_key: 'required - project key (e.g. PWN)',
|
180
213
|
# summary: 'required - summary of the issue (e.g. Epic for PWN-1337)',
|
181
214
|
# issue_type: 'required - issue type (e.g. :epic, :story, :bug)',
|
@@ -263,8 +296,9 @@ module PWN
|
|
263
296
|
# Supported Method Parameters::
|
264
297
|
# issue_resp = PWN::Plugins::JiraServer.update_issue(
|
265
298
|
# base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
|
266
|
-
# token: 'required -
|
267
|
-
# 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"])'
|
268
302
|
# )
|
269
303
|
|
270
304
|
public_class_method def self.update_issue(opts = {})
|
@@ -280,15 +314,34 @@ module PWN
|
|
280
314
|
fields = opts[:fields] ||= { fields: {} }
|
281
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)
|
282
316
|
|
317
|
+
attachments = opts[:attachments] ||= []
|
318
|
+
|
283
319
|
http_body = fields
|
284
320
|
|
285
|
-
rest_call(
|
321
|
+
issue_resp = rest_call(
|
286
322
|
http_method: :put,
|
287
323
|
base_api_uri: base_api_uri,
|
288
324
|
token: token,
|
289
325
|
rest_call: "issue/#{issue}",
|
290
326
|
http_body: http_body
|
291
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
|
292
345
|
rescue StandardError => e
|
293
346
|
raise e
|
294
347
|
end
|
@@ -296,7 +349,7 @@ module PWN
|
|
296
349
|
# Supported Method Parameters::
|
297
350
|
# issue_resp = PWN::Plugins::JiraServer.delete_issue(
|
298
351
|
# base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
|
299
|
-
# token: 'required -
|
352
|
+
# token: 'required - personal access token',
|
300
353
|
# issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'
|
301
354
|
# )
|
302
355
|
|
@@ -336,38 +389,45 @@ module PWN
|
|
336
389
|
puts "USAGE:
|
337
390
|
all_fields = #{self}.get_all_fields(
|
338
391
|
base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
|
339
|
-
token: 'required -
|
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')'
|
340
399
|
)
|
341
400
|
|
342
401
|
issue_resp = #{self}.get_issue(
|
343
402
|
base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
|
344
|
-
token: 'required -
|
403
|
+
token: 'required - personal access token',
|
345
404
|
issue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',
|
346
405
|
params: 'optional - additional parameters to pass in the URI'
|
347
406
|
)
|
348
407
|
|
349
408
|
issue_resp = #{self}.create_issue(
|
350
409
|
base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
|
351
|
-
token: 'required -
|
410
|
+
token: 'required - personal access token',
|
352
411
|
project_key: 'required - project key (e.g. PWN)',
|
353
412
|
summary: 'required - summary of the issue (e.g. Epic for PWN-1337)',
|
354
413
|
issue_type: 'required - issue type (e.g. :epic, :story, :bug)',
|
355
414
|
description: 'optional - description of the issue',
|
356
415
|
epic_name: 'optional - name of the epic',
|
357
416
|
additional_fields: 'optional - additional fields to set in the issue (e.g. labels, components, custom fields, etc.)',
|
358
|
-
attachments: 'optional - array of attachment paths to upload to the issue (e.g. [
|
417
|
+
attachments: 'optional - array of attachment paths to upload to the issue (e.g. [\"/path/to/file1.txt\", \"/path/to/file2.png\"])'
|
359
418
|
)
|
360
419
|
|
361
420
|
issue_resp = #{self}.update_issue(
|
362
421
|
base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
|
363
|
-
token: 'required -
|
422
|
+
token: 'required - personal access token',
|
364
423
|
issue: 'required - issue to update (e.g. Bug, Issue, Story, or Epic ID)',
|
365
|
-
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\"])'
|
366
426
|
)
|
367
427
|
|
368
428
|
issue_resp = #{self}.delete_issue(
|
369
429
|
base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
|
370
|
-
token: 'required -
|
430
|
+
token: 'required - personal access token',
|
371
431
|
issue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'
|
372
432
|
)
|
373
433
|
|
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.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.
|
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
|