첫 화면이다.
view-source를 클릭해 본 소스는 아래와 같다.
<?php
if($_GET['view_source']){ highlight_file(__FILE__); exit; }
?><html>
<head>
<title>Challenge 44</title>
</head>
<body>
<?php
if($_POST['id']){
$id = $_POST['id'];
$id = substr($id,0,5);
system("echo 'hello! {$id}'"); // You just need to execute ls
}
?>
<center>
<form method=post action=index.php name=htmlfrm>
name : <input name=id type=text maxlength=5><input type=submit value='submit'>
</form>
<a href=./?view_source=1>view-source</a>
</center>
</body>
</html>
/
❯ ls
Applications Users cores home sbin var
Library Volumes dev opt tmp
System bin etc private usr
/
❯ l's'
Applications Volumes etc sbin
Library bin home tmp
System cores opt usr
Users dev private var
Auth 창에 플래그를 넣고 제출하면 문제가 풀린다.