Skip to content

Commit d59b6d9

Browse files
committed
Make the debug output more readable
1 parent a8d9a5c commit d59b6d9

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

lib/msf/core/exploit/http/client.rb

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,23 @@ def send_request_raw(opts={}, timeout = 20)
325325
begin
326326
c = connect(opts)
327327
r = c.request_raw(opts)
328-
print_line(r.to_s) if datastore['HttpTrace']
328+
329+
if datastore['HttpTrace']
330+
print_line('#' * 20)
331+
print_line('# Request:')
332+
print_line('#' * 20)
333+
print_line(r.to_s)
334+
end
335+
329336
res = c.send_recv(r, actual_timeout)
330-
print_line(res.to_s) if datastore['HttpTrace']
337+
338+
if datastore['HttpTrace']
339+
print_line('#' * 20)
340+
print_line('# Response:')
341+
print_line('#' * 20)
342+
print_line(res.to_s)
343+
end
344+
331345
res
332346
rescue ::Errno::EPIPE, ::Timeout::Error => e
333347
print_line(e.message) if datastore['HttpTrace']
@@ -351,12 +365,28 @@ def send_request_cgi(opts={}, timeout = 20)
351365
actual_timeout = opts[:timeout] || timeout
352366
end
353367

368+
print_line("*" * 20) if datastore['HttpTrace']
369+
354370
begin
355371
c = connect(opts)
356372
r = c.request_cgi(opts)
357-
print_line(r.to_s) if datastore['HttpTrace']
373+
374+
if datastore['HttpTrace']
375+
print_line('#' * 20)
376+
print_line('# Request:')
377+
print_line('#' * 20)
378+
print_line(r.to_s)
379+
end
380+
358381
res = c.send_recv(r, actual_timeout)
359-
print_line(res.to_s) if datastore['HttpTrace']
382+
383+
if datastore['HttpTrace']
384+
print_line('#' * 20)
385+
print_line('# Response:')
386+
print_line('#' * 20)
387+
print_line(res.to_s)
388+
end
389+
360390
res
361391
rescue ::Errno::EPIPE, ::Timeout::Error => e
362392
print_line(e.message) if datastore['HttpTrace']

0 commit comments

Comments
 (0)