pwn 0.5.287 → 0.5.288

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: 6078dc6421e6cce0d193a41cbe3d1e2e0d0ecdfc7abe6d98d188799192fa4d18
4
- data.tar.gz: 6518ccac383f48beedda04b02698e714a412fd9354ba5924a8dc981f0e291fef
3
+ metadata.gz: 508456a1574ce4415f503cb7b90f5a5c34678fa6398d9e09ce312a46444f5afe
4
+ data.tar.gz: 736271d79f7dd72c16c516174e7c8777ecaba0727f85cc83df7fc2292d4f544a
5
5
  SHA512:
6
- metadata.gz: 47c781dc941c72f57a1dca2faa4ca2adf024870d8b158b8eaeb9c8563b864f3d6d3fdb6de2e3f564c245928dc1d24407881569bceae227e868cf68a21ad7ca18
7
- data.tar.gz: 79122ed05b2659afde9992546d8f9819536f2848a9293b076b81552752f4d779c90dc3428993073ba46bba0245c0c5c3cf5c29eb45c89ed2cad07ce9cfe2dc43
6
+ metadata.gz: fd2115ef1abc7ec0351b0f780e8aa84e3402e277e4347a5c028fb498e803ab9ce12d15057cd16d87ee5dbedf37b7acd191b32a7b72bdc43658adddc197d409f1
7
+ data.tar.gz: d72b966e23bca8f3c57e2e08b680e4f8b166c9ba5c081991dda2489150de0df8d853ea586239677b1e25f1974393631c2c9a21b4e7e2ba4c6e98d328504c8471
data/Gemfile CHANGED
@@ -43,7 +43,7 @@ gem 'jenkins_api_client2', '1.9.0'
43
43
  gem 'js-beautify', '0.1.8'
44
44
  gem 'json', '2.12.2'
45
45
  gem 'jsonpath', '1.1.5'
46
- gem 'jwt', '3.1.1'
46
+ gem 'jwt', '3.1.2'
47
47
  gem 'libusb', '0.7.2'
48
48
  gem 'luhn', '1.0.2'
49
49
  gem 'mail', '2.8.1'
@@ -87,13 +87,13 @@ gem 'ruby-nmap', '1.0.3'
87
87
  gem 'ruby-saml', '1.18.0'
88
88
  gem 'rvm', '1.11.3.9'
89
89
  gem 'savon', '2.15.1'
90
- gem 'selenium-devtools', '0.137.0'
90
+ gem 'selenium-devtools', '0.138.0'
91
91
  # gem 'serialport', '1.3.2'
92
92
  # gem 'sinatra', '4.0.0'
93
93
  gem 'slack-ruby-client', '2.6.0'
94
94
  gem 'socksify', '1.7.1'
95
95
  gem 'spreadsheet', '1.3.4'
96
- gem 'sqlite3', '2.7.0'
96
+ gem 'sqlite3', '2.7.1'
97
97
  gem 'thin', '2.0.1'
98
98
  gem 'tty-prompt', '0.23.1'
99
99
  gem 'tty-spinner', '0.9.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.287]:001 >>> PWN.help
40
+ pwn[v0.5.288]: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.287]:001 >>> PWN.help
55
+ pwn[v0.5.288]: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.287]:001 >>> PWN.help
65
+ pwn[v0.5.288]: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:
@@ -86,12 +86,36 @@ module PWN
86
86
  spinner.stop
87
87
  end
88
88
 
89
+ # Supported Method Parameters::
90
+ # all_fields = PWN::Plugins::JiraServer.get_all_fields(
91
+ # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
92
+ # token: 'required - bearer token'
93
+ # )
94
+
95
+ public_class_method def self.get_all_fields(opts = {})
96
+ base_api_uri = opts[:base_api_uri]
97
+
98
+ token = opts[:token]
99
+ token ||= PWN::Plugins::AuthenticationHelper.mask_password(
100
+ prompt: 'Personal Access Token'
101
+ )
102
+
103
+ rest_call(
104
+ base_api_uri: base_api_uri,
105
+ token: token,
106
+ rest_call: 'field',
107
+ params: params
108
+ )
109
+ rescue StandardError => e
110
+ raise e
111
+ end
112
+
89
113
  # Supported Method Parameters::
