Class: Arachni::OptionGroups::Audit
- Inherits:
-
Arachni::OptionGroup
- Object
- Arachni::OptionGroup
- Arachni::OptionGroups::Audit
- Defined in:
- lib/arachni/option_groups/audit.rb
Overview
Options for audit scope/coverage, mostly decides what types of elements should be considered.
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#cookies ⇒ Bool
(also: #cookie_doms)
Audit cookies.
-
#cookies_extensively ⇒ Bool
Like #cookies but all cookie audits are submitted along with any other available element on the page.
-
#exclude_vector_patterns ⇒ Array<Regexp>
Patterns to use to exclude vectors from the audit, by name.
-
#forms ⇒ Bool
(also: #form_doms)
Audit forms.
-
#headers ⇒ Bool
Audit HTTP request headers.
-
#include_vector_patterns ⇒ Array<Regexp>
Patterns to use to include vectors in the audit exclusively, by name.
-
#link_templates ⇒ Array<Regexp>
(also: #link_template_doms)
Regular expressions with named captures, serving as templates used to extract input vectors from links.
-
#links ⇒ Bool
(also: #link_doms)
Audit links.
-
#with_both_http_methods ⇒ Bool
If enabled, all element audits will be performed with both ‘GET` and `POST` HTTP methods.
Instance Method Summary collapse
-
#elements(*element_types) ⇒ Object
(also: #elements=, #element)
Enables auditing of element types.
-
#elements?(*element_types) ⇒ Bool
(also: #element?)
Get audit settings for the given element types.
-
#link_templates? ⇒ Bool
(also: #link_template_doms?)
‘true` if link templates have been specified, `false` otherwise.
-
#skip_elements(*element_types) ⇒ Object
(also: #skip_element)
Disables auditing of element types.
- #to_h ⇒ Object
- #vector?(name) ⇒ Boolean
Methods inherited from Arachni::OptionGroup
#==, attr_accessor, #attributes, attributes, defaults, #defaults, #hash, inherited, #initialize, #merge, set_defaults, #to_hash, #to_rpc_data, #update, #validate
Constructor Details
This class inherits a constructor from Arachni::OptionGroup
Instance Attribute Details
#cookies ⇒ Bool Also known as:
Default is ‘false`.
Returns Audit cookies.
77 78 79 |
# File 'lib/arachni/option_groups/audit.rb', line 77 def @cookies end |
#cookies_extensively ⇒ Bool
Default is ‘false`.
Returns Like #cookies but all cookie audits are submitted along with any other available element on the page.
89 90 91 |
# File 'lib/arachni/option_groups/audit.rb', line 89 def @cookies_extensively end |
#exclude_vector_patterns ⇒ Array<Regexp>
Returns Patterns to use to exclude vectors from the audit, by name.
40 41 42 |
# File 'lib/arachni/option_groups/audit.rb', line 40 def exclude_vector_patterns @exclude_vector_patterns end |
#forms ⇒ Bool Also known as: form_doms
Default is ‘false`.
Returns Audit forms.
66 67 68 |
# File 'lib/arachni/option_groups/audit.rb', line 66 def forms @forms end |
#headers ⇒ Bool
Default is ‘false`.
Returns Audit HTTP request headers.
95 96 97 |
# File 'lib/arachni/option_groups/audit.rb', line 95 def headers @headers end |
#include_vector_patterns ⇒ Array<Regexp>
Returns Patterns to use to include vectors in the audit exclusively, by name.
46 47 48 |
# File 'lib/arachni/option_groups/audit.rb', line 46 def include_vector_patterns @include_vector_patterns end |
#link_templates ⇒ Array<Regexp> Also known as: link_template_doms
Returns Regular expressions with named captures, serving as templates used to extract input vectors from links.
102 103 104 |
# File 'lib/arachni/option_groups/audit.rb', line 102 def link_templates @link_templates end |
#links ⇒ Bool Also known as: link_doms
Default is ‘false`.
Returns Audit links.
55 56 57 |
# File 'lib/arachni/option_groups/audit.rb', line 55 def links @links end |
#with_both_http_methods ⇒ Bool
Default is ‘false`.
Returns If enabled, all element audits will be performed with both ‘GET` and `POST` HTTP methods.
34 35 36 |
# File 'lib/arachni/option_groups/audit.rb', line 34 def with_both_http_methods @with_both_http_methods end |
Instance Method Details
#elements(*element_types) ⇒ Object Also known as: elements=, element
Enables auditing of element types.
150 151 152 153 154 155 |
# File 'lib/arachni/option_groups/audit.rb', line 150 def elements( *element_types ) element_types.flatten.compact.each do |type| self.send( "#{type}=", true ) rescue self.send( "#{type}s=", true ) end true end |
#elements?(*element_types) ⇒ Bool Also known as: element?
Get audit settings for the given element types.
188 189 190 191 192 |
# File 'lib/arachni/option_groups/audit.rb', line 188 def elements?( *element_types ) !(element_types.flatten.compact.map do |type| !!(self.send( "#{type}?" ) rescue self.send( "#{type}s?" )) end.uniq.include?( false )) end |
#link_templates? ⇒ Bool Also known as: link_template_doms?
Returns ‘true` if link templates have been specified, `false` otherwise.
212 213 214 |
# File 'lib/arachni/option_groups/audit.rb', line 212 def link_templates? @link_templates.any? end |
#skip_elements(*element_types) ⇒ Object Also known as: skip_element
Disables auditing of element types.
169 170 171 172 173 174 |
# File 'lib/arachni/option_groups/audit.rb', line 169 def skip_elements( *element_types ) element_types.flatten.compact.each do |type| self.send( "#{type}=", false ) rescue self.send( "#{type}s=", false ) end true end |
#to_h ⇒ Object
217 218 219 220 221 222 223 |
# File 'lib/arachni/option_groups/audit.rb', line 217 def to_h h = super [:link_templates, :include_vector_patterns, :exclude_vector_patterns].each do |k| h[k] = h[k].map(&:to_s) end h end |
#vector?(name) ⇒ Boolean
202 203 204 205 206 207 208 |
# File 'lib/arachni/option_groups/audit.rb', line 202 def vector?( name ) if include_vector_patterns.any? && !include_vector_patterns.find { |p| p =~ name } return false end !exclude_vector_patterns.find { |p| p =~ name } end |