Class: Arachni::Parser::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/parser/page.rb

Overview

@version: 0.2

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Page

Returns a new instance of Page.



91
92
93
94
95
96
97
# File 'lib/parser/page.rb', line 91

def initialize( opts = {} )
    opts.each {
        |k, v|
        send( "#{k}=", v )
    }

end

Instance Attribute Details

#codeFixnum

Returns the HTTP response code.

Returns:

  • (Fixnum)

    the HTTP response code



34
35
36
# File 'lib/parser/page.rb', line 34

def code
  @code
end

#cookiejarHash

Cookies extracted from the supplied cookiejar

Returns:

  • (Hash)


89
90
91
# File 'lib/parser/page.rb', line 89

def cookiejar
  @cookiejar
end

#cookiesArray<Arachni::Parser::Element::Cookie>



82
83
84
# File 'lib/parser/page.rb', line 82

def cookies
  @cookies
end

#formsArray<Arachni::Parser::Element::Form>



75
76
77
# File 'lib/parser/page.rb', line 75

def forms
  @forms
end

#headersArray<Arachni::Parser::Element::Header>

Request headers



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

def headers
  @headers
end

#htmlString

Returns the HTML response.

Returns:

  • (String)

    the HTML response



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

def html
  @html
end


68
69
70
# File 'lib/parser/page.rb', line 68

def links
  @links
end

#methodString

Returns the request method that returned the page.

Returns:

  • (String)

    the request method that returned the page



39
40
41
# File 'lib/parser/page.rb', line 39

def method
  @method
end

#query_varsHash

Returns url variables.

Returns:

  • (Hash)

    url variables



44
45
46
# File 'lib/parser/page.rb', line 44

def query_vars
  @query_vars
end

#response_headersHash

Returns:

  • (Hash)


61
62
63
# File 'lib/parser/page.rb', line 61

def response_headers
  @response_headers
end

#urlString

Returns url of the page.

Returns:

  • (String)

    url of the page



29
30
31
# File 'lib/parser/page.rb', line 29

def url
  @url
end

Instance Method Details

#bodyObject



99
100
101
# File 'lib/parser/page.rb', line 99

def body
    @html
end

#cookies_simpleHash

Returns cookies from #cookies as a name=>value hash

Returns:

  • (Hash)

    the cookie attributes, values, etc



137
138
139
140
141
142
143
144
145
# File 'lib/parser/page.rb', line 137

def cookies_simple
    cookies = { }

    @cookies.each {
        |cookie|
        cookies.merge!( cookie.simple )
    }
    return cookies
end

#forms_simpleArray

Returns an array of forms from #forms with its attributes and<br/> its auditable inputs as a name=>value hash

Returns:

  • (Array)


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

def forms_simple( )
    forms = []
    @forms.each {
        |form|
        forms << form.simple
    }
    return forms
end

Returns links from #links as a name=>value hash with href as key

Returns:

  • (Hash)


123
124
125
126
127
128
129
130
# File 'lib/parser/page.rb', line 123

def links_simple
    links = []
    @links.each {
        |link|
        links << link.simple
    }
    return links
end