pwn 0.4.802 → 0.4.803

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: 5dd6ac362c796433cbdeb21b3f13ebd7e9b72a3bf3995c9fd203d5b6739f2e58
4
- data.tar.gz: c704e7044aeeac624db2bfda416d78022d3cef3a211b8a170625063e0ce397e6
3
+ metadata.gz: b018f6d15b17f497666cf15464f43bd6a1e02e20c0ad87633bb45425ddef3ad7
4
+ data.tar.gz: 75fb48990f0526ff22180cb53e51efa5e6cb0b0c897235523f17f341698916e3
5
5
  SHA512:
6
- metadata.gz: f99b1bfbbbc00e3acca8eecfea0a57df37c75ec8473936c0ed61397573f12c1347405bbd142a24e1606987aa57a7ed8615379a27d492961cb692724add353032
7
- data.tar.gz: aeb3e52dfd502b296274bc9cfb91acdf1400101dca4452d6da9fc5c45bf8b41cb7c76c1653dd135945b7a069ddb2258f82dcf7cea4605307f045b12ce58c6f59
6
+ metadata.gz: ff29882c206b0dd096fa946a60b79890344aaac8b6b5f64d854b029be674bccf9aa98545ca3f41e7ff2d3da2dab60d66474a7a8cd68aaa35aae5c31f5f7a39b9
7
+ data.tar.gz: b26643bdc27c4695f9d7672ce27aa596b7e21aa1370a9aa14e45dd52b029000de0d7f6edd27090641c8e6e4c38ee5961a278450390e10be73ad4610a2827519b
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.802]:001 >>> PWN.help
40
+ pwn[v0.4.803]: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.802]:001 >>> PWN.help
55
+ pwn[v0.4.803]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
data/bin/pwn_bdba_scan CHANGED
@@ -88,6 +88,7 @@ begin
88
88
  end
89
89
 
90
90
  scan_progress_resp = {}
91
+ scan_progress_busy_duration = 0
91
92
  loop do
92
93
  scan_progress_resp = PWN::Plugins::BlackDuckBinaryAnalysis.get_apps_by_group(
93
94
  token: token,
@@ -96,10 +97,23 @@ begin
96
97
 
97
98
  break if scan_progress_resp[:products].none? { |p| p[:status] == 'B' } || report_only
98
99
 
100
+ # Cancel queued scan if it's been queued for more than 90 minutes
101
+ if scan_progress_busy_duration > 5_400
102
+ scan_progress_resp[:products].select { |p| p[:status] == 'B' }.each do |p|
103
+ puts "Abort Queued Scan: #{p[:name]}"
104
+ PWN::Plugins::BlackDuckBinaryAnalysis.abort_product_scan(
105
+ token: token,
106
+ product_id: p[:product_id]
107
+ )
108
+ end
109
+ raise "ERROR: BDBA Scan Queued for More than 90 Minutes: #{target_file}"
110
+ end
111
+
99
112
  10.times do
100
113
  print '.'
101
114
  sleep 1
102
115
  end
116
+ scan_progress_busy_duration += 10
103
117
  end
104
118
 
105
119
  product_id = scan_progress_resp[:products].find { |p| p[:name] == CGI.escape(File.basename(target_file)) }[:product_id]
@@ -209,6 +209,27 @@ module PWN
209
209
  raise e
210
210
  end
211
211
 
212
+ # Supported Method Parameters::
213
+ # response = PWN::Plugins::BlackDuckBinaryAnalysis.abort_product_scan(
214
+ # token: 'required - Bearer token',
215
+ # product_id: 'required - product id'
216
+ # )
217
+
218
+ public_class_method def self.abort_product_scan(opts = {})
219
+ token = opts[:token]
220
+ product_id = opts[:product_id]
221
+
222
+ response = bd_bin_analysis_rest_call(
223
+ http_method: :post,
224
+ token: token,
225
+ rest_call: "product/#{product_id}/abort"
226
+ )
227
+
228
+ JSON.parse(response, symbolize_names: true)
229
+ rescue StandardError => e
230
+ raise e
231
+ end
232
+
212
233
  # Supported Method Parameters::
213
234
  # response = PWN::Plugins::BlackDuckBinaryAnalysis.generate_product_report(
214
235
  # token: 'required - Bearer token',
@@ -584,6 +605,11 @@ module PWN
584
605
  product_id: 'required - product id'
585
606
  )
586
607
 
608
+ response = #{self}.abort_product_scan(
609
+ token: 'required - Bearer token',
610
+ product_id: 'required - product id'
611
+ )
612
+
587
613
  response = #{self}.generate_product_report(
588
614
  token: 'required - Bearer token',
589
615
  product_id: 'required - product id',
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.802'
4
+ VERSION = '0.4.803'
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.802
4
+ version: 0.4.803
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-07-17 00:00:00.000000000 Z
11
+ date: 2023-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport