336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
문제 이름 : darkelf
소스코드
1
2
3
4
5
6
7
8
9
10
11
12
13 |
<?php
include "./config.php";
login_chk();
dbconnect();
if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");
if(preg_match('/or|and/i', $_GET[pw])) exit("HeHe");
$query = "select id from prob_darkelf where id='guest' and pw='{$_GET[pw]}'";
echo "<hr>query : <strong>{$query}</strong><hr><br>";
$result = @mysql_fetch_array(mysql_query($query));
if($result['id']) echo "<h2>Hello {$result[id]}</h2>";
if($result['id'] == 'admin') solve("darkelf");
highlight_file(__FILE__);
?> |
cs |
위문제 클리어조건은 id를 admin으로 인식하게만 하면 클리어인거같다.
필터링은 or,and 라는 단어가 들어가게되면 필터링이되어버린다.
그렇다면 쿼리를 어떤식으로 조작할수있는가
or과 and대신 다른기호를쓰면된다.
or같은경우는 ||을 사용해주면되고
and같은 경우는 &&(%26%26)으로 대신사용이가능하다.
뒷문제까지는 쭉 쉬웟던거같다.