pwn 0.5.287 → 0.5.289

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: 8de6ccfadc12686aff7875464cd2d9ef1d2480fbf26fccd82e8e6e7e2f25a381
4
+ data.tar.gz: 71b0dd64c1a7e0ccc7730c921c9cfa40e8330eaba0544e5d470da39f6cf6d698
5
5
  SHA512:
6
- metadata.gz: 47c781dc941c72f57a1dca2faa4ca2adf024870d8b158b8eaeb9c8563b864f3d6d3fdb6de2e3f564c245928dc1d24407881569bceae227e868cf68a21ad7ca18
7
- data.tar.gz: 79122ed05b2659afde9992546d8f9819536f2848a9293b076b81552752f4d779c90dc3428993073ba46bba0245c0c5c3cf5c29eb45c89ed2cad07ce9cfe2dc43
6
+ metadata.gz: 1edf6331f3cd1be612117685c57b546b675ff4bc5eef21acd0ca8a93e6cd4130af38cfdd0ca0376120c3de0663f609593ac96baa79670fb66f0ae1b81d67b64c
7
+ data.tar.gz: 1960ff54f01568e8f8f8048dfd5b81422424695ffd1ca73580efb941d23eb12b9cb3f1d9e4574cb283b331167316083781ff213a9f7b671d700596695fcb4666
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.289]: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.289]: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.289]: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,35 @@ 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
+ )
108
+ rescue StandardError => e
109
+ raise e
110
+ end
111
+
89
112
  # Supported Method Parameters::
90
113
  # issue_resp = PWN::Plugins::JiraServer.get_issue(
91
114
  # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
92
115
  # token: 'required - bearer token',
93
116
  # issue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',
94
- # params: 'optional - additional parameters to pass in the URI'
117
+ # params: 'optional - additional parameters to pass in the URI (e.g. fields, expand, etc.)'
95
118
  # )
96
119
 
97
120
  public_class_method def self.get_issue(opts = {})
@@ -118,31 +141,63 @@ module PWN
118
141
  end
119
142
 
120
143
  # Supported Method Parameters::
121
- # jira_resp = PWN::Plugins::JiraServer.manual_call(
144
+ # issue_resp = PWN::Plugins::JiraServer.create_issue(
122
145
  # base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
123
146
  # 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'
147
+ # project_key: 'required - project key (e.g. PWN)',
148
+ # summary: 'required - summary of the issue (e.g. Epic for PWN-1337)',
149
+ # issue_type: 'required - issue type (e.g. :epic, :story, :bug)',
150
+ # description: 'optional - description of the issue',
151
+ # additional_fields: 'optional - additional fields to set in the issue (e.g. labels, components, custom fields, etc.)'
126
152
  # )
127
153
 
128
- public_class_method def self.manual_call(opts = {})
154
+ public_class_method def self.create_issue(opts = {})
129
155
  base_api_uri = opts[:base_api_uri]
130
156
 
131
157
  token = opts[:token]
132
158
  token ||= PWN::Plugins::AuthenticationHelper.mask_password(
133
159
  prompt: 'Personal Access Token'
134
160
  )
161
+ project_key = opts[:project_key]
162
+ raise 'ERROR: project_key cannot be nil.' if project_key.nil?
135
163
 
136
- path = opts[:path]
137
- params = opts[:params]
164
+ summary = opts[:summary]
165
+ raise 'ERROR: summary cannot be nil.' if summary.nil?
166
+
167
+ issue_type = opts[:issue_type]
168
+ raise 'ERROR: issue_type values must be one of :epic, :story, or :bug.' unless %i[epic story bug].include?(issue_type)
169
+
170
+ description = opts[:description]
171
+
172
+ additional_fields = opts[:additional_fields] ||= { fields: {} }
173
+
174
+ all_fields = get_all_fields(base_api_uri: base_api_uri, token: token)
175
+ epic_name_field_key = all_fields.find { |field| field[:name] == 'Epic Name' }[:id]
176
+
177
+ epic_name = summary
138
178
 
139
- raise 'ERROR: path cannot be nil.' if path.nil?
179
+ http_body = {
180
+ fields: {
181
+ project: {
182
+ key: project_key
183
+ },
184
+ summary: summary,
185
+ issuetype: {
186
+ name: issue_type.to_s.capitalize
187
+ },
188
+ "#{epic_name_filed_key}": epic_name,
189
+ description: description
190
+ }
191
+ }
192
+
193
+ http_body[:fields].merge!(additional_fields[:fields])
140
194
 
141
195
  rest_call(
196
+ http_method: :post,
142
197
  base_api_uri: base_api_uri,
143
198
  token: token,
144
- rest_call: path,
145
- params: params
199
+ rest_call: "issue/#{issue}",
200
+ http_body: http_body
146
201
  )
147
202
  rescue StandardError => e
148
203
  raise e
@@ -160,18 +215,26 @@ module PWN
160
215
 
161
216
  public_class_method def self.help
162
217
  puts "USAGE:
218
+ all_fields = #{self}.get_all_fields(
219
+ base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
220
+ token: 'required - bearer token'
221
+ )
222
+
163
223
  issue_resp = #{self}.get_issue(
164
- base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
224
+ base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
165
225
  token: 'required - bearer token',
166
226
  issue: 'required - issue to lookup (e.g. Bug, Issue, Story, or Epic ID)',
167
227
  params: 'optional - additional parameters to pass in the URI'
168
228
  )
169
229
 
170
- jira_resp = #{self}.manual_call(
171
- base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
230
+ issue_resp = #{self}.create_issue(
231
+ base_api_uri: 'required - base URI for Jira (e.g. https:/jira.corp.com/rest/api/latest)',
172
232
  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'
233
+ project_key: 'required - project key (e.g. PWN)',
234
+ summary: 'required - summary of the issue (e.g. Epic for PWN-1337)',
235
+ issue_type: 'required - issue type (e.g. :epic, :story, :bug)',
236
+ description: 'optional - description of the issue',
237
+ additional_fields: 'optional - additional fields to set in the issue (e.g. labels, components, custom fields, etc.)'
175
238
  )
176
239
 
177
240
  **********************************************************************
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.289'
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.289
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