pwn 0.4.739 → 0.4.741

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: 2b3a46e4ee96746221feb823a894354b14b8d6f118ab818e7fdfd619726ccd37
4
- data.tar.gz: 82aa376d8fa6b29dac632c7a27444714dff78c973c217e8b7bc319c8e21f234a
3
+ metadata.gz: 7d584af8d0758445720f5d35b48ce3f518f57c18fca496626ad5e170d1d4d6d6
4
+ data.tar.gz: 67695c0f58e76ac3ffee236312e2dcf45a2df36ef58f61f6a089bdd764e55641
5
5
  SHA512:
6
- metadata.gz: 48c8f7f918846ec1ca54b3dd4c3b2a19588a2ce37119cf3b7c67514475b97904de88e4d7a0e6838868e1f6ba69a73c244762cae5ecb8ee507f8b70a5f32e98ff
7
- data.tar.gz: 6d7dca2c7944b646c3d2958f68fea7ccba6c69b07e85c8d325e85d38e4848e56db2aefb0c3ffc8f0bf48c5f92c54558c72a94b9facca5173d08cda8ce061b0e0
6
+ metadata.gz: e12c51833606be3cc64c6a492ab4bc1999299c71f4fe2d0071bfc5aba1d77404445b30ed156156eeee3203a9b287a787425e3624136b77b9acf451ba5ad4b773
7
+ data.tar.gz: 92ece1165b579ea8792122699d91d88f977945c4ea8e4d0a2f9095eca43c6d07b150bea49ec6edec280357c05d956cf4e76868ce9d707b37ba2393fa74d1fc3b
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.2.2@pwn
37
37
  $ rvm list gemsets
38
38
  $ gem install --verbose pwn
39
39
  $ pwn
40
- pwn[v0.4.739]:001 >>> PWN.help
40
+ pwn[v0.4.741]: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.2.2@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.739]:001 >>> PWN.help
55
+ pwn[v0.4.741]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -192,6 +192,61 @@ module PWN
192
192
  raise e
193
193
  end
194
194
 
195
+ # Supported Method Parameters::
196
+ # response = PWN::Plugins::BlackDuckBinaryAnalysis.get_product(
197
+ # token: 'required - Bearer token',
198
+ # product_id: 'required - product id'
199
+ # )
200
+
201
+ public_class_method def self.get_product(opts = {})
202
+ token = opts[:token]
203
+ product_id = opts[:product_id]
204
+
205
+ response = bd_bin_analysis_rest_call(
206
+ token: token,
207
+ rest_call: "product/#{product_id}"
208
+ )
209
+
210
+ JSON.parse(response, symbolize_names: true)
211
+ rescue StandardError => e
212
+ raise e
213
+ end
214
+
215
+ # Supported Method Parameters::
216
+ # response = PWN::Plugins::BlackDuckBinaryAnalysis.generate_product_report(
217
+ # token: 'required - Bearer token',
218
+ # product_id: 'required - product id',
219
+ # output_path: 'required - path to output file',
220
+ # type: 'optional - report type csv_libs||csv_vulns|pdf (Defaults to csv_vulns)'
221
+ # )
222
+
223
+ public_class_method def self.generate_product_report(opts = {})
224
+ token = opts[:token]
225
+ product_id = opts[:product_id]
226
+ output_path = opts[:output_path]
227
+ type = opts[:type] ||= :csv_vulns
228
+
229
+ case type.to_s.downcase.to_sym
230
+ when :csv_libs
231
+ rest_call = "product/#{product_id}/csv-libs"
232
+ when :csv_vulns
233
+ rest_call = "product/#{product_id}/csv-vulns"
234
+ when :pdf
235
+ rest_call = "product/#{product_id}/pdf-report"
236
+ else
237
+ raise "ERROR: Invalid report type #{type}"
238
+ end
239
+
240
+ response = bd_bin_analysis_rest_call(
241
+ token: token,
242
+ rest_call: rest_call
243
+ )
244
+
245
+ File.write(output_path, response.body)
246
+ rescue StandardError => e
247
+ raise e
248
+ end
249
+
195
250
  # Supported Method Parameters::
196
251
  # response = PWN::Plugins::BlackDuckBinaryAnalysis.get_tasks(
197
252
  # token: 'required - Bearer token'
@@ -527,6 +582,18 @@ module PWN
527
582
  product_id: 'optional - product id'
528
583
  )
529
584
 
585
+ response = #{self}.get_product(
586
+ token: 'required - Bearer token',
587
+ product_id: 'required - product id'
588
+ )
589
+
590
+ response = #{self}.generate_product_report(
591
+ token: 'required - Bearer token',
592
+ product_id: 'required - product id',
593
+ output_path: 'required - path to output file',
594
+ type: 'optional - report type csv_libs||csv_vulns|pdf (Defaults to csv_vulns)'
595
+ )
596
+
530
597
  response = #{self}.get_tasks(
531
598
  token: 'required - Bearer token'
532
599
  )
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.4.739'
4
+ VERSION = '0.4.741'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.739
4
+ version: 0.4.741
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-15 00:00:00.000000000 Z
11
+ date: 2023-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport