pwn 0.4.801 → 0.4.803

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b7ad63e0b8d5b9b22fad319b8b520d083b11fc2d3cb27f2844adb090ae19a74
4
- data.tar.gz: '009b6c53800b30a61c0a16e26d1f1db4c5dae6877025f6663349a2ffeb0c7872'
3
+ metadata.gz: b018f6d15b17f497666cf15464f43bd6a1e02e20c0ad87633bb45425ddef3ad7
4
+ data.tar.gz: 75fb48990f0526ff22180cb53e51efa5e6cb0b0c897235523f17f341698916e3
5
5
  SHA512:
6
- metadata.gz: 2effa631570ca78d2b9a9a160d276b63edf4a8c0684fb8abfee821cb97027af07afde92800a146dffc2636b039873071edacab33c33bb7d4606c6d81ee1fd424
7
- data.tar.gz: bf36c8999fa022eb266280ef4d736c96ddbcc0b52e0599ba710ec48a928e02fb642c3aa336df18c01d0093963f7b4928ff90997b3055b844035756de246a5a98
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.801]: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.801]: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]
@@ -17,12 +17,8 @@ if (( $# == 3 )); then
17
17
  # Tag for every 100 commits (i.e. 0.1.100, 0.1.200, etc)
18
18
  tag_this_version_bool=`ruby -r 'pwn' -e 'if (PWN::VERSION.split(".")[-1].to_i + 1) % 100 == 0; then print true; else print false; end'`
19
19
  if [[ $tag_this_version_bool == 'true' ]]; then
20
- this_version=`ruby -r 'pwn' -e 'print PWN::VERSION'`
21
- echo "Tagging: ${this_version}"
22
- git tag $this_version
23
- last_tag=$(git tag | tail -n 2 | head -n 1)
24
- this_tag=$(git tag | tail -n 1)
25
- git log $last_tag...$this_tag --oneline > CHANGELOG_BETWEEN_TAGS.txt
20
+ last_tag=$(git tag | tail -n 1)
21
+ git log $last_tag.. --oneline > CHANGELOG_BETWEEN_TAGS.txt
26
22
  fi
27
23
 
28
24
  git commit -a -S --author="${1} <${2}>" -m "${3}"
@@ -33,8 +29,12 @@ if (( $# == 3 )); then
33
29
  echo "Pushing ${latest_gem} to RubyGems.org..."
34
30
  rvmsudo gem push $latest_gem --debug
35
31
  fi
32
+
36
33
  if [[ $tag_this_version_bool == 'true' ]]; then
37
- git push origin ${this_tag}
34
+ this_version=`ruby -r 'pwn' -e 'print PWN::VERSION'`
35
+ echo "Tagging: ${this_version}"
36
+ git tag $this_version
37
+ git push origin $this_version
38
38
  fi
39
39
  else
40
40
  usage
@@ -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.801'
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.801
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