pwn 0.5.398 → 0.5.400
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 +4 -4
- data/CHANGELOG_BETWEEN_TAGS.txt +181 -180
- data/README.md +3 -3
- data/bin/pwn_burp_suite_pro_active_rest_api_scan +16 -24
- data/bin/pwn_burp_suite_pro_active_scan +16 -25
- data/bin/pwn_zaproxy_active_rest_api_scan +159 -0
- data/bin/{pwn_owasp_zap_active_scan → pwn_zaproxy_active_scan} +59 -50
- data/lib/pwn/plugins/burp_suite.rb +22 -18
- data/lib/pwn/plugins/{owasp_zap.rb → zaproxy.rb} +143 -159
- data/lib/pwn/plugins.rb +1 -1
- data/lib/pwn/version.rb +1 -1
- data/spec/lib/pwn/plugins/{owasp_zap_spec.rb → zaproxy_spec.rb} +3 -3
- metadata +7 -5
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'cgi'
|
3
4
|
require 'pty'
|
4
5
|
require 'securerandom'
|
5
6
|
require 'json'
|
@@ -9,7 +10,7 @@ module PWN
|
|
9
10
|
module Plugins
|
10
11
|
# This plugin converts images to readable text
|
11
12
|
# TODO: Convert all rest requests to POST instead of GET
|
12
|
-
module
|
13
|
+
module Zaproxy
|
13
14
|
@@logger = PWN::Plugins::PWNLogger.create
|
14
15
|
|
15
16
|
# Supported Method Parameters::
|
@@ -30,12 +31,10 @@ module PWN
|
|
30
31
|
end
|
31
32
|
params = opts[:params]
|
32
33
|
http_body = opts[:http_body].to_s.scrub
|
33
|
-
|
34
|
-
|
35
|
-
base_zap_api_uri = "http://#{host}:#{port}"
|
34
|
+
zap_rest_api = zap_obj[:zap_rest_api]
|
35
|
+
base_zap_api_uri = "http://#{zap_rest_api}"
|
36
36
|
|
37
|
-
|
38
|
-
rest_client = browser_obj[:browser]::Request
|
37
|
+
rest_client = zap_obj[:rest_browser]::Request
|
39
38
|
|
40
39
|
case http_method
|
41
40
|
when :get
|
@@ -72,129 +71,128 @@ module PWN
|
|
72
71
|
end
|
73
72
|
|
74
73
|
# Supported Method Parameters::
|
75
|
-
# zap_obj = PWN::Plugins::
|
74
|
+
# zap_obj = PWN::Plugins::Zaproxy.start(
|
76
75
|
# api_key: 'required - api key for API authorization',
|
77
76
|
# zap_bin_path: 'optional - path to zap.sh file'
|
78
77
|
# headless: 'optional - run zap headless if set to true',
|
78
|
+
# browser_type: 'optional - defaults to :firefox. See PWN::Plugins::TransparentBrowser.help for a list of types',
|
79
79
|
# proxy: 'optional - change local zap proxy listener (defaults to http://127.0.0.1:<Random 1024-65535>)',
|
80
80
|
# )
|
81
81
|
|
82
82
|
public_class_method def self.start(opts = {})
|
83
83
|
zap_obj = {}
|
84
|
-
api_key = opts[:api_key]
|
84
|
+
api_key = opts[:api_key]
|
85
|
+
raise 'ERROR: api_key must be provided' if api_key.nil?
|
86
|
+
|
85
87
|
zap_obj[:api_key] = api_key
|
86
88
|
|
87
|
-
|
88
|
-
|
89
|
-
else
|
90
|
-
false
|
91
|
-
end
|
92
|
-
|
93
|
-
if opts[:zap_bin_path]
|
94
|
-
zap_bin_path = opts[:zap_bin_path].to_s.scrub.strip.chomp if File.exist?(opts[:zap_bin_path].to_s.scrub.strip.chomp)
|
95
|
-
else
|
96
|
-
underlying_os = PWN::Plugins::DetectOS.type
|
97
|
-
|
98
|
-
case underlying_os
|
99
|
-
when :linux
|
100
|
-
zap_bin_path = '/usr/share/zaproxy/zap.sh'
|
101
|
-
when :osx
|
102
|
-
zap_bin_path = '/Applications/OWASP\ ZAP.app/Contents/Java/zap.sh'
|
103
|
-
else
|
104
|
-
raise "ERROR: zap.sh not found for #{underlying_os}. Please pass the :zap_bin_path parameter to this method for proper execution"
|
105
|
-
end
|
106
|
-
end
|
89
|
+
zap_bin_path = opts[:zap_bin_path] ||= '/usr/share/zaproxy/zap.sh'
|
90
|
+
raise "ERROR: #{zap_bin_path} not found." unless File.exist?(zap_bin_path)
|
107
91
|
|
108
92
|
zap_bin = File.basename(zap_bin_path)
|
109
|
-
|
93
|
+
zap_root = File.dirname(zap_bin_path)
|
94
|
+
|
95
|
+
headless = opts[:headless] || false
|
96
|
+
browser_type = opts[:browser_type] ||= :firefox
|
97
|
+
zap_ip = opts[:zap_ip] ||= '127.0.0.1'
|
98
|
+
zap_port = opts[:zap_port] ||= PWN::Plugins::Sock.get_random_unused_port
|
99
|
+
|
100
|
+
zap_rest_ip = zap_ip
|
101
|
+
zap_rest_port = zap_port
|
110
102
|
|
111
103
|
if headless
|
112
|
-
|
104
|
+
zaproxy_cmd = "cd #{zap_root} && ./#{zap_bin} -daemon"
|
113
105
|
else
|
114
|
-
|
106
|
+
zaproxy_cmd = "cd #{zap_root} && ./#{zap_bin}"
|
115
107
|
end
|
116
108
|
|
117
|
-
|
118
|
-
|
119
|
-
proxy = "http://127.0.0.1:#{random_port}"
|
120
|
-
proxy = opts[:proxy].to_s.scrub.strip.chomp if opts[:proxy]
|
121
|
-
|
122
|
-
proxy_uri = URI.parse(proxy)
|
123
|
-
owasp_zap_cmd = "#{owasp_zap_cmd} -host #{proxy_uri.host} -port #{proxy_uri.port}"
|
124
|
-
zap_obj[:host] = proxy_uri.host.to_s.scrub
|
125
|
-
zap_obj[:port] = proxy_uri.port.to_i
|
126
|
-
|
127
|
-
pwn_stdout_log_path = "/tmp/pwn_plugins_owasp-#{SecureRandom.hex}.log"
|
128
|
-
pwn_stdout_log = File.new(pwn_stdout_log_path, 'w')
|
129
|
-
# Immediately writes all buffered data in IO to disk
|
130
|
-
pwn_stdout_log.sync = true
|
131
|
-
pwn_stdout_log.fsync
|
132
|
-
|
133
|
-
fork_pid = Process.fork do
|
134
|
-
PTY.spawn(owasp_zap_cmd) do |stdout, _stdin, _pid|
|
135
|
-
stdout.each do |line|
|
136
|
-
puts line
|
137
|
-
pwn_stdout_log.puts line
|
138
|
-
end
|
139
|
-
end
|
140
|
-
rescue PTY::ChildExited, SystemExit, Interrupt, Errno::EIO
|
141
|
-
puts 'Spawned OWASP Zap PTY exiting...'
|
142
|
-
File.unlink(pwn_stdout_log_path)
|
143
|
-
rescue StandardError => e
|
144
|
-
puts 'Spawned process exiting...'
|
145
|
-
File.unlink(pwn_stdout_log_path)
|
146
|
-
raise e
|
147
|
-
end
|
148
|
-
Process.detach(fork_pid)
|
149
|
-
|
150
|
-
zap_obj[:pid] = fork_pid
|
151
|
-
zap_obj[:stdout_log] = pwn_stdout_log_path
|
152
|
-
# This is how we'll know OWSAP Zap is in a ready state.
|
153
|
-
# if headless
|
154
|
-
# return_pattern = '[ZAP-daemon] INFO org.zaproxy.zap.DaemonBootstrap - ZAP is now listening'
|
155
|
-
# else
|
156
|
-
# case underlying_os
|
157
|
-
# when :linux
|
158
|
-
# return_pattern = '[AWT-EventQueue-1] INFO hsqldb.db..ENGINE - Database closed'
|
159
|
-
# when :osx
|
160
|
-
# return_pattern = '[AWT-EventQueue-0] INFO hsqldb.db..ENGINE - Database closed'
|
161
|
-
# end
|
162
|
-
# end
|
163
|
-
return_pattern = 'Started callback service on'
|
109
|
+
zaproxy_cmd = "#{zaproxy_cmd} -host #{zap_ip} -port #{zap_port}"
|
164
110
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
111
|
+
zap_obj[:pid] = Process.spawn(zaproxy_cmd)
|
112
|
+
browser_obj1 = PWN::Plugins::TransparentBrowser.open(browser_type: :rest)
|
113
|
+
rest_browser = browser_obj1[:browser]
|
114
|
+
|
115
|
+
zap_obj[:mitm_proxy] = "#{zap_ip}:#{zap_port}"
|
116
|
+
zap_obj[:zap_rest_api] = zap_obj[:mitm_proxy]
|
117
|
+
zap_obj[:rest_browser] = rest_browser
|
118
|
+
|
119
|
+
browser_obj2 = PWN::Plugins::TransparentBrowser.open(
|
120
|
+
browser_type: browser_type,
|
121
|
+
proxy: "http://#{zap_obj[:mitm_proxy]}",
|
122
|
+
devtools: true
|
123
|
+
)
|
124
|
+
|
125
|
+
zap_obj[:zap_browser] = browser_obj2
|
170
126
|
|
127
|
+
# Wait for pwn_burp_port to open prior to returning burp_obj
|
128
|
+
loop do
|
129
|
+
s = TCPSocket.new(zap_rest_ip, zap_rest_port)
|
130
|
+
s.close
|
131
|
+
break
|
132
|
+
rescue Errno::ECONNREFUSED
|
133
|
+
print '.'
|
171
134
|
sleep 3
|
135
|
+
next
|
172
136
|
end
|
137
|
+
|
138
|
+
zap_obj
|
139
|
+
rescue StandardError, SystemExit, Interrupt => e
|
140
|
+
stop(zap_obj) unless zap_obj.nil?
|
141
|
+
raise e
|
142
|
+
end
|
143
|
+
|
144
|
+
# Supported Method Parameters::
|
145
|
+
# PWN::Plugins::Zaproxy.import_openapi_to_sitemap(
|
146
|
+
# zap_obj: 'required - zap_obj returned from #open method',
|
147
|
+
# openapi_spec: 'required - path to OpenAPI JSON or YAML spec file'
|
148
|
+
# )
|
149
|
+
|
150
|
+
public_class_method def self.import_openapi_to_sitemap(opts = {})
|
151
|
+
zap_obj = opts[:zap_obj]
|
152
|
+
api_key = zap_obj[:api_key].to_s.scrub
|
153
|
+
openapi_spec = opts[:openapi_spec]
|
154
|
+
raise "ERROR: openapi_spec file #{openapi_spec} does not exist" unless File.exist?(openapi_spec)
|
155
|
+
|
156
|
+
openapi_spec_root = File.dirname(openapi_spec)
|
157
|
+
Dir.chdir(openapi_spec_root)
|
158
|
+
|
159
|
+
params = {
|
160
|
+
apikey: api_key,
|
161
|
+
file: openapi_spec
|
162
|
+
}
|
163
|
+
|
164
|
+
response = zap_rest_call(
|
165
|
+
zap_obj: zap_obj,
|
166
|
+
rest_call: 'JSON/openapi/action/importFile/',
|
167
|
+
params: params
|
168
|
+
)
|
169
|
+
|
170
|
+
JSON.parse(response.body, symbolize_names: true)
|
173
171
|
rescue StandardError, SystemExit, Interrupt => e
|
174
172
|
stop(zap_obj) unless zap_obj.nil?
|
175
173
|
raise e
|
176
174
|
end
|
177
175
|
|
178
176
|
# Supported Method Parameters::
|
179
|
-
# PWN::Plugins::
|
177
|
+
# PWN::Plugins::Zaproxy.spider(
|
180
178
|
# zap_obj: 'required - zap_obj returned from #open method',
|
181
|
-
#
|
179
|
+
# target_url: 'required - url to spider'
|
182
180
|
# )
|
183
181
|
|
184
182
|
public_class_method def self.spider(opts = {})
|
185
183
|
zap_obj = opts[:zap_obj]
|
186
|
-
|
184
|
+
target_url = opts[:target_url].to_s.scrub
|
187
185
|
api_key = zap_obj[:api_key].to_s.scrub
|
188
186
|
|
189
|
-
# target_domain_name = URI.parse(
|
187
|
+
# target_domain_name = URI.parse(target_url).host
|
190
188
|
|
191
189
|
params = {
|
192
190
|
apikey: api_key,
|
193
|
-
url:
|
191
|
+
url: target_url,
|
194
192
|
maxChildren: 9,
|
195
193
|
recurse: 3,
|
196
194
|
contextName: '',
|
197
|
-
subtreeOnly:
|
195
|
+
subtreeOnly: target_url
|
198
196
|
}
|
199
197
|
|
200
198
|
response = zap_rest_call(
|
@@ -229,26 +227,26 @@ module PWN
|
|
229
227
|
end
|
230
228
|
|
231
229
|
# Supported Method Parameters::
|
232
|
-
# PWN::Plugins::
|
230
|
+
# PWN::Plugins::Zaproxy.active_scan(
|
233
231
|
# zap_obj: 'required - zap_obj returned from #open method',
|
234
|
-
#
|
232
|
+
# target_url: 'required - url to scan',
|
235
233
|
# scan_policy: 'optional - scan policy to use (defaults to Default Policy)'
|
236
234
|
# )
|
237
235
|
|
238
236
|
public_class_method def self.active_scan(opts = {})
|
239
237
|
zap_obj = opts[:zap_obj]
|
240
238
|
api_key = zap_obj[:api_key].to_s.scrub
|
241
|
-
|
239
|
+
target_url = opts[:target_url]
|
242
240
|
if opts[:scan_policy].nil?
|
243
241
|
scan_policy = 'Default Policy'
|
244
242
|
else
|
245
243
|
scan_policy = opts[:scan_policy].to_s.scrub.strip.chomp
|
246
244
|
end
|
247
245
|
|
248
|
-
# TODO: Implement adding
|
246
|
+
# TODO: Implement adding target_url to scope so that inScopeOnly can be changed to true
|
249
247
|
params = {
|
250
248
|
apikey: api_key,
|
251
|
-
url:
|
249
|
+
url: target_url,
|
252
250
|
recurse: true,
|
253
251
|
inScopeOnly: true,
|
254
252
|
scanPolicyName: scan_policy
|
@@ -286,19 +284,19 @@ module PWN
|
|
286
284
|
end
|
287
285
|
|
288
286
|
# Supported Method Parameters::
|
289
|
-
# PWN::Plugins::
|
287
|
+
# PWN::Plugins::Zaproxy.alerts(
|
290
288
|
# zap_obj: 'required - zap_obj returned from #open method',
|
291
|
-
#
|
289
|
+
# target_url: 'required - base url to return alerts'
|
292
290
|
# )
|
293
291
|
|
294
292
|
public_class_method def self.alerts(opts = {})
|
295
293
|
zap_obj = opts[:zap_obj]
|
296
294
|
api_key = zap_obj[:api_key].to_s.scrub
|
297
|
-
|
295
|
+
target_url = opts[:target_url]
|
298
296
|
|
299
297
|
params = {
|
300
298
|
apikey: api_key,
|
301
|
-
url:
|
299
|
+
url: target_url
|
302
300
|
}
|
303
301
|
|
304
302
|
response = zap_rest_call(
|
@@ -314,36 +312,39 @@ module PWN
|
|
314
312
|
end
|
315
313
|
|
316
314
|
# Supported Method Parameters::
|
317
|
-
# report_path = PWN::Plugins::
|
315
|
+
# report_path = PWN::Plugins::Zaproxy.generate_scan_report(
|
318
316
|
# zap_obj: 'required - zap_obj returned from #open method',
|
319
317
|
# output_dir: 'required - directory to save report',
|
320
|
-
# report_type: 'required -
|
318
|
+
# report_type: 'required - <:html|:markdown|:xml>'
|
321
319
|
# )
|
322
320
|
|
323
|
-
public_class_method def self.
|
321
|
+
public_class_method def self.generate_scan_report(opts = {})
|
324
322
|
zap_obj = opts[:zap_obj]
|
325
323
|
api_key = zap_obj[:api_key].to_s.scrub
|
326
|
-
output_dir = opts[:output_dir]
|
327
|
-
|
324
|
+
output_dir = opts[:output_dir]
|
325
|
+
raise "ERROR: output_dir #{output_dir} does not exist." unless Dir.exist?(output_dir)
|
328
326
|
|
329
|
-
|
330
|
-
|
331
|
-
|
327
|
+
report_type = opts[:report_type]
|
328
|
+
|
329
|
+
valid_report_types_arr = %i[html markdown xml]
|
330
|
+
raise "ERROR: Invalid report_type => #{report_type}" unless valid_report_types_arr.include?(report_type)
|
332
331
|
|
333
332
|
case report_type
|
334
333
|
when :html
|
335
|
-
report_path = "#{output_dir}/
|
334
|
+
report_path = "#{output_dir}/zaproxy_active_scan_results.html"
|
336
335
|
rest_call = 'OTHER/core/other/htmlreport/'
|
337
336
|
when :markdown
|
338
|
-
report_path = "#{output_dir}/
|
337
|
+
report_path = "#{output_dir}/zaproxy_active_scan_results.md"
|
339
338
|
rest_call = 'OTHER/core/other/mdreport/'
|
340
339
|
when :xml
|
341
|
-
report_path = "#{output_dir}/
|
340
|
+
report_path = "#{output_dir}/zaproxy_active_scan_results.xml"
|
342
341
|
rest_call = 'OTHER/core/other/xmlreport/'
|
343
|
-
else
|
344
|
-
raise @@logger.error("ERROR: Unsupported report type: #{report_type}\nValid report types are <html|markdown|xml>")
|
345
342
|
end
|
346
343
|
|
344
|
+
params = {
|
345
|
+
apikey: api_key
|
346
|
+
}
|
347
|
+
|
347
348
|
response = zap_rest_call(
|
348
349
|
zap_obj: zap_obj,
|
349
350
|
rest_call: rest_call,
|
@@ -361,7 +362,7 @@ module PWN
|
|
361
362
|
end
|
362
363
|
|
363
364
|
# Supported Method Parameters::
|
364
|
-
# PWN::Plugins::
|
365
|
+
# PWN::Plugins::Zaproxy.breakpoint(
|
365
366
|
# zap_obj: 'required - zap_obj returned from #open method',
|
366
367
|
# regex_type: 'required - :url, :request_header, :request_body, :response_header or :response_body',
|
367
368
|
# regex_pattern: 'required - regex pattern to search for respective regex_type',
|
@@ -395,7 +396,7 @@ module PWN
|
|
395
396
|
end
|
396
397
|
|
397
398
|
# Supported Method Parameters::
|
398
|
-
# PWN::Plugins::
|
399
|
+
# PWN::Plugins::Zaproxy.tamper(
|
399
400
|
# zap_obj: 'required - zap_obj returned from #open method',
|
400
401
|
# domain: 'required - FQDN to tamper (e.g. test.domain.local)',
|
401
402
|
# enabled: 'optional - boolean (defaults to true)'
|
@@ -427,42 +428,7 @@ module PWN
|
|
427
428
|
end
|
428
429
|
|
429
430
|
# Supported Method Parameters::
|
430
|
-
# PWN::Plugins::
|
431
|
-
# zap_obj: 'required - zap_obj returned from #open method',
|
432
|
-
# spec: 'required - path to OpenAPI spec file (e.g. /path/to/openapi.yaml)',
|
433
|
-
# target: 'required - target URL to ovverride the service URL in the OpenAPI spec (e.g. https://fq.dn)',
|
434
|
-
# context_id: 'optional - ID of the ZAP context (Defaults to first context, if any)',
|
435
|
-
# user_id: 'optional - ID of the ZAP user (Defaults to first user, if any)'
|
436
|
-
# )
|
437
|
-
|
438
|
-
public_class_method def self.import_openapi_spec_file(opts = {})
|
439
|
-
zap_obj = opts[:zap_obj]
|
440
|
-
api_key = zap_obj[:api_key].to_s.scrub
|
441
|
-
spec = opts[:spec]
|
442
|
-
target = opts[:target]
|
443
|
-
context_id = opts[:context_id]
|
444
|
-
user_id = opts[:user_id]
|
445
|
-
|
446
|
-
params = {
|
447
|
-
apikey: api_key,
|
448
|
-
file: spec,
|
449
|
-
target: target,
|
450
|
-
contextId: context_id,
|
451
|
-
user_id: user_id
|
452
|
-
}
|
453
|
-
|
454
|
-
zap_rest_call(
|
455
|
-
zap_obj: zap_obj,
|
456
|
-
rest_call: "JSON/break/action/openapi/?zapapiformat=JSON&apikey=#{api_key}",
|
457
|
-
params: params
|
458
|
-
)
|
459
|
-
rescue StandardError, SystemExit, Interrupt => e
|
460
|
-
stop(zap_obj) unless zap_obj.nil?
|
461
|
-
raise e
|
462
|
-
end
|
463
|
-
|
464
|
-
# Supported Method Parameters::
|
465
|
-
# watir_resp = PWN::Plugins::OwaspZap.request(
|
431
|
+
# watir_resp = PWN::Plugins::Zaproxy.request(
|
466
432
|
# zap_obj: 'required - zap_obj returned from #open method',
|
467
433
|
# browser_obj: 'required - browser_obj w/ browser_type: :firefox||:headless returned from #open method',
|
468
434
|
# instruction: 'required - watir instruction to make (e.g. button(text: "Google Search").click)'
|
@@ -502,14 +468,28 @@ module PWN
|
|
502
468
|
end
|
503
469
|
|
504
470
|
# Supported Method Parameters::
|
505
|
-
# PWN::Plugins::
|
506
|
-
# :
|
471
|
+
# PWN::Plugins::Zaproxy.stop(
|
472
|
+
# zap_obj: 'required - zap_obj returned from #open method'
|
507
473
|
# )
|
508
474
|
|
509
475
|
public_class_method def self.stop(opts = {})
|
510
476
|
zap_obj = opts[:zap_obj]
|
511
|
-
|
512
|
-
|
477
|
+
api_key = zap_obj[:api_key]
|
478
|
+
browser_obj = zap_obj[:zap_browser]
|
479
|
+
rest_browser = zap_obj[:rest_browser]
|
480
|
+
|
481
|
+
browser_obj = PWN::Plugins::TransparentBrowser.close(browser_obj: browser_obj)
|
482
|
+
|
483
|
+
params = { apikey: api_key }
|
484
|
+
zap_rest_call(
|
485
|
+
zap_obj: zap_obj,
|
486
|
+
rest_call: 'JSON/core/action/shutdown/',
|
487
|
+
params: params
|
488
|
+
)
|
489
|
+
|
490
|
+
zap_obj = nil
|
491
|
+
rescue StandardError, SystemExit, Interrupt => e
|
492
|
+
stop(zap_obj) unless zap_obj.nil?
|
513
493
|
raise e
|
514
494
|
end
|
515
495
|
|
@@ -531,28 +511,32 @@ module PWN
|
|
531
511
|
headless: 'optional - run zap headless if set to true',
|
532
512
|
proxy: 'optional - change local zap proxy listener (defaults to http://127.0.0.1:<Random 1024-65535>)'
|
533
513
|
)
|
534
|
-
puts zap_obj.public_methods
|
535
514
|
|
536
515
|
#{self}.spider(
|
537
516
|
zap_obj: 'required - zap_obj returned from #open method',
|
538
|
-
|
517
|
+
target_url: 'required - url to spider'
|
518
|
+
)
|
519
|
+
|
520
|
+
#{self}.import_openapi_to_sitemap(
|
521
|
+
zap_obj: 'required - zap_obj returned from #open method',
|
522
|
+
openapi_spec: 'required - path to OpenAPI JSON or YAML spec file'
|
539
523
|
)
|
540
524
|
|
541
525
|
#{self}.active_scan(
|
542
526
|
zap_obj: 'required - zap_obj returned from #open method'
|
543
|
-
|
527
|
+
target_url: 'required - url to scan',
|
544
528
|
scan_policy: 'optional - scan policy to use (defaults to Default Policy)'
|
545
529
|
)
|
546
530
|
|
547
531
|
json_alerts = #{self}.alerts(
|
548
532
|
zap_obj: 'required - zap_obj returned from #open method'
|
549
|
-
|
533
|
+
target_url: 'required - base url to return alerts'
|
550
534
|
)
|
551
535
|
|
552
|
-
report_path = #{self}.
|
536
|
+
report_path = #{self}.generate_scan_report(
|
553
537
|
zap_obj: 'required - zap_obj returned from #open method',
|
554
538
|
output_dir: 'required - directory to save report',
|
555
|
-
report_type: 'required -
|
539
|
+
report_type: 'required - <:html|:markdown|:xml>'
|
556
540
|
)
|
557
541
|
|
558
542
|
#{self}.breakpoint(
|
data/lib/pwn/plugins.rb
CHANGED
@@ -51,7 +51,6 @@ module PWN
|
|
51
51
|
autoload :OpenAI, 'pwn/plugins/open_ai'
|
52
52
|
autoload :OpenAPI, 'pwn/plugins/open_api'
|
53
53
|
autoload :OpenVAS, 'pwn/plugins/openvas'
|
54
|
-
autoload :OwaspZap, 'pwn/plugins/owasp_zap'
|
55
54
|
autoload :Packet, 'pwn/plugins/packet'
|
56
55
|
autoload :PDFParse, 'pwn/plugins/pdf_parse'
|
57
56
|
autoload :Pony, 'pwn/plugins/pony'
|
@@ -77,6 +76,7 @@ module PWN
|
|
77
76
|
autoload :Voice, 'pwn/plugins/voice'
|
78
77
|
autoload :Vsphere, 'pwn/plugins/vsphere'
|
79
78
|
autoload :XXD, 'pwn/plugins/xxd'
|
79
|
+
autoload :Zaproxy, 'pwn/plugins/zaproxy'
|
80
80
|
|
81
81
|
# Display a List of Every PWN::Plugins Module
|
82
82
|
|
data/lib/pwn/version.rb
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe PWN::Plugins::
|
5
|
+
describe PWN::Plugins::Zaproxy do
|
6
6
|
it 'should display information for authors' do
|
7
|
-
authors_response = PWN::Plugins::
|
7
|
+
authors_response = PWN::Plugins::Zaproxy
|
8
8
|
expect(authors_response).to respond_to :authors
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'should display information for existing help method' do
|
12
|
-
help_response = PWN::Plugins::
|
12
|
+
help_response = PWN::Plugins::Zaproxy
|
13
13
|
expect(help_response).to respond_to :help
|
14
14
|
end
|
15
15
|
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.5.
|
4
|
+
version: 0.5.400
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
@@ -1308,7 +1308,6 @@ executables:
|
|
1308
1308
|
- pwn_nexpose
|
1309
1309
|
- pwn_nmap_discover_tcp_udp
|
1310
1310
|
- pwn_openvas_vulnscan
|
1311
|
-
- pwn_owasp_zap_active_scan
|
1312
1311
|
- pwn_pastebin_sample_filter
|
1313
1312
|
- pwn_phone
|
1314
1313
|
- pwn_rdoc_to_jsonl
|
@@ -1324,6 +1323,8 @@ executables:
|
|
1324
1323
|
- pwn_www_checkip
|
1325
1324
|
- pwn_www_uri_buster
|
1326
1325
|
- pwn_xss_dom_vectors
|
1326
|
+
- pwn_zaproxy_active_rest_api_scan
|
1327
|
+
- pwn_zaproxy_active_scan
|
1327
1328
|
extensions: []
|
1328
1329
|
extra_rdoc_files: []
|
1329
1330
|
files:
|
@@ -1378,7 +1379,6 @@ files:
|
|
1378
1379
|
- bin/pwn_nexpose
|
1379
1380
|
- bin/pwn_nmap_discover_tcp_udp
|
1380
1381
|
- bin/pwn_openvas_vulnscan
|
1381
|
-
- bin/pwn_owasp_zap_active_scan
|
1382
1382
|
- bin/pwn_pastebin_sample_filter
|
1383
1383
|
- bin/pwn_phone
|
1384
1384
|
- bin/pwn_rdoc_to_jsonl
|
@@ -1394,6 +1394,8 @@ files:
|
|
1394
1394
|
- bin/pwn_www_checkip
|
1395
1395
|
- bin/pwn_www_uri_buster
|
1396
1396
|
- bin/pwn_xss_dom_vectors
|
1397
|
+
- bin/pwn_zaproxy_active_rest_api_scan
|
1398
|
+
- bin/pwn_zaproxy_active_scan
|
1397
1399
|
- build_pwn_gem.sh
|
1398
1400
|
- documentation/PWN.png
|
1399
1401
|
- documentation/PWN_Contributors_and_Users.png
|
@@ -1873,7 +1875,6 @@ files:
|
|
1873
1875
|
- lib/pwn/plugins/ocr.rb
|
1874
1876
|
- lib/pwn/plugins/open_api.rb
|
1875
1877
|
- lib/pwn/plugins/openvas.rb
|
1876
|
-
- lib/pwn/plugins/owasp_zap.rb
|
1877
1878
|
- lib/pwn/plugins/packet.rb
|
1878
1879
|
- lib/pwn/plugins/pdf_parse.rb
|
1879
1880
|
- lib/pwn/plugins/pony.rb
|
@@ -1900,6 +1901,7 @@ files:
|
|
1900
1901
|
- lib/pwn/plugins/voice.rb
|
1901
1902
|
- lib/pwn/plugins/vsphere.rb
|
1902
1903
|
- lib/pwn/plugins/xxd.rb
|
1904
|
+
- lib/pwn/plugins/zaproxy.rb
|
1903
1905
|
- lib/pwn/reports.rb
|
1904
1906
|
- lib/pwn/reports/fuzz.rb
|
1905
1907
|
- lib/pwn/reports/html_footer.rb
|
@@ -2217,7 +2219,6 @@ files:
|
|
2217
2219
|
- spec/lib/pwn/plugins/ocr_spec.rb
|
2218
2220
|
- spec/lib/pwn/plugins/open_api_spec.rb
|
2219
2221
|
- spec/lib/pwn/plugins/openvas_spec.rb
|
2220
|
-
- spec/lib/pwn/plugins/owasp_zap_spec.rb
|
2221
2222
|
- spec/lib/pwn/plugins/packet_spec.rb
|
2222
2223
|
- spec/lib/pwn/plugins/pdf_parse_spec.rb
|
2223
2224
|
- spec/lib/pwn/plugins/pony_spec.rb
|
@@ -2244,6 +2245,7 @@ files:
|
|
2244
2245
|
- spec/lib/pwn/plugins/voice_spec.rb
|
2245
2246
|
- spec/lib/pwn/plugins/vsphere_spec.rb
|
2246
2247
|
- spec/lib/pwn/plugins/xxd_spec.rb
|
2248
|
+
- spec/lib/pwn/plugins/zaproxy_spec.rb
|
2247
2249
|
- spec/lib/pwn/plugins_spec.rb
|
2248
2250
|
- spec/lib/pwn/reports/fuzz_spec.rb
|
2249
2251
|
- spec/lib/pwn/reports/html_footer_spec.rb
|