WarGame/webhaking.kr
webhacking.kr - old11
m0nd2y
2021. 3. 15. 12:59
문제를 들어가면 위와 같이 나오는데, 소스 코드를 확인해보면 아래와 같습니다.
<?php
include "../../config.php";
if($_GET['view_source']) view_source();
?><html>
<head>
<title>Challenge 11</title>
<style type="text/css">
body { background:black; color:white; font-size:10pt; }
</style>
</head>
<body>
<center>
<br><br>
<?php
$pat="/[1-3][a-f]{5}_.*$_SERVER[REMOTE_ADDR].*\tp\ta\ts\ts/";
if(preg_match($pat,$_GET['val'])){
solve(11);
}
else echo("<h2>Wrong</h2>");
echo("<br><br>");
?>
<a href=./?view_source=1>view-source</a>
</center>
</body>
</html>
val에 같은 변수를 넣어야 하는데 정규표현식이 들어가 있습니다.
pat = [1에서3중에 1개][a-f중에 5개]_[ip주소].%09p%09a%09s%09s
tab 이 urlencoding된 값이 %09입니다.
위와 같이
?val=1abcde_172.~~~.~~~.~~~.%09p%09a%09s%09s 를 넣어주면 풀 수 있습니다.