pwn 0.4.855 → 0.4.856

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: 4b0e26ef8cb906bc4db7adfb5a04669233e68d6d849dda78ea0cdb5e6be8721f
4
- data.tar.gz: f912aec9e8a88b0d95af96e1143b6e6e9102d059248f403d393b70db91689cbc
3
+ metadata.gz: 4f3b58109cad13de02340f5a9c796b51a965f8b18d68e124a29107c3b1de0150
4
+ data.tar.gz: ef977ebb8a8041f55d27f74c679852bfc8df2f7ce05acdeaaec2ca74b5fcec55
5
5
  SHA512:
6
- metadata.gz: 1119d402b0f9df3d28297097b59eeebbbf3f561874812261793218af4992fd9357f50cba9e905d0d05f4f992d1fef5448dbd97f5f6dc1e59fdc515607e4a57a8
7
- data.tar.gz: 45b3e2debba43dafcc7eeccb856dd6249c39dc48a3ae14a64c0d81ff94500348dd9b1311d056d482ed6359448cd359e5a06cce9079435c041f294bc3f32a2091
6
+ metadata.gz: 54a6e87acf5e95e78bbfc4a9e59d49ae779ba6b0ac2d80175c841e23815da2eebbbc275143c1422b6f629d7d4211df12c1fa1078097684d7d57001e055a6f7ce
7
+ data.tar.gz: c89240de42a8023ded9133015c8f556d4af756e255deefa6453b2bf70eb70a9c7ceb0d098df1c6bfeb0fa0d35bdf17ae552efc29771bf96fec6a4dc580c84538
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2023-07-06 20:02:51 UTC using RuboCop version 1.53.1.
3
+ # on 2023-08-22 17:34:13 UTC using RuboCop version 1.56.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -17,16 +17,16 @@ Layout/LineContinuationSpacing:
17
17
  - 'packer/provisioners/wpscan.rb'
18
18
  - 'vagrant/provisioners/beef.rb'
19
19
 
20
- # Offense count: 282
20
+ # Offense count: 284
21
21
  # This cop supports unsafe autocorrection (--autocorrect-all).
22
22
  Lint/UselessAssignment:
23
23
  Enabled: false
24
24
 
25
- # Offense count: 669
25
+ # Offense count: 676
26
26
  Lint/UselessRescue:
27
27
  Enabled: false
28
28
 
29
- # Offense count: 283
29
+ # Offense count: 286
30
30
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
31
31
  Metrics/AbcSize:
32
32
  Max: 328
@@ -48,22 +48,22 @@ Metrics/CollectionLiteralLength:
48
48
  Exclude:
49
49
  - 'lib/pwn/plugins/uri_scheme.rb'
50
50
 
51
- # Offense count: 108
51
+ # Offense count: 109
52
52
  # Configuration parameters: AllowedMethods, AllowedPatterns.
53
53
  Metrics/CyclomaticComplexity:
54
54
  Max: 231
55
55
 
56
- # Offense count: 518
56
+ # Offense count: 522
57
57
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
58
58
  Metrics/MethodLength:
59
59
  Max: 466
60
60
 
61
- # Offense count: 52
61
+ # Offense count: 53
62
62
  # Configuration parameters: CountComments, CountAsOne.
63
63
  Metrics/ModuleLength:
64
64
  Max: 1187
65
65
 
66
- # Offense count: 101
66
+ # Offense count: 102
67
67
  # Configuration parameters: AllowedMethods, AllowedPatterns.
68
68
  Metrics/PerceivedComplexity:
69
69
  Max: 51
@@ -92,6 +92,12 @@ Style/IfUnlessModifier:
92
92
  - 'bin/pwn'
93
93
  - 'lib/pwn/plugins/baresip.rb'
94
94
 
95
+ # Offense count: 1
96
+ # This cop supports safe autocorrection (--autocorrect).
97
+ Style/RedundantBegin:
98
+ Exclude:
99
+ - 'lib/pwn/www/hacker_one.rb'
100
+
95
101
  # Offense count: 95
96
102
  # This cop supports safe autocorrection (--autocorrect).
97
103
  Style/RedundantCondition:
@@ -130,7 +136,7 @@ Style/StringLiterals:
130
136
  Exclude:
131
137
  - 'bin/pwn'
132
138
 
133
- # Offense count: 601
139
+ # Offense count: 610
134
140
  # This cop supports safe autocorrection (--autocorrect).
135
141
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
136
142
  # URISchemes: http, https
