Skip to content

Instantly share code, notes, and snippets.

@jrozner
Created June 5, 2011 03:56
Show Gist options
  • Save jrozner/1008630 to your computer and use it in GitHub Desktop.
Save jrozner/1008630 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'uri'
require 'webrick'
require 'cgi'
require 'rack'
require 'base64'
require 'zlib'
url = URI.parse('http://pwn508.ddtek.biz:52719/')
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|
http.request(req)
}
value = WEBrick::Cookie.parse_set_cookie(res['Set-Cookie'])
base64_data = CGI::unescape(value.value)
data = Base64.decode64(base64_data)
obj = Marshal.load(data)
deflated = Zlib::Deflate.deflate(obj['mh7cJ%h99LPn1zSoh4,42!6e3t78Cw]i'])
puts deflated
Copy link

ghost commented Jun 5, 2011

Serializing Ruby objects and storing them in cookies?
Sounds dangerous :-P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment