본문 바로가기

war game/웹 워게임(los)22

load of sql injection assassin include "../config.php";   login_chk();   dbconnect();   if(preg_match('/\'/i', $_GET[pw])) exit("No Hack ~_~");   $query = "select id from prob_assassin where pw like '{$_GET[pw]}'";   echo "query : {$query}";   $result = @mysql_fetch_array(mysql_query($query));   if($result['id']) echo "Hello {$result[id]}";   if($result['id'] == 'admin') solve("assassin");   highlight_file(__FILE__); ?>소스코드 분.. 2016. 9. 14.
load of sql inejction giant 소스코드 분석우선 if(strlen($_GET[shit])>1) exit("No Hack ~_~"); 이 구문을 통해서 2개 이상의 문장이 넘어올 경우 필터를 하게 된다. shit파라미터는 \n,\r,\t들을 막고 있다. 쿼리를 봤을 때 select 1234 from{$_GET[shit]}prob_giant where 1 그렇다 from과 prob 사이를 띄워 주면 될 것 같다. 풀이 %20,%0d,%0a외에도 php에서 공백 대신 쓸 수 있는 것들이 있다고 한다.%20, %09, %0a, %0b, %0c, %0d, %a0등이 있다.페이로드는shit=%0b 등으로 하면 된다. 2016. 9. 14.
load of sql injection bugbear include "../config.php";   login_chk();   dbconnect();   if(preg_match('/prob|_|\.|\(\)/i', $_GET[no])) exit("No Hack ~_~");   if(preg_match('/\'/i', $_GET[pw])) exit("HeHe");   if(preg_match('/\'|substr|ascii|=|or|and| |like|0x/i', $_GET[no])) exit("HeHe");   $query = "select id from prob_bugbear where id='guest' and pw='{$_GET[pw]}' and no={$_GET[no]}";   echo "query : {$query}";   $result = @.. 2016. 9. 14.
load of sql injection darkknight include "../config.php";   login_chk();   dbconnect();   if(preg_match('/prob|_|\.|\(\)/i', $_GET[no])) exit("No Hack ~_~");   if(preg_match('/\'/i', $_GET[pw])) exit("HeHe");   if(preg_match('/\'|substr|ascii|=/i', $_GET[no])) exit("HeHe");   $query = "select id from prob_darkknight where id='guest' and pw='{$_GET[pw]}' and no={$_GET[no]}";   echo "query : {$query}";   $result = @mysql_fetch_ar.. 2016. 9. 14.