Natas6 Writeup(PHP Include)
Natas6:
该题提供了php源码,点击查看分析,发现调用了includes/secret.inc页面,在输入一个变量secret后,如果和includes/secret.inc中 预设的secret相同,则输出密码。
include "includes/secret.inc"; if(array_key_exists("submit", $_POST)) { if($secret == $_POST['secret']) { print "Access granted. The password for natas7 is <censored>"; } else { print "Wrong secret"; } }
尝试访问该页面—http://natas6.natas.labs.overthewire.org/includes/secret.inc,在其源码中发现预设字符——"FOEIUWGHFEEUHOFUOIU",将该字符输入到之前的表单查询中,得到flag。
flag:7z3hEENjQtflzgnT29q7wAvMNfZdh0i9