Class: PluginFormatters::WAFDetector
- Inherits:
-
Arachni::Plugin::Formatter
- Object
- Arachni::Plugin::Formatter
- PluginFormatters::WAFDetector
- Includes:
- TemplateUtilities
- Defined in:
- components/reporters/plugin_formatters/stdout/waf_detector.rb,
components/reporters/plugin_formatters/html/waf_detector.rb,
components/reporters/plugin_formatters/xml/waf_detector.rb
Overview
XML formatter for the results of the WAF Detector plugin
Instance Method Summary collapse
- #icon ⇒ Object
- #message ⇒ Object
- #message_type ⇒ Object
- #run(xml) ⇒ Object
- #status ⇒ Object
- #tpl ⇒ Object
Instance Method Details
#icon ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'components/reporters/plugin_formatters/html/waf_detector.rb', line 42 def icon case results['status'] when 'found' 'check' when 'not_found' 'times' when 'inconclusive' 'question' end end |
#message ⇒ Object
38 39 40 |
# File 'components/reporters/plugin_formatters/html/waf_detector.rb', line 38 def escapeHTML results['message'].capitalize.gsub( '_', ' ' ) end |
#message_type ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'components/reporters/plugin_formatters/html/waf_detector.rb', line 55 def case results['status'] when 'found' 'success' when 'not_found' 'danger' when 'inconclusive' 'warning' end end |
#run(xml) ⇒ Object
16 17 18 |
# File 'components/reporters/plugin_formatters/stdout/waf_detector.rb', line 16 def run print_ok results['message'] end |
#status ⇒ Object
34 35 36 |
# File 'components/reporters/plugin_formatters/html/waf_detector.rb', line 34 def status escapeHTML results['status'].capitalize end |
#tpl ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'components/reporters/plugin_formatters/html/waf_detector.rb', line 21 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 |