HSr00t 2018. 2. 13. 19:11
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[id])) exit("No Hack ~_~"); 
  if(preg_match('/prob|_|\.|\(\)/i'$_GET[pw])) exit("No Hack ~_~"); 
  $query = "select id from prob_cobolt where id='{$_GET[id]}' and pw=md5('{$_GET[pw]}')"
  echo "<hr>query : <strong>{$query}</strong><hr><br>"
  $result = @mysql_fetch_array(mysql_query($query)); 
  if($result['id'== 'admin') solve("cobolt");
  elseif($result['id']) echo "<h2>Hello {$result['id']}<br>You are not admin :(</h2>"
  highlight_file(__FILE__); 
?>
cs


주석을 이용하거나 주석을 이용하지않고 and와 or 우선순위 문제점으로 문제를 풀수있다.

주석은 #, --가 있다.

주석을 달때에는 주석 문자열이전에 ;붙여주고 주석뒤에 %20(띄어쓰기)를 넣어주는것이 좋다. 

URL인코딩해줘야된다.