pwn 0.4.805 → 0.4.806

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: df24a7741ae10182398e97d2c9246f610c2a34b0fc49937302639e3b7841f2be
4
- data.tar.gz: 046ff60cd9d8ac8e71e463104a8c26399d1fb7efacae051bd57ff61a6e063b57
3
+ metadata.gz: f5e7aa0be6bed2f68f8cecb8f8590419f68ba689040f950fc9e8737698764b05
4
+ data.tar.gz: a272ba7b4ce1d812c13a8d8cf620ddbc8131920a7b4b4aa0c125ed1f639bea3b
5
5
  SHA512:
6
- metadata.gz: 2450129fc4ade765a470e1493c707b21b518f546db44989b633377f0e3f114047a1b964a6bdcd27805c0d54c754ebfb8e0018b70289604ed27cb4cd0c967ba2b
7
- data.tar.gz: a94197fa28bee16dafe03e13695f00c12e62ca7ef48e5718dbab1ff3a0da9d626f426532032da368f9a46d34e59a7dc8669bb165a36b845a07317880ddfe4da3
6
+ metadata.gz: 87f668624f4f33f1581fa575e526fab9ebd0ff7fdc3cc0781fb2c0d16b91e8bb60085382daa0bcaaecb5597282eeb455670570d82c8c3805241201772c533665
7
+ data.tar.gz: ba1d22c8aeb122d0f1d88480941aedea665d723736760093caf2fe56ba66dc44b1a0fa9f07b805a7d38637a2d92e40b38a1e0223a491caa49c3ada949cdc0d7d
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.805]:001 >>> PWN.help
40
+ pwn[v0.4.806]: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.805]:001 >>> PWN.help
55
+ pwn[v0.4.806]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
data/bin/pwn_bdba_groups CHANGED
@@ -23,8 +23,8 @@ OptionParser.new do |options|
23
23
  opts[:list_group_name] = l
24
24
  end
25
25
 
26
- options.on('-pPNAME', '--parent-group=PNAME', '<Optional - Black Duck Binary Analysis Parent Group Name to Associate with Group>') do |p|
27
- opts[:parent_group_name] = p
26
+ options.on('-pID', '--parent-group-ID=ID', '<Optional - Black Duck Binary Analysis Parent Group ID to Associate with Group>') do |p|
27
+ opts[:parent_group_id] = p
28
28
  end
29
29
  end.parse!
30
30
 
@@ -46,54 +46,32 @@ begin
46
46
  raise "ERROR: BDBA Token Not Found: #{token}" if token.nil?
47
47
 
48
48
  list_group_name = opts[:list_group_name]
49
- parent_group_name = opts[:parent_group_name]
50
- parent_id = nil
49
+ parent_group_id = opts[:parent_group_id]
51
50
 
52
- if list_group_name || parent_group_name
51
+ if list_group_name
53
52
  groups_resp = PWN::Plugins::BlackDuckBinaryAnalysis.get_groups(
54
53
  token: token
55
54
  )
56
55
 
57
- raise 'No groups found in BDBA. Use the --create flag to create your first group.' if groups_resp.nil?
58
-
59
- list_or_parent = list_group_name unless list_group_name.nil?
60
- list_or_parent = parent_group_name unless parent_group_name.nil?
61
-
62
- group_arr = groups_resp[:groups].select { |g| g[:name] == list_or_parent }
56
+ group_arr = groups_resp[:groups].select { |g| g[:name] == list_group_name }
63
57
 
64
58
  if list_group_name && group_arr.empty?
65
59
  puts 'BDBA Group Not Found.'
66
60
  exit 1
67
61
  end
68
62
 
69
- group_arr_sorted = group_arr.sort_by { |g| g[:id] }
70
- if group_arr_sorted.length > 1
71
- dup_groups_arr = []
72
- group_arr_sorted.each do |group|
73
- this_group_id = group[:id]
74
- this_group_details = PWN::Plugins::BlackDuckBinaryAnalysis.get_group_details(
75
- token: token,
76
- group_id: this_group_id
77
- )
78
- dup_groups_arr.push(this_group_details[:group])
79
- end
80
-
81
- puts "ERROR: Multiple BDBA Groups Found:\n#{dup_groups_arr}"
82
- exit 1
83
- end
84
-
85
- group = group_arr_sorted.last
86
- parent_id = group[:id]
63
+ group_details_arr = []
64
+ group_arr.each do |group|
65
+ group_id = group.[:id]
87
66
 
88
- if list_group_name
89
- group_id = parent_id
90
- group_details_resp = PWN::Plugins::BlackDuckBinaryAnalysis.get_group_details(
67
+ this_group_details = PWN::Plugins::BlackDuckBinaryAnalysis.get_group_details(
91
68
  token: token,
92
69
  group_id: group_id
93
70
  )
94
- puts group_details_resp.to_json
95
- exit 0
71
+ group_details_arr.push(this_group_details)
96
72
  end
73
+ puts group_details_arr.to_json
74
+ exit 0
97
75
  end
98
76
 
99
77
  group_name = opts[:group_name]
@@ -102,7 +80,7 @@ begin
102
80
  create_group_resp = PWN::Plugins::BlackDuckBinaryAnalysis.create_group(
103
81
  token: token,
104
82
  name: group_name,
105
- parent_id: parent_id
83
+ parent_id: parent_group_id
106
84
  )
107
85
 
108
86
  puts create_group_resp.to_json
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.805'
4
+ VERSION = '0.4.806'
5
5
  end
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.4.805
4
+ version: 0.4.806
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.