Over the Wire/natas
[OvertheWire:Natas] natas 21 → 22 /natas22
ruming
2021. 8. 1. 10:43
화면에 아무것도 없고 소스코드 링크만 걸려있다.
소스코드
<?
session_start();
if(array_key_exists("revelio", $_GET)) {
// only admins can reveal the password
if(!($_SESSION and array_key_exists("admin", $_SESSION) and $_SESSION["admin"] == 1)) {
header("Location: /");
}
}
?>
(생략)
<?
if(array_key_exists("revelio", $_GET)) {
print "You are an admin. The credentials for the next level are:<br>";
print "<pre>Username: natas23\n";
print "Password: <censored></pre>";
}
?>
<div id="viewsource"><a href="index-source.html">View sourcecode</a></div>
</div>
</body>
</html>
소스코드가 그닥 복잡하진 않다.
파라미터로 revelio를 전달하면 비밀번호를 볼 수 있는데,
admin이 아니면 리다이렉션하는 첫번째 if문이 걸린다. 버프슈트를 사용해서 revelio를 get방식으로 보내보자.
/?revelio를 보냄
response탭에서 확인 -> 패스워드 획득!
D0vlad33nQF0Hz2EP255TP5wSW9ZsRSE