90
114
  # issue_resp = PWN::Plugins::JiraServer.get_issue(
91
115
  # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
92
116
  # token: 'required - bearer token',
93
117
  # issue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',
94
- # params: 'optional - additional parameters to pass in the URI'
118
+ # params: 'optional - additional parameters to pass in the URI (e.g. fields, expand, etc.)'
95
119
  # )
96
120
 
97
121
  public_class_method def self.get_issue(opts = {})
@@ -118,31 +142,64 @@ module PWN
118
142
  end
119
143
 
120
144
  # Supported Method Parameters::
121
- # jira_resp = PWN::Plugins::JiraServer.manual_call(
145
+ # issue_resp = PWN::Plugins::JiraServer.create_issue(
122
146
  # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
123
147
  # token: 'required - bearer token',
124
- # path: 'required - API path to call, without beginning forward slash',
125
- # params: 'optional - additional parameters to pass in the URI'
148
+ # project_key: 'required - project key (e.g. PWN)',
149
+ # summary: 'required - summary of the issue (e.g. Epic for PWN-1337)',
150
+ # issue_type: 'required - issue type (e.g. :epic, :story, :bug)',
151
+ # description: 'optional - description of the issue',
152
+ # additional_fields: 'optional - additional fields to set in the issue (e.g. labels, components, custom fields, etc.)'
126
153
  # )
127
154
 
128
- public_class_method def self.manual_call(opts = {})
155
+ public_class_method def self.create_issue(opts = {})
129
156
  base_api_uri = opts[:base_api_uri]
130
157
 
131
158
  token = opts[:token]
132
159
  token ||= PWN::Plugins::AuthenticationHelper.mask_password(
133
160
  prompt: 'Personal Access Token'
134
161
  )
162
+ project_key = opts[:project_key]
163
+ raise 'ERROR: project_key cannot be nil.' if project_key.nil?
135
164
 
136
- path = opts[:path]
137
- params = opts[:params]
165
+ summary = opts[:summary]
166
+ raise 'ERROR: summary cannot be nil.' if summary.nil?
167
+
168
+ issue_type = opts[:issue_type]
169
+ raise 'ERROR: issue_type values must be one of :epic, :story, or :bug.' unless %i[epic story bug].include?(issue_type)
138
170
 
139
- raise 'ERROR: path cannot be nil.' if path.nil?
171
+ description = opts[:description]
172
+
173
+ additional_fields = opts[:additional_fields] ||= { fields: {} }
174
+
175
+ all_fields = get_all_fields(base_api_uri: base_api_uri, token: token)
176
+ epic_name_field_key = all_fields.find { |field| field[:name] == 'Epic Name' }[:id]
177
+
178
+ epic_name = summary
179
+
180
+ http_body = {
181
+ fields: {
182
+ project: {
183
+ key: project_key
184
+ },
185
+ summary: summary,
186
+ issuetype: {
187
+ name: issue_type.to_s.capitalize
188
+ },
189
+ "#{epic_name_filed_key}": epic_name,
190
+ description: description
191
+ }
192
+ }
193
+
194
+ http_body[:fields].merge!(additional_fields[:fields])
140
195
 
141
196
  rest_call(
197
+ http_method: :post,
142
198
  base_api_uri: base_api_uri,
143
199
  token: token,
144
- rest_call: path,
145
- params: params
200
+ rest_call: "issue/#{issue}",
201
+ params: params,
202
+ http_body: http_body
146
203
  )
147
204
  rescue StandardError => e
148
205
  raise e
@@ -160,18 +217,26 @@ module PWN
160
217
 
161
218
  public_class_method def self.help
162
219
  puts "USAGE:
220
+ all_fields = #{self}.get_all_fields(
221
+ base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
222
+ token: 'required - bearer token'
223
+ )
224
+
163
225
  issue_resp = #{self}.get_issue(
164
- base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
226
+ base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
165
227
  token: 'required - bearer token',
166
228
  issue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',
167
229
  params: 'optional - additional parameters to pass in the URI'
168
230
  )
169
231
 
170
- jira_resp = #{self}.manual_call(
171
- base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
232
+ issue_resp = #{self}.create_issue(
233
+ base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
172
234
  token: 'required - bearer token',
