Class: Arachni::Parser::Element::Base Abstract

Inherits:
Element::Auditable show all
Defined in:
lib/parser/elements.rb

Overview

This class is abstract.

Base element class.

Should be extended/implemented by all HTML/HTTP modules.

@author: Tasos “Zapotek” Laskos

<[email protected]>
<[email protected]>

@version: 0.1

Direct Known Subclasses

Cookie, Form, Header, Link

Instance Attribute Summary collapse

Attributes inherited from Element::Auditable

#altered, #opts

Instance Method Summary collapse

Methods inherited from Element::Auditable

#audit, #auditor, #debug?, #get_status_str, #http_request, #info, #injection_sets, #print_debug, #print_error, #print_status, reset, #skip?, #submit

Methods included from Module::Utilities

#exception_jail, #get_path, #normalize_url, #read_file, #seed

Constructor Details

#initialize(url, raw = {}) ⇒ Base

Initialize the element.

Parameters:



77
78
79
80
# File 'lib/parser/elements.rb', line 77

def initialize( url, raw = {} )
    @raw   = raw.dup
    @url   = url.dup
end

Instance Attribute Details

#actionString

The url to which the element points and should be audited against.

Ex. ‘href’ for links, ‘action’ for forms, etc.

Returns:



47
48
49
# File 'lib/parser/elements.rb', line 47

def action
  @action
end

#auditableObject

Returns the value of attribute auditable.



49
50
51
# File 'lib/parser/elements.rb', line 49

def auditable
  @auditable
end

#methodString

Method of the element.

Should represent a method in Module::HTTP.

Ex. get, post, cookie, header

Returns:

See Also:

  • Module::HTTP


69
70
71
# File 'lib/parser/elements.rb', line 69

def method
  @method
end

#rawHash

Relatively ‘raw’ hash holding the element’s attributes, values, etc.

Returns:

  • (Hash)


56
57
58
# File 'lib/parser/elements.rb', line 56

def raw
  @raw
end

#urlString

The URL of the page that owns the element.

Returns:



38
39
40
# File 'lib/parser/elements.rb', line 38

def url
  @url
end

Instance Method Details

#idString

Must provide a string uniquely identifying self.

Returns:



87
88
89
# File 'lib/parser/elements.rb', line 87

def id
    return @raw.to_s
end

#simpleObject

Must provide a simple hash representation of self



94
95
96
# File 'lib/parser/elements.rb', line 94

def simple

end

#typeObject

Must provide the element type, one of Module::Auditor::Element.



101
102
103
# File 'lib/parser/elements.rb', line 101

def type

end