[Level 14]Lord of SQL injection – giant

Lord of SQL injection – giant

Level 14


Source Code

<?php 
  include "../config.php"; 
  login_chk(); 
  dbconnect(); 
  if(strlen($_GET[shit])>1) exit("No Hack ~_~"); 
  if(preg_match('/ |\n|\r|\t/i', $_GET[shit])) exit("HeHe"); 
  $query = "select 1234 from{$_GET[shit]}prob_giant where 1"; 
  echo "<hr>query : <strong>{$query}</strong><hr><br>"; 
  $result = @mysql_fetch_array(mysql_query($query)); 
  if($result[1234]) solve("giant"); 
  highlight_file(__FILE__); 
?>

Analyse

http://los.sandbox.cash/giant-~~.php?shit=A 이라고 입력하게 되면
select 1234 fromAprob_giant where 1과 같이 MySQL 쿼리문이 입력된다.
그리고 5번째 줄에서 문자열의 길이가 1보다 크면 “HeHe”를 출력한다.
10번째 줄을 보면 &result['1234']가 참이기만 하면  giant문제가 풀린다.
 즉, 쿼리문이 실행 되기만 하면된다.

Frist Hint is next page

카테고리LOS

글의 문제가 있다면 댓글을 달아 주세요.

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.