Class: PluginFormatters::CookieCollector

Inherits:
Arachni::Plugin::Formatter
  • Object
show all
Includes:
TemplateUtilities
Defined in:
components/reporters/plugin_formatters/stdout/cookie_collector.rb,
components/reporters/plugin_formatters/html/cookie_collector.rb,
components/reporters/plugin_formatters/xml/cookie_collector.rb

Overview

XML formatter for the results of the CookieCollector plugin

Author:

Instance Method Summary collapse

Instance Method Details

#run(xml) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'components/reporters/plugin_formatters/stdout/cookie_collector.rb', line 16

def run
    results.each_with_index do |result, i|
        print_info "[#{(i + 1).to_s}] On #{result['time']}"
        print_info "URL: #{result['response']['url']}"

        print_info 'Cookies forced to: '
        result['cookies'].each_pair do |name, value|
            print_info "    #{name} => #{value}"
        end

        print_line
    end
end

#tplObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'components/reporters/plugin_formatters/html/cookie_collector.rb', line 21

def tpl
    "        <ul>\n        <% results.each do |entry| %>\n            <li>\n                On <strong><%= entry['time'] %></strong> by\n\n                <a href=\"<%= escapeHTML entry['response']['url'] %>\">\n                    <%= escapeHTML entry['response']['url'] %>\n                </a>\n\n                <ul>\n                    <% (entry['response']['headers']['Set-Cookie'] || []).each do |set_cookie| %>\n                        <li>\n                            <code><%= escapeHTML set_cookie %></code>\n                        </li>\n                    <% end %>\n                </ul>\n            </li>\n        <% end %>\n        </ul>\n    HTML\nend\n"