pwn 0.5.328 → 0.5.330
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/Gemfile +3 -3
- data/README.md +3 -3
- data/lib/pwn/plugins/burp_suite.rb +221 -61
- data/lib/pwn/version.rb +1 -1
- data/third_party/pwn_rdoc.jsonl +2 -1
- metadata +7 -8
- data/third_party/pwn_burp_rest_api.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2402a13b3e2cd7cbbdd21760049fce61980dc14871236a6345d51c50dae439b
|
4
|
+
data.tar.gz: e31a43da568d89bea803c9de5985edd089f7fea80db82fd9fa871fcfb524fe73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3e8e3aa9d1b1717768a20531f4e63044587fec15c9952fc406f4a8fd0992432899d3ef77420bbed3f82970da5197916b970bdf5c89fb39489afdd73b5ade671
|
7
|
+
data.tar.gz: f86b6c3356a6f1140ece443001b323062d11cbc2e2e1d2cac544a4a921fe2691ab022d7123aa3c36ad06ec089b7db9e1ab3ca2c72964e10f16e39ff6734d94dc
|
data/Gemfile
CHANGED
@@ -35,13 +35,13 @@ gem 'gdb', '1.0.0'
|
|
35
35
|
gem 'gem-wrappers', '1.4.0'
|
36
36
|
gem 'geocoder', '1.8.5'
|
37
37
|
gem 'gist', '6.0.0'
|
38
|
-
gem 'gruff', '0.
|
38
|
+
gem 'gruff', '0.29.0'
|
39
39
|
# gem 'hidapi', '0.1.9'
|
40
40
|
gem 'htmlentities', '4.3.4'
|
41
41
|
gem 'ipaddress', '0.8.3'
|
42
42
|
gem 'jenkins_api_client2', '1.9.0'
|
43
43
|
gem 'js-beautify', '0.1.8'
|
44
|
-
gem 'json', '2.13.
|
44
|
+
gem 'json', '2.13.1'
|
45
45
|
gem 'jsonpath', '1.1.5'
|
46
46
|
gem 'jwt', '3.1.2'
|
47
47
|
gem 'libusb', '0.7.2'
|
@@ -81,7 +81,7 @@ gem 'rmagick', '6.1.2'
|
|
81
81
|
gem 'rqrcode', '3.1.0'
|
82
82
|
gem 'rspec', '3.13.1'
|
83
83
|
gem 'rtesseract', '3.1.4'
|
84
|
-
gem 'rubocop', '1.
|
84
|
+
gem 'rubocop', '1.79.0'
|
85
85
|
gem 'rubocop-rake', '0.7.1'
|
86
86
|
gem 'rubocop-rspec', '3.6.0'
|
87
87
|
gem 'ruby-audio', '1.6.1'
|
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.5.
|
40
|
+
pwn[v0.5.330]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.4.4@pwn
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
53
53
|
$ gem install --verbose pwn
|
54
54
|
$ pwn
|
55
|
-
pwn[v0.5.
|
55
|
+
pwn[v0.5.330]: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.4.4@pwn
|
|
62
62
|
$ rvmsudo gem uninstall --all --executables pwn
|
63
63
|
$ rvmsudo gem install --verbose pwn
|
64
64
|
$ pwn
|
65
|
-
pwn[v0.5.
|
65
|
+
pwn[v0.5.330]: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:
|
@@ -31,24 +31,27 @@ module PWN
|
|
31
31
|
443
|
32
32
|
]
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
34
|
+
uri = "#{scheme}://#{host}:#{port}#{path}"
|
35
|
+
uri = "#{scheme}://#{host}#{path}" if implicit_http_ports_arr.include?(port)
|
36
|
+
|
37
|
+
uri
|
39
38
|
rescue StandardError => e
|
40
39
|
raise e
|
41
40
|
end
|
42
41
|
|
43
42
|
# Supported Method Parameters::
|
44
43
|
# burp_obj = PWN::Plugins::BurpSuite.start(
|
45
|
-
# burp_jar_path: '
|
44
|
+
# burp_jar_path: 'optional - path of burp suite pro jar file (defaults to /opt/burpsuite/burpsuite_pro.jar)',
|
46
45
|
# headless: 'optional - run burp headless if set to true',
|
47
|
-
# browser_type: 'optional - defaults to :firefox. See PWN::Plugins::TransparentBrowser.help for a list of types'
|
46
|
+
# browser_type: 'optional - defaults to :firefox. See PWN::Plugins::TransparentBrowser.help for a list of types',
|
47
|
+
# burp_ip: 'optional - IP address for the Burp proxy (defaults to 127.0.0.1)',
|
48
|
+
# burp_port: 'optional - port for the Burp proxy (defaults to a random unused port)',
|
49
|
+
# pwn_burp_ip: 'optional - IP address for the PWN Burp API (defaults to 127.0.0.1)',
|
50
|
+
# pwn_burp_port: 'optional - port for the PWN Burp API (defaults to a random unused port)'
|
48
51
|
# )
|
49
52
|
|
50
53
|
public_class_method def self.start(opts = {})
|
51
|
-
burp_jar_path = opts[:burp_jar_path] ||= '/opt/burpsuite/
|
54
|
+
burp_jar_path = opts[:burp_jar_path] ||= '/opt/burpsuite/burpsuite-pro.jar'
|
52
55
|
raise 'Invalid path to burp jar file. Please check your spelling and try again.' unless File.exist?(burp_jar_path)
|
53
56
|
|
54
57
|
burp_root = File.dirname(burp_jar_path)
|
@@ -59,9 +62,20 @@ module PWN
|
|
59
62
|
opts[:browser_type]
|
60
63
|
end
|
61
64
|
|
62
|
-
|
63
|
-
|
64
|
-
#
|
65
|
+
burp_ip = opts[:burp_ip] ||= '127.0.0.1'
|
66
|
+
burp_port = opts[:burp_port] ||= 8080
|
67
|
+
# burp_port = opts[:burp_port] ||= PWN::Plugins::Sock.get_random_unused_port
|
68
|
+
#
|
69
|
+
pwn_burp_ip = opts[:pwn_burp_ip] ||= '127.0.0.1'
|
70
|
+
pwn_burp_port = opts[:pwn_burp_port] ||= 1337
|
71
|
+
# pwn_burp_port = opts[:pwn_burp_port] ||= PWN::Plugins::Sock.get_random_unused_port
|
72
|
+
|
73
|
+
burp_cmd_string = 'java -Xmx4G'
|
74
|
+
# burp_cmd_string = "#{burp_cmd_string} -Dhttp.proxyHost=#{burp_ip} -Dhttp.proxyPort=#{burp_port}"
|
75
|
+
# burp_cmd_string = "#{burp_cmd_string} -Dhttps.proxyHost=#{burp_ip} -Dhttps.proxyPort=#{burp_port}"
|
76
|
+
burp_cmd_string = "#{burp_cmd_string} -Djava.awt.headless=true" if opts[:headless]
|
77
|
+
burp_cmd_string = "#{burp_cmd_string} -Dserver.address=#{pwn_burp_ip} -Dserver.port=#{pwn_burp_port}"
|
78
|
+
burp_cmd_string = "#{burp_cmd_string} -jar #{burp_jar_path}"
|
65
79
|
|
66
80
|
# Construct burp_obj
|
67
81
|
burp_obj = {}
|
@@ -69,12 +83,8 @@ module PWN
|
|
69
83
|
browser_obj1 = PWN::Plugins::TransparentBrowser.open(browser_type: :rest)
|
70
84
|
rest_browser = browser_obj1[:browser]
|
71
85
|
|
72
|
-
|
73
|
-
|
74
|
-
# random_bb_port = PWN::Plugins::Sock.get_random_unused_port
|
75
|
-
random_bb_port = 8001
|
76
|
-
burp_obj[:mitm_proxy] = "127.0.0.1:#{random_mitm_port}"
|
77
|
-
burp_obj[:burpbuddy_api] = "127.0.0.1:#{random_bb_port}"
|
86
|
+
burp_obj[:mitm_proxy] = "#{burp_ip}:#{burp_port}"
|
87
|
+
burp_obj[:pwn_burp_api] = "#{pwn_burp_ip}:#{pwn_burp_port}"
|
78
88
|
burp_obj[:rest_browser] = rest_browser
|
79
89
|
|
80
90
|
# Proxy always listens on localhost...use SSH tunneling if remote access is required
|
@@ -85,9 +95,9 @@ module PWN
|
|
85
95
|
|
86
96
|
burp_obj[:burp_browser] = browser_obj2
|
87
97
|
|
88
|
-
# Wait for
|
98
|
+
# Wait for pwn_burp_port to open prior to returning burp_obj
|
89
99
|
loop do
|
90
|
-
s = TCPSocket.new(
|
100
|
+
s = TCPSocket.new(pwn_burp_ip, pwn_burp_port)
|
91
101
|
s.close
|
92
102
|
break
|
93
103
|
rescue Errno::ECONNREFUSED
|
@@ -96,6 +106,15 @@ module PWN
|
|
96
106
|
next
|
97
107
|
end
|
98
108
|
|
109
|
+
# USE THIS WHEN Updating Proxy Listener settings become
|
110
|
+
# available in the BurpSuite Montoya API
|
111
|
+
# Update proxy listener to use the burp_ip and burp_port
|
112
|
+
# update_proxy_listener(
|
113
|
+
# burp_obj: burp_obj,
|
114
|
+
# address: burp_ip,
|
115
|
+
# port: burp_port
|
116
|
+
# )
|
117
|
+
|
99
118
|
burp_obj
|
100
119
|
rescue StandardError => e
|
101
120
|
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
@@ -149,9 +168,9 @@ module PWN
|
|
149
168
|
public_class_method def self.enable_proxy(opts = {})
|
150
169
|
burp_obj = opts[:burp_obj]
|
151
170
|
rest_browser = burp_obj[:rest_browser]
|
152
|
-
|
171
|
+
pwn_burp_api = burp_obj[:pwn_burp_api]
|
153
172
|
|
154
|
-
enable_resp = rest_browser.post("http://#{
|
173
|
+
enable_resp = rest_browser.post("http://#{pwn_burp_api}/proxy/intercept/enable", nil)
|
155
174
|
rescue StandardError => e
|
156
175
|
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
157
176
|
raise e
|
@@ -165,9 +184,9 @@ module PWN
|
|
165
184
|
public_class_method def self.disable_proxy(opts = {})
|
166
185
|
burp_obj = opts[:burp_obj]
|
167
186
|
rest_browser = burp_obj[:rest_browser]
|
168
|
-
|
187
|
+
pwn_burp_api = burp_obj[:pwn_burp_api]
|
169
188
|
|
170
|
-
disable_resp = rest_browser.post("http://#{
|
189
|
+
disable_resp = rest_browser.post("http://#{pwn_burp_api}/proxy/intercept/disable", nil)
|
171
190
|
rescue StandardError => e
|
172
191
|
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
173
192
|
raise e
|
@@ -181,10 +200,21 @@ module PWN
|
|
181
200
|
public_class_method def self.get_current_sitemap(opts = {})
|
182
201
|
burp_obj = opts[:burp_obj]
|
183
202
|
rest_browser = burp_obj[:rest_browser]
|
184
|
-
|
185
|
-
|
186
|
-
sitemap = rest_browser.get("http://#{
|
187
|
-
JSON.parse(sitemap)
|
203
|
+
pwn_burp_api = burp_obj[:pwn_burp_api]
|
204
|
+
|
205
|
+
sitemap = rest_browser.get("http://#{pwn_burp_api}/sitemap", content_type: 'application/json; charset=UTF8')
|
206
|
+
# json_sitemap = JSON.parse(sitemap, symbolize_names: true)
|
207
|
+
# json_sitemap is an array of hashes.
|
208
|
+
# each hash contains a :request and :response key.
|
209
|
+
# both of these values are Base64 encoded strings.
|
210
|
+
# We want to decode them in an array of hashes.
|
211
|
+
# json_sitemap.map do |site|
|
212
|
+
# site[:request] = Base64.decode64(site[:request]) if site[:request]
|
213
|
+
# site[:response] = Base64.decode64(site[:response]) if site[:response]
|
214
|
+
# end
|
215
|
+
|
216
|
+
# json_sitemap
|
217
|
+
JSON.parse(sitemap, symbolize_names: true)
|
188
218
|
rescue StandardError => e
|
189
219
|
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
190
220
|
raise e
|
@@ -200,11 +230,11 @@ module PWN
|
|
200
230
|
burp_obj = opts[:burp_obj]
|
201
231
|
target_url = opts[:target_url]
|
202
232
|
rest_browser = burp_obj[:rest_browser]
|
203
|
-
|
233
|
+
pwn_burp_api = burp_obj[:pwn_burp_api]
|
204
234
|
|
205
235
|
post_body = { url: target_url }.to_json
|
206
236
|
|
207
|
-
in_scope = rest_browser.post("http://#{
|
237
|
+
in_scope = rest_browser.post("http://#{pwn_burp_api}/scope", post_body, content_type: 'application/json; charset=UTF8')
|
208
238
|
JSON.parse(in_scope)
|
209
239
|
rescue StandardError => e
|
210
240
|
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
@@ -220,26 +250,27 @@ module PWN
|
|
220
250
|
public_class_method def self.invoke_active_scan(opts = {})
|
221
251
|
burp_obj = opts[:burp_obj]
|
222
252
|
rest_browser = burp_obj[:rest_browser]
|
223
|
-
|
253
|
+
pwn_burp_api = burp_obj[:pwn_burp_api]
|
224
254
|
target_url = opts[:target_url].to_s.scrub.strip.chomp
|
225
255
|
target_scheme = URI.parse(target_url).scheme
|
226
256
|
target_host = URI.parse(target_url).host
|
227
257
|
target_port = URI.parse(target_url).port.to_i
|
228
|
-
if target_scheme == 'http'
|
229
|
-
|
230
|
-
else
|
231
|
-
|
232
|
-
end
|
258
|
+
# if target_scheme == 'http'
|
259
|
+
# use_https = false
|
260
|
+
# else
|
261
|
+
# use_https = true
|
262
|
+
# end
|
233
263
|
|
234
264
|
active_scan_url_arr = []
|
235
265
|
json_sitemap = get_current_sitemap(burp_obj: burp_obj)
|
236
266
|
json_sitemap.each do |site|
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
267
|
+
json_req = site[:request]
|
268
|
+
json_path = json_req[:path]
|
269
|
+
b64_encoded_req = json_req[:raw]
|
270
|
+
json_http_svc = site[:http_service]
|
271
|
+
json_protocol = json_http_svc[:protocol]
|
272
|
+
json_host = json_http_svc[:host].to_s.scrub.strip.chomp
|
273
|
+
json_port = json_http_svc[:port].to_i
|
243
274
|
|
244
275
|
json_uri = format_uri_from_sitemap_resp(
|
245
276
|
scheme: json_protocol,
|
@@ -248,30 +279,32 @@ module PWN
|
|
248
279
|
path: json_path
|
249
280
|
)
|
250
281
|
|
282
|
+
# TODO: check if the URI is in scope
|
283
|
+
# next unless uri_in_scope(...)
|
251
284
|
next unless json_host == target_host && json_port == target_port
|
252
285
|
|
253
|
-
|
254
|
-
|
286
|
+
use_https = true if json_protocol == 'https'
|
287
|
+
|
255
288
|
puts "Adding #{json_uri} to Active Scan"
|
256
289
|
active_scan_url_arr.push(json_uri)
|
257
290
|
post_body = {
|
258
291
|
host: json_host,
|
259
292
|
port: json_port,
|
260
293
|
use_https: use_https,
|
261
|
-
request:
|
294
|
+
request: b64_encoded_req
|
262
295
|
}.to_json
|
263
296
|
# Kick off an active scan for each given page in the json_sitemap results
|
264
|
-
rest_browser.post("http://#{
|
297
|
+
rest_browser.post("http://#{pwn_burp_api}/scan/active", post_body, content_type: 'application/json')
|
265
298
|
end
|
266
299
|
|
267
300
|
# Wait for scan completion
|
268
|
-
scan_queue = rest_browser.get("http://#{
|
301
|
+
scan_queue = rest_browser.get("http://#{pwn_burp_api}/scan/active")
|
269
302
|
json_scan_queue = JSON.parse(scan_queue)
|
270
303
|
scan_queue_total = json_scan_queue.count
|
271
304
|
json_scan_queue.each do |scan_item|
|
272
305
|
this_scan_item_id = scan_item['id']
|
273
306
|
until scan_item['status'] == 'finished'
|
274
|
-
scan_item_resp = rest_browser.get("http://#{
|
307
|
+
scan_item_resp = rest_browser.get("http://#{pwn_burp_api}/scan/active/#{this_scan_item_id}")
|
275
308
|
scan_item = JSON.parse(scan_item_resp)
|
276
309
|
scan_status = scan_item['status']
|
277
310
|
puts "Target ID ##{this_scan_item_id} of ##{scan_queue_total}| #{scan_status}"
|
@@ -294,9 +327,9 @@ module PWN
|
|
294
327
|
public_class_method def self.get_scan_issues(opts = {})
|
295
328
|
burp_obj = opts[:burp_obj]
|
296
329
|
rest_browser = burp_obj[:rest_browser]
|
297
|
-
|
330
|
+
pwn_burp_api = burp_obj[:pwn_burp_api]
|
298
331
|
|
299
|
-
scan_issues = rest_browser.get("http://#{
|
332
|
+
scan_issues = rest_browser.get("http://#{pwn_burp_api}/scanissues")
|
300
333
|
JSON.parse(scan_issues)
|
301
334
|
rescue StandardError => e
|
302
335
|
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
@@ -315,9 +348,9 @@ module PWN
|
|
315
348
|
burp_obj = opts[:burp_obj]
|
316
349
|
target_url = opts[:target_url]
|
317
350
|
rest_browser = burp_obj[:rest_browser]
|
318
|
-
|
351
|
+
pwn_burp_api = burp_obj[:pwn_burp_api]
|
319
352
|
report_type = opts[:report_type]
|
320
|
-
# When
|
353
|
+
# When pwn_burp begins to support XML report generation
|
321
354
|
valid_report_types_arr = %i[
|
322
355
|
html
|
323
356
|
xml
|
@@ -330,27 +363,130 @@ module PWN
|
|
330
363
|
scheme = URI.parse(target_url).scheme
|
331
364
|
host = URI.parse(target_url).host
|
332
365
|
port = URI.parse(target_url).port
|
366
|
+
path = URI.parse(target_url).path
|
333
367
|
|
334
368
|
target_domain = format_uri_from_sitemap_resp(
|
335
369
|
scheme: scheme,
|
336
370
|
host: host,
|
337
|
-
port: port
|
371
|
+
port: port,
|
372
|
+
path: path
|
338
373
|
)
|
339
374
|
|
375
|
+
puts "Generating #{report_type} report for #{target_domain}..."
|
340
376
|
report_url = Base64.strict_encode64(target_domain)
|
341
|
-
# Ready scanreport API call in
|
342
|
-
# This is for the older burpbuddy-3.1.1-SNAPSHOT-all.jar
|
377
|
+
# Ready scanreport API call in pwn_burp to support HTML & XML report generation
|
343
378
|
report_resp = rest_browser.get(
|
344
|
-
"http://#{
|
379
|
+
"http://#{pwn_burp_api}/scanreport/#{report_type.to_s.upcase}/#{report_url}"
|
345
380
|
)
|
346
381
|
|
347
|
-
# This is for the older burpbuddy-3.1.0-SNAPSHOT-all.jar
|
348
|
-
# report_resp = rest_browser.get(
|
349
|
-
# "http://#{burpbuddy_api}/scanreport/#{report_url}"
|
350
|
-
# )
|
351
382
|
File.open(output_path, 'w') do |f|
|
352
383
|
f.puts(report_resp.body.gsub("\r\n", "\n"))
|
353
384
|
end
|
385
|
+
rescue RestClient::BadRequest => e
|
386
|
+
puts e.response
|
387
|
+
rescue StandardError => e
|
388
|
+
# stop(burp_obj: burp_obj) unless burp_obj.nil?
|
389
|
+
raise e
|
390
|
+
end
|
391
|
+
|
392
|
+
# Supported Method Parameters::
|
393
|
+
# json_proxy_listeners = PWN::Plugins::BurpSuite.get_proxy_listeners(
|
394
|
+
# burp_obj: 'required - burp_obj returned by #start method'
|
395
|
+
# )
|
396
|
+
|
397
|
+
public_class_method def self.get_proxy_listeners(opts = {})
|
398
|
+
burp_obj = opts[:burp_obj]
|
399
|
+
rest_browser = burp_obj[:rest_browser]
|
400
|
+
pwn_burp_api = burp_obj[:pwn_burp_api]
|
401
|
+
|
402
|
+
listeners = rest_browser.get("http://#{pwn_burp_api}/proxy/listeners", content_type: 'application/json; charset=UTF8')
|
403
|
+
JSON.parse(listeners, symbolize_names: true)
|
404
|
+
rescue StandardError => e
|
405
|
+
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
406
|
+
raise e
|
407
|
+
end
|
408
|
+
|
409
|
+
# Supported Method Parameters::
|
410
|
+
# json_proxy_listener = PWN::Plugins::BurpSuite.add_proxy_listener(
|
411
|
+
# burp_obj: 'required - burp_obj returned by #start method',
|
412
|
+
# bind_address: 'required - bind address for the proxy listener (e.g., "127.0.0.1")',
|
413
|
+
# port: 'required - port for the proxy listener (e.g., 8081)',
|
414
|
+
# enabled: 'optional - enable the listener (defaults to true)'
|
415
|
+
# )
|
416
|
+
|
417
|
+
public_class_method def self.add_proxy_listener(opts = {})
|
418
|
+
burp_obj = opts[:burp_obj]
|
419
|
+
rest_browser = burp_obj[:rest_browser]
|
420
|
+
pwn_burp_api = burp_obj[:pwn_burp_api]
|
421
|
+
bind_address = opts[:bind_address]
|
422
|
+
raise 'ERROR: bind_address parameter is required' if bind_address.nil?
|
423
|
+
|
424
|
+
port = opts[:port]
|
425
|
+
raise 'ERROR: port parameter is required' if port.nil?
|
426
|
+
|
427
|
+
enabled = opts[:enabled] != false # Default to true if not specified
|
428
|
+
|
429
|
+
post_body = {
|
430
|
+
id: "#{bind_address}:#{port}",
|
431
|
+
bind_address: bind_address,
|
432
|
+
port: port,
|
433
|
+
enabled: enabled
|
434
|
+
}.to_json
|
435
|
+
|
436
|
+
listener = rest_browser.post("http://#{pwn_burp_api}/proxy/listeners", post_body, content_type: 'application/json; charset=UTF8')
|
437
|
+
JSON.parse(listener, symbolize_names: true)
|
438
|
+
rescue StandardError => e
|
439
|
+
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
440
|
+
raise e
|
441
|
+
end
|
442
|
+
|
443
|
+
# Supported Method Parameters::
|
444
|
+
# json_proxy_listener = PWN::Plugins::BurpSuite.update_proxy_listener(
|
445
|
+
# burp_obj: 'required - burp_obj returned by #start method',
|
446
|
+
# id: 'optional - ID of the proxy listener (defaults to "127.0.0.1:8080")',
|
447
|
+
# bind_address: 'optional - bind address for the proxy listener (defaults to "127.0.0.1")',
|
448
|
+
# port: 'optional - port for the proxy listener (defaults to 8080)',
|
449
|
+
# enabled: 'optional - enable or disable the listener (defaults to true)'
|
450
|
+
# )
|
451
|
+
|
452
|
+
public_class_method def self.update_proxy_listener(opts = {})
|
453
|
+
burp_obj = opts[:burp_obj]
|
454
|
+
rest_browser = burp_obj[:rest_browser]
|
455
|
+
pwn_burp_api = burp_obj[:pwn_burp_api]
|
456
|
+
id = opts[:id] ||= '127.0.0.1:8080'
|
457
|
+
bind_address = opts[:bind_address] ||= '127.0.0.1'
|
458
|
+
port = opts[:port] ||= 8080
|
459
|
+
enabled = opts[:enabled] != false # Default to true if not specified
|
460
|
+
|
461
|
+
post_body = {
|
462
|
+
id: id,
|
463
|
+
bind_address: bind_address,
|
464
|
+
port: port,
|
465
|
+
enabled: enabled
|
466
|
+
}.to_json
|
467
|
+
|
468
|
+
listener = rest_browser.put("http://#{pwn_burp_api}/proxy/listeners/#{id}", post_body, content_type: 'application/json; charset=UTF8')
|
469
|
+
JSON.parse(listener, symbolize_names: true)
|
470
|
+
rescue StandardError => e
|
471
|
+
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
472
|
+
raise e
|
473
|
+
end
|
474
|
+
|
475
|
+
# Supported Method Parameters::
|
476
|
+
# PWN::Plugins::BurpSuite.delete_proxy_listener(
|
477
|
+
# burp_obj: 'required - burp_obj returned by #start method',
|
478
|
+
# id: 'required - ID of the proxy listener (e.g., "127.0.0.1:8080")'
|
479
|
+
# )
|
480
|
+
|
481
|
+
public_class_method def self.delete_proxy_listener(opts = {})
|
482
|
+
burp_obj = opts[:burp_obj]
|
483
|
+
rest_browser = burp_obj[:rest_browser]
|
484
|
+
pwn_burp_api = burp_obj[:pwn_burp_api]
|
485
|
+
id = opts[:id]
|
486
|
+
raise 'ERROR: id parameter is required' if id.nil?
|
487
|
+
|
488
|
+
rest_browser.delete("http://#{pwn_burp_api}/proxy/listeners/#{id}")
|
489
|
+
true # Return true to indicate successful deletion (or error if API fails)
|
354
490
|
rescue StandardError => e
|
355
491
|
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
356
492
|
raise e
|
@@ -395,7 +531,7 @@ module PWN
|
|
395
531
|
public_class_method def self.help
|
396
532
|
puts "USAGE:
|
397
533
|
burp_obj = #{self}.start(
|
398
|
-
burp_jar_path: '
|
534
|
+
burp_jar_path: 'optional - path of burp suite pro jar file (defaults to /opt/burpsuite/burpsuite_pro.jar)',
|
399
535
|
headless: 'optional - run headless if set to true',
|
400
536
|
browser_type: 'optional - defaults to :firefox. See PWN::Plugins::TransparentBrowser.help for a list of types'
|
401
537
|
)
|
@@ -417,6 +553,30 @@ module PWN
|
|
417
553
|
burp_obj: 'required - burp_obj returned by #start method'
|
418
554
|
)
|
419
555
|
|
556
|
+
json_proxy_listeners = #{self}.get_proxy_listeners(
|
557
|
+
burp_obj: 'required - burp_obj returned by #start method'
|
558
|
+
)
|
559
|
+
|
560
|
+
json_proxy_listener = #{self}.add_proxy_listener(
|
561
|
+
burp_obj: 'required - burp_obj returned by #start method',
|
562
|
+
bind_address: 'required - bind address for the proxy listener (e.g., \"127.0.0.1\")',
|
563
|
+
port: 'required - port for the proxy listener (e.g., 8081)',
|
564
|
+
enabled: 'optional - enable the listener (defaults to true)'
|
565
|
+
)
|
566
|
+
|
567
|
+
json_proxy_listener = #{self}.update_proxy_listener(
|
568
|
+
burp_obj: 'required - burp_obj returned by #start method',
|
569
|
+
id: 'required - ID of the proxy listener (e.g., \"127.0.0.1:8080\")',
|
570
|
+
bind_address: 'required - new bind address for the proxy listener',
|
571
|
+
port: 'required - new port for the proxy listener',
|
572
|
+
enabled: 'optional - enable or disable the listener (defaults to true)'
|
573
|
+
)
|
574
|
+
|
575
|
+
#{self}.delete_proxy_listener(
|
576
|
+
burp_obj: 'required - burp_obj returned by #start method',
|
577
|
+
id: 'required - ID of the proxy listener (e.g., \"127.0.0.1:8080\")'
|
578
|
+
)
|
579
|
+
|
420
580
|
active_scan_url_arr = #{self}.invoke_active_scan(
|
421
581
|
burp_obj: 'required - burp_obj returned by #start method',
|
422
582
|
target_url: 'required - target url to scan in sitemap (should be loaded & authenticated w/ burp_obj[:burp_browser])'
|
@@ -428,7 +588,7 @@ module PWN
|
|
428
588
|
|
429
589
|
#{self}.generate_scan_report(
|
430
590
|
burp_obj: 'required - burp_obj returned by #start method',
|
431
|
-
|
591
|
+
target_url: 'required - target_url passed to #invoke_active_scan method',
|
432
592
|
report_type: :html|:xml,
|
433
593
|
output_path: 'required - path to save report results'
|
434
594
|
)
|
data/lib/pwn/version.rb
CHANGED
data/third_party/pwn_rdoc.jsonl
CHANGED
@@ -502,7 +502,7 @@
|
|
502
502
|
{"messages":[{"role":"user","content":"PWN::Plugins::BurpSuite.get_scan_issues Usage"},{"role":"assistant","content":"`PWN::Plugins::BurpSuite.get_scan_issues`: Supported Method Parameters\n\njson_scan_issues = PWN::Plugins::BurpSuite.get_scan_issues(\n\nburp_obj: 'required - burp_obj returned by #start method'\n\n)\n"}]}
|
503
503
|
{"messages":[{"role":"user","content":"PWN::Plugins::BurpSuite.help Usage"},{"role":"assistant","content":"`PWN::Plugins::BurpSuite.help`: "}]}
|
504
504
|
{"messages":[{"role":"user","content":"PWN::Plugins::BurpSuite.invoke_active_scan Usage"},{"role":"assistant","content":"`PWN::Plugins::BurpSuite.invoke_active_scan`: Supported Method Parameters\n\nactive_scan_url_arr = PWN::Plugins::BurpSuite.invoke_active_scan(\n\nburp_obj: 'required - burp_obj returned by #start method',\ntarget_url: 'required - target url to scan in sitemap (should be loaded & authenticated w/ burp_obj[:burp_browser])'\n\n)\n"}]}
|
505
|
-
{"messages":[{"role":"user","content":"PWN::Plugins::BurpSuite.start Usage"},{"role":"assistant","content":"`PWN::Plugins::BurpSuite.start`: Supported Method Parameters\n\nburp_obj = PWN::Plugins::BurpSuite.start(\n\nburp_jar_path: 'options - path of burp suite pro jar file (defaults to /opt/burpsuite/burpsuite_pro.jar)',\nheadless: 'optional - run burp headless if set to true',\nbrowser_type: 'optional - defaults to :firefox. See PWN::Plugins::TransparentBrowser.help for a list of types'
|
505
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::BurpSuite.start Usage"},{"role":"assistant","content":"`PWN::Plugins::BurpSuite.start`: Supported Method Parameters\n\nburp_obj = PWN::Plugins::BurpSuite.start(\n\nburp_jar_path: 'options - path of burp suite pro jar file (defaults to /opt/burpsuite/burpsuite_pro.jar)',\nheadless: 'optional - run burp headless if set to true',\nbrowser_type: 'optional - defaults to :firefox. See PWN::Plugins::TransparentBrowser.help for a list of types'\n\n)\n"}]}
|
506
506
|
{"messages":[{"role":"user","content":"PWN::Plugins::BurpSuite.stop Usage"},{"role":"assistant","content":"`PWN::Plugins::BurpSuite.stop`: Supported Method Parameters\n\nPWN::Plugins::BurpSuite.stop(\n\nburp_obj: 'required - burp_obj returned by #start method'\n\n)\n"}]}
|
507
507
|
{"messages":[{"role":"user","content":"PWN::Plugins::BurpSuite.update_burp_jar Usage"},{"role":"assistant","content":"`PWN::Plugins::BurpSuite.update_burp_jar`: Supported Method Parameters\n\nPWN::Plugins::BurpSuite.update_burp_jar( )\n"}]}
|
508
508
|
{"messages":[{"role":"user","content":"PWN::Plugins::BurpSuite.uri_in_scope Usage"},{"role":"assistant","content":"`PWN::Plugins::BurpSuite.uri_in_scope`: Supported Method Parameters\n\nuri_in_scope_bool = PWN::Plugins::BurpSuite.uri_in_scope(\n\ntarget_config: 'required - path to burp suite pro target config JSON file',\nuri: 'required - URI to determine if in scope'\n\n)\n"}]}
|
@@ -800,6 +800,7 @@
|
|
800
800
|
{"messages":[{"role":"user","content":"PWN::Plugins::OwaspZap.breakpoint Usage"},{"role":"assistant","content":"`PWN::Plugins::OwaspZap.breakpoint`: Supported Method Parameters\n\nPWN::Plugins::OwaspZap.breakpoint(\n\nzap_obj: 'required - zap_obj returned from #open method',\nregex_type: 'required - :url, :request_header, :request_body, :response_header or :response_body',\nregex_pattern: 'required - regex pattern to search for respective regex_type',\nenabled: 'optional - boolean (defaults to true)'\n\n)\n"}]}
|
801
801
|
{"messages":[{"role":"user","content":"PWN::Plugins::OwaspZap.generate_report Usage"},{"role":"assistant","content":"`PWN::Plugins::OwaspZap.generate_report`: Supported Method Parameters\n\nreport_path = PWN::Plugins::OwaspZap.generate_report(\n\nzap_obj: 'required - zap_obj returned from #open method',\noutput_dir: 'required - directory to save report',\nreport_type: 'required - <html|markdown|xml>'\n\n)\n"}]}
|
802
802
|
{"messages":[{"role":"user","content":"PWN::Plugins::OwaspZap.help Usage"},{"role":"assistant","content":"`PWN::Plugins::OwaspZap.help`: "}]}
|
803
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::OwaspZap.import_openapi_spec_file Usage"},{"role":"assistant","content":"`PWN::Plugins::OwaspZap.import_openapi_spec_file`: Supported Method Parameters\n\nPWN::Plugins::OwaspZap.import_openapi_spec_file(\n\nzap_obj: 'required - zap_obj returned from #open method',\nspec: 'required - path to OpenAPI spec file (e.g. /path/to/openapi.yaml)',\ntarget: 'required - target URL to ovverride the service URL in the OpenAPI spec (e.g. https://fq.dn)',\ncontext_id: 'optional - ID of the ZAP context (Defaults to first context, if any)',\nuser_id: 'optional - ID of the ZAP user (Defaults to first user, if any)'\n\n)\n"}]}
|
803
804
|
{"messages":[{"role":"user","content":"PWN::Plugins::OwaspZap.request Usage"},{"role":"assistant","content":"`PWN::Plugins::OwaspZap.request`: Supported Method Parameters\n\nwatir_resp = PWN::Plugins::OwaspZap.request(\n\nzap_obj: 'required - zap_obj returned from #open method',\nbrowser_obj: 'required - browser_obj w/ browser_type: :firefox||:headless returned from #open method',\ninstruction: 'required - watir instruction to make (e.g. button(text: \"Google Search\").click)'\n\n)\n"}]}
|
804
805
|
{"messages":[{"role":"user","content":"PWN::Plugins::OwaspZap.spider Usage"},{"role":"assistant","content":"`PWN::Plugins::OwaspZap.spider`: Supported Method Parameters\n\nPWN::Plugins::OwaspZap.spider(\n\nzap_obj: 'required - zap_obj returned from #open method',\ntarget: 'required - url to spider'\n\n)\n"}]}
|
805
806
|
{"messages":[{"role":"user","content":"PWN::Plugins::OwaspZap.start Usage"},{"role":"assistant","content":"`PWN::Plugins::OwaspZap.start`: Supported Method Parameters\n\nzap_obj = PWN::Plugins::OwaspZap.start(\n\napi_key: 'required - api key for API authorization',\nzap_bin_path: 'optional - path to zap.sh file'\nheadless: 'optional - run zap headless if set to true',\nproxy: 'optional - change local zap proxy listener (defaults to http://127.0.0.1:<Random 1024-65535>)',\n\n)\n"}]}
|
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.330
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
@@ -337,14 +337,14 @@ dependencies:
|
|
337
337
|
requirements:
|
338
338
|
- - '='
|
339
339
|
- !ruby/object:Gem::Version
|
340
|
-
version: 0.
|
340
|
+
version: 0.29.0
|
341
341
|
type: :runtime
|
342
342
|
prerelease: false
|
343
343
|
version_requirements: !ruby/object:Gem::Requirement
|
344
344
|
requirements:
|
345
345
|
- - '='
|
346
346
|
- !ruby/object:Gem::Version
|
347
|
-
version: 0.
|
347
|
+
version: 0.29.0
|
348
348
|
- !ruby/object:Gem::Dependency
|
349
349
|
name: htmlentities
|
350
350
|
requirement: !ruby/object:Gem::Requirement
|
@@ -407,14 +407,14 @@ dependencies:
|
|
407
407
|
requirements:
|
408
408
|
- - '='
|
409
409
|
- !ruby/object:Gem::Version
|
410
|
-
version: 2.13.
|
410
|
+
version: 2.13.1
|
411
411
|
type: :runtime
|
412
412
|
prerelease: false
|
413
413
|
version_requirements: !ruby/object:Gem::Requirement
|
414
414
|
requirements:
|
415
415
|
- - '='
|
416
416
|
- !ruby/object:Gem::Version
|
417
|
-
version: 2.13.
|
417
|
+
version: 2.13.1
|
418
418
|
- !ruby/object:Gem::Dependency
|
419
419
|
name: jsonpath
|
420
420
|
requirement: !ruby/object:Gem::Requirement
|
@@ -925,14 +925,14 @@ dependencies:
|
|
925
925
|
requirements:
|
926
926
|
- - '='
|
927
927
|
- !ruby/object:Gem::Version
|
928
|
-
version: 1.
|
928
|
+
version: 1.79.0
|
929
929
|
type: :runtime
|
930
930
|
prerelease: false
|
931
931
|
version_requirements: !ruby/object:Gem::Requirement
|
932
932
|
requirements:
|
933
933
|
- - '='
|
934
934
|
- !ruby/object:Gem::Version
|
935
|
-
version: 1.
|
935
|
+
version: 1.79.0
|
936
936
|
- !ruby/object:Gem::Dependency
|
937
937
|
name: rubocop-rake
|
938
938
|
requirement: !ruby/object:Gem::Requirement
|
@@ -2299,7 +2299,6 @@ files:
|
|
2299
2299
|
- spec/spec_helper.rb
|
2300
2300
|
- third_party/.gitkeep
|
2301
2301
|
- third_party/http-request-headers-fields-large.txt
|
2302
|
-
- third_party/pwn_burp_rest_api.jar
|
2303
2302
|
- third_party/pwn_rdoc.jsonl
|
2304
2303
|
- third_party/r2-pwn-layout
|
2305
2304
|
- update_pwn.sh
|
Binary file
|