Class: Arachni::Parser::Element::Link

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

Instance Attribute Summary

Attributes inherited from Base

#action, #auditable, #method, #raw, #url

Attributes inherited from Element::Auditable

#altered, #opts

Instance Method Summary collapse

Methods inherited from Base

#id

Methods inherited from Element::Auditable

#audit, #auditor, #debug?, #get_status_str, #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 = {}) ⇒ Link

Returns a new instance of Link.



109
110
111
112
113
114
115
116
# File 'lib/parser/elements.rb', line 109

def initialize( url, raw = {} )
    super( url, raw )

    @action = @raw['href']
    @method = 'get'

    @auditable = @raw['vars']
end

Instance Method Details

#audit_id(injection_str, opts = {}) ⇒ Object



130
131
132
133
134
135
136
137
138
# File 'lib/parser/elements.rb', line 130

def audit_id( injection_str, opts = {} )
    vars = auditable.keys.sort.to_s
    url = URI( @auditor.page.url ).merge( URI( @action ).path ).to_s

    timeout = opts[:timeout] || ''
    return "#{@auditor.class.info[:name]}:" +
      "#{url}:" + "#{self.type}:" +
      "#{vars}=#{injection_str.to_s}:timeout=#{timeout}"
end

#http_request(url, opts) ⇒ Object



118
119
120
# File 'lib/parser/elements.rb', line 118

def http_request( url, opts )
    return @auditor.http.get( url, opts )
end

#simpleObject



122
123
124
# File 'lib/parser/elements.rb', line 122

def simple
    return { @action => @auditable }
end

#typeObject



126
127
128
# File 'lib/parser/elements.rb', line 126

def type
    Arachni::Module::Auditor::Element::LINK
end