Class: Arachni::Parser::Extractors::Comments

Inherits:
Base
  • Object
show all
Defined in:
components/path_extractors/comments.rb

Overview

Extract paths from HTML comments.

Author:

Instance Attribute Summary

Attributes inherited from Base

#downcased_html, #html, #parser

Instance Method Summary collapse

Methods inherited from Base

#check_for?, #document, #initialize

Constructor Details

This class inherits a constructor from Arachni::Parser::Extractors::Base

Instance Method Details

#runObject



14
15
16
17
18
19
20
# File 'components/path_extractors/comments.rb', line 14

def run
    return [] if !check_for?( '<!--' )

    document.nodes_by_class( Arachni::Parser::Nodes::Comment ).map do |comment|
        comment.value.scan( /(^|\s)(\/[\/a-zA-Z0-9%._-]+)/ )
    end.flatten.select { |s| s.start_with? '/' }
end