Sha256: b19e9ea9ea138484cd8529cd6f9083c3ca297c48bb4edfcea76fb55133001c8b

Contents?: true

Size: 1.51 KB

Versions: 6

Compression:

Stored size: 1.51 KB

Contents

=begin
    Copyright 2010-2015 Tasos Laskos <tasos.laskos@arachni-scanner.com>

    This file is part of the Arachni Framework project and is subject to
    redistribution and commercial restrictions. Please see the Arachni Framework
    web site for more information on licensing and terms of use.
=end

class Arachni::Reporters::HTML

# HTML formatter for the results of the WAF Detector plugin.
#
# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
class PluginFormatters::WAFDetector < Arachni::Plugin::Formatter
    include TemplateUtilities

    def run
        ERB.new( tpl ).result( binding )
    end

    def tpl
        <<-HTML
            <h3>Result</h3>

            <p class="alert alert-<%= message_type %>">
                <b class="fa fa-<%= icon %>"></b>

                <strong><%= status %></strong>:
                <%= message %>
            </p>
        HTML
    end

    def status
        escapeHTML results['status'].capitalize
    end

    def message
        escapeHTML results['message'].capitalize.gsub( '_', ' ' )
    end

    def icon
        case results['status']
            when 'found'
                'check'

            when 'not_found'
                'times'

            when 'inconclusive'
                'question'
        end
    end

    def message_type
        case results['status']
            when 'found'
                'success'

            when 'not_found'
                'danger'

            when 'inconclusive'
                'warning'
        end
    end

end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
arachni-1.3.2 components/reporters/plugin_formatters/html/waf_detector.rb
arachni-1.3.1 components/reporters/plugin_formatters/html/waf_detector.rb
arachni-1.3 components/reporters/plugin_formatters/html/waf_detector.rb
arachni-1.2.1 components/reporters/plugin_formatters/html/waf_detector.rb
arachni-1.2 components/reporters/plugin_formatters/html/waf_detector.rb
arachni-1.1 components/reporters/plugin_formatters/html/waf_detector.rb