pwn 0.5.466 → 0.5.468
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 +2 -2
- data/README.md +3 -3
- data/lib/pwn/config.rb +12 -2
- data/lib/pwn/plugins/jira_data_center.rb +68 -19
- data/lib/pwn/version.rb +1 -1
- data/third_party/pwn_rdoc.jsonl +13 -12
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5d2303b2ec4604f65e03770dcee7bed1fe067d09f57a83f2f321d63984e13dcf
|
|
4
|
+
data.tar.gz: 6de60cd7f5458ccbec56f7f3b7fc22708a467c4e3f3c26153b61a695a4238eb9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2575756bd0d505f66e4e429f5eb29274f022da171107cb88cfdeb3a7dbbefc8c0ee074bb8f02226f7ceb244ddffa792c000aa940282aa15333aa582606159c33
|
|
7
|
+
data.tar.gz: 157319cff7100b366e32b9966ffe6029071c72c80d1cd7e027f91dce07c9fa0b5686bcdfae666d19e53d08e722deb57b04a41a2fff52e7ecbbe2ef3db9167b26
|
data/Gemfile
CHANGED
|
@@ -77,9 +77,9 @@ gem 'rest-client', '2.1.0'
|
|
|
77
77
|
gem 'rex', '2.0.13'
|
|
78
78
|
gem 'rmagick', '6.1.4'
|
|
79
79
|
gem 'rqrcode', '3.1.0'
|
|
80
|
-
gem 'rspec', '3.13.
|
|
80
|
+
gem 'rspec', '3.13.2'
|
|
81
81
|
gem 'rtesseract', '3.1.4'
|
|
82
|
-
gem 'rubocop', '1.81.
|
|
82
|
+
gem 'rubocop', '1.81.6'
|
|
83
83
|
gem 'rubocop-rake', '0.7.1'
|
|
84
84
|
gem 'rubocop-rspec', '3.7.0'
|
|
85
85
|
gem 'ruby-audio', '1.6.1'
|
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.468]: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.468]: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.468]: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:
|
data/lib/pwn/config.rb
CHANGED
|
@@ -90,6 +90,13 @@ module PWN
|
|
|
90
90
|
token: 'Jira Server API Token'
|
|
91
91
|
},
|
|
92
92
|
meshtastic: {
|
|
93
|
+
serial: {
|
|
94
|
+
port: '/dev/ttyUSB0',
|
|
95
|
+
baud: 115_200,
|
|
96
|
+
bits: 8,
|
|
97
|
+
stop: 1,
|
|
98
|
+
parity: :none
|
|
99
|
+
},
|
|
93
100
|
mqtt: {
|
|
94
101
|
host: 'mqtt.meshtastic.org',
|
|
95
102
|
port: 1883,
|
|
@@ -100,18 +107,21 @@ module PWN
|
|
|
100
107
|
LongFast: {
|
|
101
108
|
psk: 'AQ==',
|
|
102
109
|
region: 'US/<STATE>',
|
|
103
|
-
channel_topic: '2/e/#'
|
|
110
|
+
channel_topic: '2/e/#',
|
|
111
|
+
channel_num: 8
|
|
104
112
|
},
|
|
105
113
|
PWN: {
|
|
106
114
|
psk: 'required - PSK for pwn channel',
|
|
107
115
|
region: 'US/<STATE>',
|
|
108
|
-
channel_topic: '2/e/PWN/#'
|
|
116
|
+
channel_topic: '2/e/PWN/#',
|
|
117
|
+
channel_num: 99
|
|
109
118
|
}
|
|
110
119
|
}
|
|
111
120
|
},
|
|
112
121
|
shodan: { api_key: 'SHODAN API Key' }
|
|
113
122
|
}
|
|
114
123
|
}
|
|
124
|
+
|
|
115
125
|
# Remove beginning colon from key names
|
|
116
126
|
yaml_env = YAML.dump(env).gsub(/^(\s*):/, '\1')
|
|
117
127
|
File.write(pwn_env_path, yaml_env)
|
|
@@ -397,7 +397,25 @@ module PWN
|
|
|
397
397
|
issue_type_id = opts[:issue_type_id]
|
|
398
398
|
raise 'ERROR: issue_type_id cannot be nil.' if issue_type_id.nil?
|
|
399
399
|
|
|
400
|
-
|
|
400
|
+
response = { values: [] }
|
|
401
|
+
start_at = 0
|
|
402
|
+
loop do
|
|
403
|
+
params = { startAt: start_at }
|
|
404
|
+
this_resp = rest_call(
|
|
405
|
+
rest_call: "issue/createmeta/#{project_key}/issuetypes/#{issue_type_id}",
|
|
406
|
+
params: params
|
|
407
|
+
)
|
|
408
|
+
response[:maxResults] = this_resp[:maxResults]
|
|
409
|
+
response[:startAt] = this_resp[:startAt]
|
|
410
|
+
response[:total] = this_resp[:total]
|
|
411
|
+
response[:isLast] = this_resp[:isLast]
|
|
412
|
+
response[:values].concat(this_resp[:values])
|
|
413
|
+
break if is_last
|
|
414
|
+
|
|
415
|
+
start_at += max_results
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
response
|
|
401
419
|
rescue StandardError => e
|
|
402
420
|
raise e
|
|
403
421
|
end
|
|
@@ -411,38 +429,69 @@ module PWN
|
|
|
411
429
|
issue = opts[:issue]
|
|
412
430
|
raise 'ERROR: issue cannot be nil.' if issue.nil?
|
|
413
431
|
|
|
414
|
-
issue_data = get_issue(issue: issue)
|
|
432
|
+
issue_data = get_issue(issue: issue, params: { expand: 'editmeta' })
|
|
415
433
|
|
|
416
434
|
project_key = issue_data[:fields][:project][:key]
|
|
417
435
|
summary = "CLONE - #{issue_data[:fields][:summary]}"
|
|
418
|
-
|
|
419
|
-
issue_type = issue_data[:fields][:issuetype][:name].downcase.to_sym
|
|
420
|
-
issue_type_id = issue_data[:fields][:issuetype][:id]
|
|
421
|
-
|
|
422
436
|
epic_name = nil
|
|
437
|
+
epic_name_field_key = nil
|
|
423
438
|
if issue_type == :epic
|
|
424
439
|
all_fields = get_all_fields
|
|
425
440
|
epic_name_field_key = all_fields.find { |field| field[:name] == 'Epic Name' }[:id]
|
|
426
441
|
epic_name = issue_data[:fields][epic_name_field_key.to_sym]
|
|
427
442
|
end
|
|
443
|
+
|
|
428
444
|
description = issue_data[:fields][:description]
|
|
429
|
-
|
|
430
|
-
#
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
445
|
+
|
|
446
|
+
# Determine issue type (was previously missing) and create metadata
|
|
447
|
+
issue_type = issue_data[:fields][:issuetype][:name].downcase.to_sym
|
|
448
|
+
issue_type_id = issue_data[:fields][:issuetype][:id]
|
|
449
|
+
|
|
450
|
+
meta = get_issue_type_metadata(
|
|
435
451
|
project_key: project_key,
|
|
436
452
|
issue_type_id: issue_type_id
|
|
437
453
|
)
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
454
|
+
candidate_array = meta[:values] ||= []
|
|
455
|
+
|
|
456
|
+
# Build list of fields we can 'set' on create (per create metadata)
|
|
457
|
+
allowed_fields = []
|
|
458
|
+
candidate_array.each do |field_obj|
|
|
459
|
+
next unless field_obj.is_a?(Hash)
|
|
460
|
+
|
|
461
|
+
ops = field_obj[:operations] ||= []
|
|
462
|
+
next unless ops.include?('set')
|
|
463
|
+
|
|
464
|
+
field_key = field_obj[:key] || field_obj[:id] || field_obj[:fieldId]
|
|
465
|
+
next if field_key.nil? || field_key.to_s.empty?
|
|
466
|
+
|
|
467
|
+
allowed_fields.push(field_key.to_s)
|
|
442
468
|
end
|
|
443
469
|
|
|
444
|
-
|
|
445
|
-
|
|
470
|
+
reserved_fields = %i[project summary issuetype description]
|
|
471
|
+
reserved_fields.push(epic_name_field_key.to_sym) if epic_name_field_key
|
|
472
|
+
|
|
473
|
+
filtered_fields = {}
|
|
474
|
+
issue_data[:fields].each do |k, v|
|
|
475
|
+
next if v.nil?
|
|
476
|
+
|
|
477
|
+
k_str = k.to_s
|
|
478
|
+
next if reserved_fields.include?(k) || reserved_fields.include?(k_str.to_sym)
|
|
479
|
+
|
|
480
|
+
next unless allowed_fields.include?(k_str)
|
|
481
|
+
|
|
482
|
+
case v
|
|
483
|
+
when Array
|
|
484
|
+
filtered_fields[k] = v.map { |elem| elem.is_a?(Hash) ? elem.slice(*%i[id key name value]) : elem }
|
|
485
|
+
when Hash
|
|
486
|
+
filtered_fields[k] =
|
|
487
|
+
if v.keys.any? { |kk| %i[id key name value].include?(kk) }
|
|
488
|
+
v.slice(*%i[id key name value])
|
|
489
|
+
else
|
|
490
|
+
v
|
|
491
|
+
end
|
|
492
|
+
else
|
|
493
|
+
filtered_fields[k] = v
|
|
494
|
+
end
|
|
446
495
|
end
|
|
447
496
|
|
|
448
497
|
additional_fields = { fields: filtered_fields }
|
|
@@ -514,7 +563,7 @@ module PWN
|
|
|
514
563
|
|
|
515
564
|
issue_resp = #{self}.get_issue(
|
|
516
565
|
issue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',
|
|
517
|
-
params: 'optional - additional parameters to pass in the URI'
|
|
566
|
+
params: 'optional - additional parameters to pass in the URI (e.g. fields, expand, etc.)'
|
|
518
567
|
)
|
|
519
568
|
|
|
520
569
|
issue_resp = #{self}.create_issue(
|
data/lib/pwn/version.rb
CHANGED
data/third_party/pwn_rdoc.jsonl
CHANGED
|
@@ -736,18 +736,19 @@
|
|
|
736
736
|
{"messages":[{"role":"user","content":"PWN::Plugins::Jenkins.help Usage"},{"role":"assistant","content":"`PWN::Plugins::Jenkins.help`: "}]}
|
|
737
737
|
{"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"}]}
|
|
738
738
|
{"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"}]}
|
|
739
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::
|
|
740
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::
|
|
741
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::
|
|
742
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::
|
|
743
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::
|
|
744
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::
|
|
745
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::
|
|
746
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::
|
|
747
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::
|
|
748
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::
|
|
749
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::
|
|
750
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::
|
|
739
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.authors Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
|
|
740
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.clone_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.clone_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraDataCenter.clone_issue(\n\nissue: 'required - issue to clone (e.g. Bug, Issue, Story, or Epic ID)'\n\n)\n"}]}
|
|
741
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.create_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.create_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraDataCenter.create_issue(\n\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. [\"/tmp/file1.txt\", \"/tmp/file2.txt\"])',\ncomment: 'optional - comment to add to the issue (e.g. \"This is a comment\")'\n\n)\n"}]}
|
|
742
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.delete_attachment Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.delete_attachment`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraDataCenter.delete_attachment(\n\nid: 'required - attachment ID to delete (e.g. 10000) found in #get_issue method'\n\n)\n"}]}
|
|
743
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.delete_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.delete_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraDataCenter.delete_issue(\n\nissue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'\n\n)\n"}]}
|
|
744
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.get_all_fields Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.get_all_fields`: Supported Method Parameters\n\nall_fields = PWN::Plugins::JiraDataCenter.get_all_fields\n"}]}
|
|
745
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.get_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.get_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraDataCenter.get_issue(\n\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"}]}
|
|
746
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.get_issue_type_metadata Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.get_issue_type_metadata`: Supported Method Parameters\n\nissue_type_metadata = PWN::Plugins::JiraDataCenter.get_issue_type_metadata(\n\nproject_key: 'required - project key (e.g. PWN)',\nissue_type_id: 'required - issue type ID (e.g. issue[:fields][:issuetype][:id] from #get_issue method)'\n\n)\n"}]}
|
|
747
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.get_user Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.get_user`: Supported Method Parameters\n\nuser = PWN::Plugins::JiraDataCenter.get_user(\n\nusername: 'required - username to lookup (e.g. jane.doe)',\nparams: 'optional - additional parameters to pass in the URI (e.g. expand, etc.)'\n\n)\n"}]}
|
|
748
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.help Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.help`: "}]}
|
|
749
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.issue_comment Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.issue_comment`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraDataCenter.issue_comment(\n\nissue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)',\ncomment_action: 'required - action to perform on the issue comment (e.g. :delete, :add, :update - Defaults to :add)',\ncomment_id: 'optional - comment ID to delete or update (e.g. 10000)',\nauthor: 'optional - author of the comment (e.g. \"jane.doe\")',\ncomment: 'optional - comment to add or update in the issue (e.g. \"This is a comment\")'\n\n)\n"}]}
|
|
750
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.rest_call Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.rest_call`: Supported Method Parameters\n\nrest_call(\n\ntoken: 'required - personal access 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"}]}
|
|
751
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.update_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.update_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraDataCenter.update_issue(\n\nfields: 'required - fields to update in the issue (e.g. summary, description, labels, components, custom fields, etc.)',\nattachments: 'optional - array of attachment paths to upload to the issue (e.g. [\"/tmp/file1.txt\", \"/tmp/file2.txt\"])',\n\n)\n"}]}
|
|
751
752
|
{"messages":[{"role":"user","content":"PWN::Plugins::Log.append Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.append`: Supported Method Parameters\n\nPWN::Log.create( )\n"}]}
|
|
752
753
|
{"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"}]}
|
|
753
754
|
{"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.468
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 0day Inc.
|
|
@@ -925,14 +925,14 @@ dependencies:
|
|
|
925
925
|
requirements:
|
|
926
926
|
- - '='
|
|
927
927
|
- !ruby/object:Gem::Version
|
|
928
|
-
version: 3.13.
|
|
928
|
+
version: 3.13.2
|
|
929
929
|
type: :development
|
|
930
930
|
prerelease: false
|
|
931
931
|
version_requirements: !ruby/object:Gem::Requirement
|
|
932
932
|
requirements:
|
|
933
933
|
- - '='
|
|
934
934
|
- !ruby/object:Gem::Version
|
|
935
|
-
version: 3.13.
|
|
935
|
+
version: 3.13.2
|
|
936
936
|
- !ruby/object:Gem::Dependency
|
|
937
937
|
name: rtesseract
|
|
938
938
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -953,14 +953,14 @@ dependencies:
|
|
|
953
953
|
requirements:
|
|
954
954
|
- - '='
|
|
955
955
|
- !ruby/object:Gem::Version
|
|
956
|
-
version: 1.81.
|
|
956
|
+
version: 1.81.6
|
|
957
957
|
type: :runtime
|
|
958
958
|
prerelease: false
|
|
959
959
|
version_requirements: !ruby/object:Gem::Requirement
|
|
960
960
|
requirements:
|
|
961
961
|
- - '='
|
|
962
962
|
- !ruby/object:Gem::Version
|
|
963
|
-
version: 1.81.
|
|
963
|
+
version: 1.81.6
|
|
964
964
|
- !ruby/object:Gem::Dependency
|
|
965
965
|
name: rubocop-rake
|
|
966
966
|
requirement: !ruby/object:Gem::Requirement
|