-
LOS - zombie_assassin / level 17Web/SQLI 2024. 7. 9. 20:10
문제
풀이 과정
$_GET['id'] = strrev(addslashes($_GET['id']));
$_GET['pw'] = strrev(addslashes($_GET['pw']));id 와 pw값에 addslashes가 적용되는 것을 알 수 있다
addslashes 함수는 ' " Null 값에 대해 \를 붙혀 문자열로 바꿔주는 함수이다
예를 들어 id='를 입력하면 \'로 입력이 됨을 알 수 있다
또한, strrev는 들어온 값을 뒤집어 들어가게 된다
즉, id=a'&pw=b를 입력하면
다음과 같은 결과가 나오게 된다
addslashes 함수를 이용하여 싱글쿼터를 문자화 시켜 빠져나온 뒤 b에 injection을 시도하면 된다
즉, 싱글쿼터인 ' 뿐만 아니라 더블쿼터 " 도 역슬래쉬가 붙기 때문에 이를 활용한다
정답
더보기?id="&pw=%23%201%20ro
'Web > SQLI' 카테고리의 다른 글
LOS - xavis / level 19 (0) 2024.07.09 LOS - nightmare / level 18 (0) 2024.07.09 LOS - succubus / level 16 (0) 2024.07.01 LOS - assassin / level 15 (0) 2024.07.01 LOS - giant / level 14 (0) 2024.06.29