반응형
if(isset($_POST['id']) && isset($_POST['ps'])){
  include("./lib.php"); # include for $FLAG, $DB_username, $DB_password.

  $conn = mysqli_connect("localhost", $DB_username, $DB_password, "login_filtering");
  mysqli_query($conn, "set names utf8");

  $id = mysqli_real_escape_string($conn, trim($_POST['id']));
  $ps = mysqli_real_escape_string($conn, trim($_POST['ps']));

  $row=mysqli_fetch_array(mysqli_query($conn, "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 "FLAG : ".$FLAG;
   }
  }else{
   echo "wrong..";
  }
 }
<!--

you have blocked accounts.

guest / guest
blueh4g / blueh4g1234ps

-->

주석에 어떤 아이디로 로그인할 수 있는지 나와있다.

하지만 필터링 되어 있어서 그대로는 로그인할 수 없음

따라서 대문자로 아이디를 변경해서 입력하면 해결됨

ID : Guest

PW : guest

반응형

'Dreamhack > Web' 카테고리의 다른 글

[wargame.kr] fly me to the moon  (0) 2023.11.09
simple_sqli  (0) 2023.11.09
random-test  (0) 2023.11.09
Type c-j  (0) 2023.11.09
session-basic  (0) 2023.11.09