Module: Ronin::Web::SessionCookie

Defined in:
lib/ronin/web/session_cookie.rb,
lib/ronin/web/session_cookie/jwt.rb,
lib/ronin/web/session_cookie/rack.rb,
lib/ronin/web/session_cookie/cookie.rb,
lib/ronin/web/session_cookie/django.rb,
lib/ronin/web/session_cookie/version.rb

Overview

Namespace for ronin-web-session_cookie.

Defined Under Namespace

Classes: Cookie, Django, JWT, Rack

Constant Summary collapse

CLASSES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

All session cookie classes.

[
  Rack,
  JWT,
  Django
]
VERSION =

ronin-web-session_cookie version

'0.1.0'

Class Method Summary collapse

Class Method Details

.extract(response) ⇒ Rack, ...

Extracts and parses the session cookie from the HTTP response.

Parameters:

  • response (Net::HTTPResponse)

    The HTTP response object.

Returns:

  • (Rack, Django, JWT, nil)

    The parsed session cookie or nil if no session cookie could be detected.



73
74
75
76
77
78
79
80
81
# File 'lib/ronin/web/session_cookie.rb', line 73

def self.extract(response)
  CLASSES.each do |klass|
    if (session_cookie = klass.extract(response))
      return session_cookie
    end
  end

  return nil
end

.parse(string) ⇒ Rack, ...

Parses the session cookie.

Parameters:

  • string (String)

    The raw session cookie to parse.

Returns:

  • (Rack, Django, JWT, nil)

    The parsed and deserialized session cookie data. Returns nil if the session cookie did not match any of the supported formats.



51
52
53
54
55
56
57
58
59
# File 'lib/ronin/web/session_cookie.rb', line 51

def self.parse(string)
  CLASSES.each do |klass|
    if klass.identify?(string)
      return klass.parse(string)
    end
  end

  return nil
end