Created
June 5, 2011 03:56
-
-
Save jrozner/1008630 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Serializing Ruby objects and storing them in cookies?
Sounds dangerous :-P