war game/webhacking.kr

[webhacking.kr] 25 150pt

shnec 2017. 1. 10. 20:58


첫 화면이다

?file=hello를 보내는 걸 보니

readfilename=$_GET['file']+.txt 이런식으로 파일을 읽을 것 같다.

우리의 목표는 password.php를 읽는 것이고 

그 말은 즉 뒤에 .txt가 있는 코드가 있다는 것인데

.txt를 무시하는 방법은

filename도 문자열이기 때문에 끝처리를 null로 해버리면 뒤에를 읽지 않는다는것


?file=password.php%00


password를 찾을 수 있다.