data/Gemfile CHANGED
@@ -11,7 +11,7 @@ gemspec
11
11
  # In some circumstances custom flags are passed to gems in order
12
12
  # to build appropriately. Defer to ./reinstall_pwn_gemset.sh
13
13
  # to review these custom flags (e.g. pg, serialport, etc).
14
- gem 'activesupport', '7.0.7'
14
+ gem 'activesupport', '7.0.7.1'
15
15
  gem 'anemone', '0.7.2'
16
16
  gem 'authy', '3.0.1'
17
17
  gem 'aws-sdk', '3.1.0'
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.855]:001 >>> PWN.help
40
+ pwn[v0.4.856]: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.855]:001 >>> PWN.help
55
+ pwn[v0.4.856]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -12,6 +12,7 @@ module PWN
12
12
  # burp_jar_path: 'required - path of burp suite pro jar file',
13
13
  # headless: 'optional - run burp headless if set to true',
14
14
  # browser_type: 'optional - defaults to :firefox. See PWN::Plugins::TransparentBrowser.help for a list of types',
15
+ # target_config: 'optional - path to burp suite pro target config JSON file'
15
16
  # )
16
17
 
17
18
  public_class_method def self.start(opts = {})
@@ -26,6 +27,8 @@ module PWN
26
27
  opts[:browser_type]
27
28
  end
28
29
 
30
+ target_config = opts[:target_config]
31
+
29
32
  if opts[:headless]
30
33
  # burp_cmd_string = "java -Xmx4G -Djava.awt.headless=true -classpath #{burp_root}/burpbuddy.jar:#{burp_jar_path} burp.StartBurp"
31
34
  burp_cmd_string = "java -Xmx4G -Djava.awt.headless=true -classpath #{burp_root}/burpbuddy.jar -jar #{burp_jar_path}"
@@ -33,6 +36,7 @@ module PWN
33
36
  # burp_cmd_string = "java -Xmx4G -classpath #{burp_root}/burpbuddy.jar:#{burp_jar_path} burp.StartBurp"
34
37
  burp_cmd_string = "java -Xmx4G -classpath #{burp_root}/burpbuddy.jar -jar #{burp_jar_path}"
35
38
  end
39
+ burp_cmd_string = "#{burp_cmd_string} --config-file #{target_config}" unless target_config.nil?
36
40
 
37
41
  # Construct burp_obj
38
42
  burp_obj = {}
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.855'
4
+ VERSION = '0.4.856'
5
5
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'faker'
4
+ require 'json'
3
5
  require 'uri'
4
6
  require 'yaml'
5
7
 
@@ -25,7 +27,7 @@ module PWN
25
27
  end
26
28
 
27
29
  # Supported Method Parameters::
28
- # bb_prograns_arr = PWN::WWW::HackerOne.get_bounty_programs(
30
+ # programs_arr = PWN::WWW::HackerOne.get_bounty_programs(
29
31
  # browser_obj: 'required - browser_obj returned from #open method',
30
32
  # proxy: 'optional - scheme://proxy_host:port || tor',
31
33
  # min_payouts_enabled: 'optional - only display programs where payouts are > $0.00 (defaults to false)'
@@ -40,7 +42,7 @@ module PWN
40
42
  browser.goto('https://hackerone.com/bug-bounty-programs')
41
43
  # Wait for JavaScript to load the DOM
42
44
 
43
- bb_programs_arr = []
45
+ programs_arr = []
44
46
  browser.ul(class: 'program__meta-data').wait_until(&:present?)
45
47
  browser.uls(class: 'program__meta-data').each do |ul|
46
48
  min_payout = ul.text.split('$').last.split.first.to_f
@@ -53,23 +55,91 @@ module PWN
53
55
  scheme = URI.parse(link).scheme
54
56
  host = URI.parse(link).host
55
57
  path = URI.parse(link).path
56
- burp_project = "#{scheme}://#{host}/teams#{path}/assets/download_burp_project_file.json"
58
+ burp_target_config = "#{scheme}://#{host}/teams#{path}/assets/download_burp_project_file.json"
57
59
 
58
60
  bounty_program_hash = {
59
61
  name: link.split('/').last,
60
62
  min_payout: min_payout_fmt,
61
63
  policy: "#{link}?view_policy=true",
62
- burp_project: burp_project,
64
+ burp_target_config: burp_target_config,
63
65
  scope: "#{link}/policy_scopes",
64
66
  hacktivity: "#{link}/hacktivity",
65
67
  thanks: "#{link}/thanks",
66
68
  updates: "#{link}/updates",
67
69
  collaborators: "#{link}/collaborators"
68
70
  }
