/ Published in: Ruby
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
def connect(host = @ns_host, port = @ns_port) print "Connecting %s:%d\n" % [host, port] @socket = TCPSocket.new(host, port) # send("VER", "MSNP%d" % [@version]) send("VER", "MSNP15 MSNP14 MSNP13 CVR0") send("CVR", "0x0409 winnt 5.1 i386 MSG80BETA 8.1.0168 msmsgs %s" % [@@user]) send("USR", "SSO I %s" % [@@user]) do |c| case c.uid when "XFR" x_host, x_port = c.args[2].split(":") connect(x_host, x_port) return when "GCF" get_payload(c.args[1]) do |p| doc = REXML::Document.new p # doc.write($stdout, 1, true) doc.elements.each("//imtext") do |i| p Base64.decode64(i.attributes["value"]) end end read do |c| policy = c.args[3] nonce = c.args[4] p nonce data = @@tokens[1].data key = @@tokens[1].proof r = mbi_encrypt(Base64.decode64(key), nonce) @@master_token = Base64.encode64(r).gsub("\n", "") send("USR", "SSO S %s %s" % [data, @@master_token]) do |r| p r end start() end end end end