wargame.kr

wargame.kr - login filtering

shinobu 2021. 7. 26. 21:17

 

 

소스코드 보기를 눌러 중요한 부분만 가져왔다

 

/*
create table user(
  idx int auto_increment primary key,
  id char(32),
  ps char(32)
);
*/

$id = mysql_real_escape_string(trim($_POST['id']));
 $ps = mysql_real_escape_string(trim($_POST['ps']));

 $row=mysql_fetch_array(mysql_query("select * from user where id='$id' and ps=md5('$ps')"));

if(isset($row['id'])){
  if($id=='guest' || $id=='blueh4g'){
  	echo "your account is blocked";
  }else{
  	echo "login ok"."<br />";
  	echo "Password : ".$key;
  }
 }else{
  	echo "wrong..";
 }

 

if문을 보면 id 값이 guest sk blueh4g이면 your account is blocked 라고 나온다

 

이걸 우회를 해야하는데

 

mysql에서는 대소문자를 구분하지 않는다

 

 

그래서 Guest/guest를 입력해주면

 

 

 

플래그가 나오게 된다