173
- path: 'required - API path to call, without beginning forward slash',
174
- params: 'optional - additional parameters to pass in the URI'
235
+ project_key: 'required - project key (e.g. PWN)',
236
+ summary: 'required - summary of the issue (e.g. Epic for PWN-1337)',
237
+ issue_type: 'required - issue type (e.g. :epic, :story, :bug)',
238
+ description: 'optional - description of the issue',
239
+ additional_fields: 'optional - additional fields to set in the issue (e.g. labels, components, custom fields, etc.)'
175
240
  )
176
241
 
177
242
  **********************************************************************
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.287'
4
+ VERSION = '0.5.288'
5
5
  end
@@ -665,9 +665,9 @@
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.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:/corp.jira.com/rest/api/latest)',\ntoken: 'required - bearer token',\nissue: 'required - issue to lookup'\n\n)\n"}]}
668
+ {"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'\n\n)\n"}]}
669
669
  {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.help Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.help`: "}]}
670
- {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.manual_call Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.manual_call`: Supported Method Parameters\n\njira_resp = PWN::Plugins::JiraServer.manual_call(\n\nbase_api_uri: 'required - base URI for Jira (e.g. https:/corp.jira.com/rest/api/latest)',\ntoken: 'required - bearer token',\npath: 'required - API path to call, without beginning forward slash'\n\n)\n"}]}
670
+ {"messages":[{"role":"user","content":"PWN::Plugins::JiraServer.manual_call Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraServer.manual_call`: Supported Method Parameters\n\njira_resp = PWN::Plugins::JiraServer.manual_call(\n\nbase_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',\ntoken: 'required - bearer token',\npath: 'required - API path to call, without beginning forward slash',\nparams: 'optional - additional parameters to pass in the URI'\n\n)\n"}]}
671
671
  {"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"}]}
672
672
  {"messages":[{"role":"user","content":"PWN::Plugins::Log.append Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.append`: Supported Method Parameters\n\nPWN::Log.create( )\n"}]}
673
673
  {"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"}]}
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.287
4
+ version: 0.5.288
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
@@ -435,14 +435,14 @@ dependencies:
435
435
  requirements:
436
436
  - - '='
437
437
  - !ruby/object:Gem::Version
438
- version: 3.1.1
438
+ version: 3.1.2
439
439
  type: :runtime
440
440
  prerelease: false
441
441
  version_requirements: !ruby/object:Gem::Requirement
442
442
  requirements:
443
443
  - - '='
444
444
  - !ruby/object:Gem::Version
445
- version: 3.1.1
445
+ version: 3.1.2
446
446
  - !ruby/object:Gem::Dependency
447
447
  name: libusb
448
448
  requirement: !ruby/object:Gem::Requirement
@@ -1037,14 +1037,14 @@ dependencies:
1037
1037
  requirements:
1038
1038
  - - '='
1039
1039
  - !ruby/object:Gem::Version
1040
- version: 0.137.0
1040
+ version: 0.138.0
1041
1041
  type: :runtime
1042
1042
  prerelease: false
1043
1043
  version_requirements: !ruby/object:Gem::Requirement
1044
1044
  requirements:
1045
1045
  - - '='
1046
1046
  - !ruby/object:Gem::Version
1047
- version: 0.137.0
1047
+ version: 0.138.0
1048
1048
  - !ruby/object:Gem::Dependency
1049
1049
  name: slack-ruby-client
1050
1050
  requirement: !ruby/object:Gem::Requirement
@@ -1093,14 +1093,14 @@ dependencies:
1093
1093
  requirements:
1094
1094
  - - '='
1095
1095
  - !ruby/object:Gem::Version
1096
- version: 2.7.0
1096
+ version: 2.7.1
1097
1097
  type: :runtime
1098
1098
  prerelease: false
1099
1099
  version_requirements: !ruby/object:Gem::Requirement
1100
1100
  requirements:
1101
1101
  - - '='
1102
1102
  - !ruby/object:Gem::Version
1103
- version: 2.7.0
1103
+ version: 2.7.1
1104
1104
  - !ruby/object:Gem::Dependency
1105
1105
  name: thin
1106
1106
  requirement: !ruby/object:Gem::Requirement