Natas Level 7 → Level 8
Username: natas8
URL: http://natas8.natas.labs.overthewire.org
<div id="content">
<form method="post">
Input secret: <input name="secret"><br>
<input name="submit" type="submit" value="쿼리 전송">
</form>
<div id="viewsource"><a href="index-source.html">View sourcecode</a></div>
</div>
View sourcecode 링크를 클릭하면 소스를 볼 수 있다.
<html>
<head>
<!-- This stuff in the header has nothing to do with the level -->
<link rel="stylesheet" type="text/css" href="http://natas.labs.overthewire.org/css/level.css">
<link rel="stylesheet" href="http://natas.labs.overthewire.org/css/jquery-ui.css" />
<link rel="stylesheet" href="http://natas.labs.overthewire.org/css/wechall.css" />
<script src="http://natas.labs.overthewire.org/js/jquery-1.9.1.js"></script>
<script src="http://natas.labs.overthewire.org/js/jquery-ui.js"></script>
<script src=http://natas.labs.overthewire.org/js/wechall-data.js></script><script src="http://natas.labs.overthewire.org/js/wechall.js"></script>
<script>var wechallinfo = { "level": "natas8", "pass": "<censored>" };</script></head>
<body>
<h1>natas8</h1>
<div id="content">
<?
$encodedSecret = "3d3d516343746d4d6d6c315669563362";
function encodeSecret($secret) {
return bin2hex(strrev(base64_encode($secret)));
}
if(array_key_exists("submit", $_POST)) {
if(encodeSecret($_POST['secret']) == $encodedSecret) {
print "Access granted. The password for natas9 is <censored>";
} else {
print "Wrong secret";
}
}
?>
<form method=post>
Input secret: <input name=secret><br>
<input type=submit name=submit>
</form>
<div id="viewsource"><a href="index-source.html">View sourcecode</a></div>
</div>
</body>
</html>
3d3d516343746d4d6d6c315669563362 를 아스키로 바꾸면
==QcCtmMml1ViV3b 다
이 값을 뒤집으면 b3ViV1lmMmtCcQ==다
이 값을 base64로 디코딩하면 oubWYf2kBq 값이 나오게 된다.
정답은 W0mMhUcRRnG8dcghE4qvk3JA9lGt8nDl 이다.
'보안 > Natas' 카테고리의 다른 글
Natas Level 10 - 커맨드 인젝션2 (0) | 2017.02.08 |
---|---|
Natas Level 9 - 커맨드인젝션 (0) | 2017.02.08 |
Natas Level 7 - 불필요한 페이지 (0) | 2017.02.08 |
Natas Level 6 - php 코드가 존재할 때 (0) | 2017.02.08 |
Natas Level 5 - 쿠키변조 (0) | 2017.02.08 |