69
- bb_programs_arr.push(bounty_program_hash)
71
+ programs_arr.push(bounty_program_hash)
70
72
  end
71
73
 
72
- bb_programs_arr
74
+ programs_arr
75
+ rescue StandardError => e
76
+ raise e
77
+ end
78
+
79
+ # Supported Method Parameters::
80
+ # PWN::WWW::HackerOne.save_burp_target_config_file(
81
+ # programs_arr: 'required - array of hashes returned from #get_bounty_programs method',
82
+ # browser_opts: 'optional - opts supported by PWN::Plugins::TransparentBrowser.open method',
83
+ # name: 'optional - name of burp target config file (defaults to ALL)',
84
+ # path: 'optional - path to save burp target config files (defaults to "./burp_target_config_file-NAME.json"))'
85
+ # )
86
+
87
+ public_class_method def self.save_burp_target_config_file(opts = {})
88
+ programs_arr = opts[:programs_arr]
89
+ raise 'ERROR: programs_arr should be data returned from #get_bounty_programs' unless programs_arr.any?
90
+
91
+ browser_opts = opts[:browser_opts]
92
+ raise 'ERROR: browser_opts should be a hash' unless browser_opts.nil? ||
93
+ browser_opts.is_a?(Hash)
94
+
95
+ browser_opts ||= {}
96
+ browser_opts[:browser_type] = :rest
97
+
98
+ name = opts[:name]
99
+ path = opts[:path]
100
+
101
+ rest_obj = PWN::Plugins::TransparentBrowser.open(browser_opts)
102
+ rest_client = rest_obj[:browser]::Request
103
+
104
+ if name
105
+ path = "./burp_target_config_file-#{name}.json" if opts[:path].nil?
106
+ burp_download_link = programs_arr.select do |program|
107
+ program[:name] == name
108
+ end.first[:burp_target_config]
109
+
110
+ resp = rest_client.execute(
111
+ method: :get,
112
+ headers: { user_agent: Faker::Internet.user_agent },
113
+ url: burp_download_link
114
+ )
115
+ json_resp = JSON.parse(resp.body)
116
+
117
+ puts "Saving to: #{path}"
118
+ File.write(path, JSON.pretty_generate(json_resp))
119
+ else
120
+ programs_arr.each do |program|
121
+ begin
122
+ name = program[:name]
123
+ burp_download_link = program[:burp_target_config]
124
+ path = "./burp_target_config_file-#{name}.json" if opts[:path].nil?
125
+
126
+ resp = rest_client.execute(
127
+ method: :get,
128
+ headers: { user_agent: Faker::Internet.user_agent },
129
+ url: burp_download_link
130
+ )
131
+ json_resp = JSON.parse(resp.body)
132
+
133
+ puts "Saving to: #{path}"
134
+ File.write(path, JSON.pretty_generate(json_resp))
135
+ print '.'
136
+ rescue RestClient::NotFound
137
+ print '-'
138
+ next
139
+ end
140
+ end
141
+ end
142
+ puts 'complete.'
73
143
  rescue StandardError => e
74
144
  raise e
75
145
  end
@@ -155,12 +225,19 @@ module PWN
155
225
  browser = browser_obj[:browser]
156
226
  puts browser.public_methods
157
227
 
158
- bb_prograns_arr = #{self}.get_bounty_programs(
228
+ programs_arr = #{self}.get_bounty_programs(
159
229
  browser_obj: 'required - browser_obj returned from #open method',
160
230
  proxy: 'optional - scheme://proxy_host:port || tor',
161
231
  min_payouts_enabled: 'optional - only display programs where payouts are > $0.00 (defaults to false)'
162
232
  )
163
233
 
234
+ #{self}.save_burp_target_config_file(
235
+ programs_arr: 'required - array of hashes returned from #get_bounty_programs method',
236
+ browser_opts: 'optional - opts supported by PWN::Plugins::TransparentBrowser.open method',
237
+ name: 'optional - name of burp target config file (defaults to ALL)',
238
+ path: 'optional - path to save burp target config files (defaults to \"./burp_target_config_file-NAME.json\"))'
239
+ )
240
+
164
241
  browser_obj = #{self}.login(
165
242
  browser_obj: 'required - browser_obj returned from #open method',
166
243
  username: 'required - username',
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.855
4
+ version: 0.4.856
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 7.0.7
19
+ version: 7.0.7.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 7.0.7
26
+ version: 7.0.7.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: anemone
29
29
  requirement: !ruby/object:Gem::Requirement