EASY7

Lord of the SQL 8번 본문

Project/Lord of SQL

Lord of the SQL 8번

E.asiest 2019. 8. 4. 16:30

Lord of the SQL 8번

<?php  
  
include "./config.php"
  
login_chk(); 
  
dbconnect(); 
  if(
preg_match('/\'/i'$_GET[id])) exit("No Hack ~_~");
  if(@
ereg("admin",$_GET[id])) exit("HeHe");
  
$query "select id from prob_troll where id='{$_GET[id]}'";
  echo 
"<hr>query : <strong>{$query}</strong><hr><br>";
  
$result = @mysql_fetch_array(mysql_query($query));
  if(
$result['id'] == 'admin'solve("troll");
  
highlight_file(__FILE__);
?>

 

#PHP 함수

ereg(찾고자하는 문자, 필터링할 문자열)  : 대소문자를 구분하며 찾으면 true, 못찾으면 false

eregi(찾고자하는 문자, 필터링할 문자열  : 대소문자를 구분하며 찾으면 true, 못찾으면 false

 

따옴표는 필터됨 (쌍따옴표는 됨.)

id에 admin들어가면 안됨

 

eregi가 아니라 ereg라서 ADMIN쳤더니 성공! MySQL은 Value에서 대소문자 구분하지 않는다!

 

'Project > Lord of SQL' 카테고리의 다른 글

Lord of the SQL 10번  (0) 2019.08.04
Lord of the SQL 9번  (0) 2019.08.04
Lord of the SQL 7번  (0) 2019.08.04
Lord of the SQL 6번  (0) 2019.08.04
Lord of SQL 5번  (0) 2019.08.04
Comments