DoR@Hee의 끄적끄적

webhacking.kr 46번 본문

WarGame/WebHacking.kr

webhacking.kr 46번

DoR@Hee 2019. 2. 26. 17:41


문제 첫화면 역시 SQL INJECTION 문제이다. 



index.phps 힌트가 존재



그 전에 level 1를 입력하면 zzibong(id) money:10000(cash)가 보인다.


2를 입력 시 아무것도 안보이며


다른 문자 역시 아무것도 안보인다.




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<html>
<head>
<title>Challenge 46</title>
</head>
<body>
<form method=get action=index.php>
level : <input name=lv value=1><input type=submit>
</form>
<?
if(time()<1256900400exit();
 
?>
<!-- index.phps -->
<?
 
$_GET[lv]=str_replace(" ","",$_GET[lv]);
$_GET[lv]=str_replace("/","",$_GET[lv]);
$_GET[lv]=str_replace("*","",$_GET[lv]);
$_GET[lv]=str_replace("%","",$_GET[lv]);
 
// space / * %등 필터링
 
if(eregi("union",$_GET[lv])) exit();
if(eregi("select",$_GET[lv])) exit();
if(eregi("from",$_GET[lv])) exit();
if(eregi("challenge",$_GET[lv])) exit();
if(eregi("0x",$_GET[lv])) exit();
if(eregi("limit",$_GET[lv])) exit();
if(eregi("cash",$_GET[lv])) exit();
 
// union select from challene 0x limit cash등 x
 
$q=@mysql_fetch_array(mysql_query("select id,cash from members where lv=$_GET[lv]"));
 
if($q && $_GET[lv])
{
echo("$q[0] information<br><br>money : $q[1]");
 
if($q[0]=="admin") @solve();
 
}
?>
 
 
 
</body>
</html>

cs


소스코드 이며  



위에 정리한대로 %20을 넣어 입력해보니 아무것도 안나온다 식은 맞는대

스페이스(%20)까지 필터링 하고있는것으로 보인다. 




그래서 다른 우회방식인 %0a(null)을 이용해서 본 결과 



정상적으로 출력되었고





해당 문제는 admin을 통해서 문제는 푸는것이기 때문에 

 id= admin을 입력했을 때 아무것도 안나온다.




아스키코드를 이용해서 우회


성공









'WarGame > WebHacking.kr' 카테고리의 다른 글

webhacking.kr 48번  (0) 2019.02.27
webhacking.kr 47번  (0) 2019.02.26
webhacking.kr 45번  (0) 2019.02.26
webhacking.kr 44번  (0) 2019.02.25
webhacking.kr 43번  (0) 2019.02.25
Comments