Class: PluginFormatters::VectorCollector

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

Overview

Author:

Instance Method Summary collapse

Instance Method Details

#run(xml) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'components/reporters/plugin_formatters/stdout/vector_collector.rb', line 14

def run
    results.each do |url, elements|
        print_status url
        print_status '-' * 80

        elements.each do |element|
            print_info "#{element['type']} pointing to #{element['action']}"

            if (element['inputs'] || {}).any?
                element['inputs'].each do |name, value|
                    print_info "    #{name.inspect} => #{value.inspect}"
                end
            end

            if element['source']
                print_info element['source']
            end

            print_line
        end

        print_line
    end
end

#tplObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'components/reporters/plugin_formatters/html/vector_collector.rb', line 19

def tpl
    <<-HTML

    <% results.each do |url, vectors| %>
        <h3>
            <a href="<%= escapeHTML url %>">
                <%= escapeHTML url %>
            </a>
        </h3>

        <% vectors.each do |vector| %>
            <h4>
                <%= vector['type'] %> pointing to

                <a href="<%= escapeHTML vector['action'] %>">
                    <%= escapeHTML vector['action'] %>
                </a>
            </h4>

            <% if vector['inputs'] %>
                <ul>
                <% vector['inputs'].each do |name, value| %>
                    <li>
                        <strong><%= escapeHTML name %>:</strong>
                        <%= escapeHTML value.inspect %>
                    </li>
                <% end %>
                </ul>
            <% end %>

            <% if vector['source'] %>
                <pre><%= escapeHTML vector['source'] %></pre>
            <% end %>

        <% end %>
    <% end %>
    HTML
end