pwn 0.4.956 → 0.4.957

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: 917e0143e5b82f95bd54f567ec76b72d1ad5a819a95416438d2dc6bf39ea3ec8
4
- data.tar.gz: ae03eeb3bfd8d4d6e68056181eea50f8ce62abee838e2b4d93563ca1a8769214
3
+ metadata.gz: a5a060877f96c4b402469f2889a26ab4c1b7a79b4d168e72ed88ab014d5ac996
4
+ data.tar.gz: 8d59704a564668cbe8fb1c971b0bce667636dcd8f147f15a07405698a0bb1432
5
5
  SHA512:
6
- metadata.gz: 9c25d99b6d76ce1f098c87e9767e45037fc64cde90cbd5087386b167239a59a4a4c0618b808cfe55765ec9f27dfad0939ada1eb2706917342efabc7e04ceec23
7
- data.tar.gz: '08a67b4821bcd551c43c74be96bb6fab5a8734ac13147efcecc3d24137c67a61a6f07d7f0542bf287ab8f4465c1c1c1f44b965df85eea1f6c86fc353b8c71164'
6
+ metadata.gz: 4a861137f80f48f98a95d0250ee64f7dbda436033359d75376e9ec735c6b640ea8c76d156c98e782f92a8988e751424b102c31998db87e35be5e14e1c61e0e16
7
+ data.tar.gz: f79281dfe8784e08ba1f47490a93c75dd50029513413d6c215cf3d4cbf43b8b8667823ac4244ccc7d8be28830cc805e3764c015c6571e916153da612f0f45c90
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.4.956]:001 >>> PWN.help
40
+ pwn[v0.4.957]: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.3.0@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.956]:001 >>> PWN.help
55
+ pwn[v0.4.957]: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.3.0@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.4.956]:001 >>> PWN.help
65
+ pwn[v0.4.957]: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:
data/bin/pwn_bdba_scan CHANGED
@@ -111,6 +111,10 @@ begin
111
111
  group_id: parent_group_id
112
112
  )
113
113
 
114
+ # Break out of infinite loop if status is anything other than 'B' (i.e. 'Busy')
115
+ # Possible status other than 'B' is:
116
+ # 'R' (i.e. 'Ready') or
117
+ # 'F' (i.e. 'Fail')
114
118
  break if scan_progress_resp[:products].none? { |p| p[:status] == 'B' } || report_only
115
119
 
116
120
  # Cancel queued scan if it's been queued for more than 90 minutes
@@ -134,9 +138,32 @@ begin
134
138
  scan_progress_busy_duration += 10
135
139
  end
136
140
 
137
- find_product = scan_progress_resp[:products].find { |p| p[:name] == CGI.escape(File.basename(target_file)) }
141
+ raise 'ERROR: BDBA Scan Failed - Check BDBA Logs for More Info...' if scan_progress_resp[:products].any? { |p| p[:status] == 'F' }
138
142
 
139
- raise NoMethodError if find_product.nil?
143
+ # Account for rare race condition scenario where get_apps_by_group may need to be called
144
+ # multiple times to find the product
145
+ find_product = nil
146
+ find_product_attempts = scan_attempts
147
+ print 'Looking for Product in Apps by Group...'
148
+ loop do
149
+ find_product = scan_progress_resp[:products].find { |p| p[:name] == CGI.escape(File.basename(target_file)) }
150
+ break unless find_product.nil?
151
+
152
+ find_product_attempts += 1
153
+
154
+ raise "ERROR: Cannot Find Product in Apps by Group:\n#{scan_progress_resp}" if find_product_attempts >= scan_attempts
155
+
156
+ 10.times do
157
+ print '.'
158
+ sleep 1
159
+ end
160
+
161
+ scan_progress_resp = PWN::Plugins::BlackDuckBinaryAnalysis.get_apps_by_group(
162
+ token: token,
163
+ group_id: parent_group_id
164
+ )
165
+ end
166
+ puts 'complete.'
140
167
 
141
168
  product_id = find_product[:product_id]
142
169
 
@@ -149,7 +176,6 @@ begin
149
176
 
150
177
  puts "\nReport Saved to: #{report_path}"
151
178
  rescue IO::TimeoutError,
152
- NoMethodError,
153
179
  RestClient::BadGateway,
154
180
  RestClient::BadRequest,
155
181
  RestClient::Exceptions::OpenTimeout,
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.956'
4
+ VERSION = '0.4.957'
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.956
4
+ version: 0.4.957
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-11 00:00:00.000000000 Z
11
+ date: 2024-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport