Class: Arachni::ElementFilter
Overview
Constant Summary collapse
- TYPES =
State::ElementFilter::TYPES
Class Method Summary collapse
- .cookies ⇒ Support::LookUp::HashSet
- .cookies_include?(cookie) ⇒ Bool
- .forms ⇒ Support::LookUp::HashSet
- .forms_include?(form) ⇒ Bool
- .include?(element) ⇒ Bool
- .jsons ⇒ Support::LookUp::HashSet
- .jsons_include?(json) ⇒ Bool
- .link_templates ⇒ Support::LookUp::HashSet
- .link_templates_include?(link_template) ⇒ Bool
- .links ⇒ Support::LookUp::HashSet
- .links_include?(link) ⇒ Bool
- .reset ⇒ Object
-
.update_cookies(cookies) ⇒ Integer
Amount of new cookies.
-
.update_forms(forms) ⇒ Integer
Amount of new forms.
-
.update_from_page(page) ⇒ Integer
Amount of new elements.
-
.update_from_page_cache(page) ⇒ Integer
Updates the elements from the Page#cache, useful in situations where resources need to be preserved (thus avoiding a full page parse) and the need for a full coverage update isn't vital.
-
.update_jsons(jsons) ⇒ Integer
Amount of new jsons.
-
.update_link_templates(link_templates) ⇒ Integer
Amount of new link templates.
-
.update_links(links) ⇒ Integer
Amount of new links.
-
.update_xmls(xmls) ⇒ Integer
Amount of new xmls.
- .xmls ⇒ Support::LookUp::HashSet
- .xmls_include?(xml) ⇒ Bool
Class Method Details
.cookies_include?(cookie) ⇒ Bool
|
# File 'lib/arachni/element_filter.rb', line 64
|
.forms_include?(form) ⇒ Bool
|
# File 'lib/arachni/element_filter.rb', line 52
|
.include?(element) ⇒ Bool
160 161 162 163 164 165 166 |
# File 'lib/arachni/element_filter.rb', line 160 def include?( element ) TYPES.each do |type| return true if send( "#{type}_include?", element ) end false end |
.jsons_include?(json) ⇒ Bool
|
# File 'lib/arachni/element_filter.rb', line 76
|
.link_templates_include?(link_template) ⇒ Bool
|
# File 'lib/arachni/element_filter.rb', line 70
|
.links_include?(link) ⇒ Bool
|
# File 'lib/arachni/element_filter.rb', line 58
|
.reset ⇒ Object
22 23 24 25 26 |
# File 'lib/arachni/element_filter.rb', line 22 def reset @mutex = Mutex.new State.element_filter.clear nil end |
.update_cookies(cookies) ⇒ Integer
Returns Amount of new cookies.
|
# File 'lib/arachni/element_filter.rb', line 102
|
.update_forms(forms) ⇒ Integer
Returns Amount of new forms.
|
# File 'lib/arachni/element_filter.rb', line 95
|
.update_from_page(page) ⇒ Integer
Returns Amount of new elements.
172 173 174 |
# File 'lib/arachni/element_filter.rb', line 172 def update_from_page( page ) TYPES.map { |type| send( "update_#{type}", page.send( type ) ) }.inject(&:+) end |
.update_from_page_cache(page) ⇒ Integer
Updates the elements from the Page#cache, useful in situations where resources need to be preserved (thus avoiding a full page parse) and the need for a full coverage update isn't vital.
184 185 186 |
# File 'lib/arachni/element_filter.rb', line 184 def update_from_page_cache( page ) TYPES.map { |type| send( "update_#{type}", page.cache[type] ) }.inject(&:+) end |
.update_jsons(jsons) ⇒ Integer
Returns Amount of new jsons.
|
# File 'lib/arachni/element_filter.rb', line 116
|
.update_link_templates(link_templates) ⇒ Integer
Returns Amount of new link templates.
|
# File 'lib/arachni/element_filter.rb', line 109
|
.update_links(links) ⇒ Integer
Returns Amount of new links.
|
# File 'lib/arachni/element_filter.rb', line 88
|
.update_xmls(xmls) ⇒ Integer
Returns Amount of new xmls.
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/arachni/element_filter.rb', line 130 TYPES.each do |type| define_method type do State.element_filter.send type end define_method "#{type}_include?" do |element| send(type).include? element.id end define_method "update_#{type}" do |elements| elements = [elements].flatten.compact return 0 if elements.size == 0 synchronize do new_element_cnt = 0 elements.each do |element| next if send( "#{type}_include?", element ) send( "#{type}" ) << element.id new_element_cnt += 1 end new_element_cnt end end end |
.xmls_include?(xml) ⇒ Bool
|
# File 'lib/arachni/element_filter.rb', line 82
|