Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 업스테이지패스트캠퍼스
- 패스트캠퍼스
- 패스트캠퍼스AI부트캠프
- 오블완
- 티스토리챌린지
- 국비지원
- UpstageAILab#국비지원
- UpstageAILab
- 패스트캠퍼스업스테이지부트캠프
- 패스트캠퍼스업스테이지에이아이랩
Archives
- Today
- Total
김민주
Flying Chars 본문
문제는 다음과 같다.
주어진 사이트에 접속한 화면이다.
<html> <head> <title>Web</title> </head> <body> <div id="box"> </div> <style type="text/css"> body{ display: flex; width: 100vw; height:100vh; padding: 0px; } #box{ display: flex; flex-direction: column; justify-content: space-around; width: 90%; height:100%; } </style> <script type="text/javascript"> const img_files = ["/static/images/10.png", "/static/images/17.png", "/static/images/13.png", "/static/images/7.png","/static/images/16.png", "/static/images/8.png", "/static/images/14.png", "/static/images/2.png", "/static/images/9.png", "/static/images/5.png", "/static/images/11.png", "/static/images/6.png", "/static/images/12.png", "/static/images/3.png", "/static/images/0.png", "/static/images/19.png", "/static/images/4.png", "/static/images/15.png", "/static/images/18.png", "/static/images/1.png"]; var imgs = []; for (var i = 0; i < img_files.length; i++){ imgs[i] = document.createElement('img'); imgs[i].src = img_files[i]; imgs[i].style.display = 'block'; imgs[i].style.width = '10px'; imgs[i].style.height = '10px'; document.getElementById('box').appendChild(imgs[i]); } const max_pos = self.innerWidth; function anim(elem, pos, dis){ function move() { pos += dis; if (pos > max_pos) { pos = 0; } elem.style.transform = `translateX(${pos}px)`; requestAnimationFrame(move); } move(); } for(var i = 0; i < 20; i++){ anim(imgs[i], 0, Math.random()*60+20); } </script> </body> </html> |
문제에서 주어진 소스코드의 스크립트 부분이다.
for문에 랜덤으로 문자열 위치를 이동시키는 코드가 있어보인다.
for(var i = 0; i < 20; i++){ anim(imgs[i], 0, 1); } |
해당 반복문을 위와 같이 수정해주고 페이지를 확인해 보겠다.
이런 식으로 배열된 것을 볼 수 있다.
flag: DH{Too_H4rd_to_sEe_th3_Ch4rs_x.x}
문제 풀이 성공
'SWUFORCE > [공통] 드림핵 스터디' 카테고리의 다른 글
ex-reg-ex (1) | 2023.11.28 |
---|---|
[web] web-misconf-1 (0) | 2023.11.21 |
[web] session (0) | 2023.11.21 |
[pwnable] ssp_001 (0) | 2023.11.13 |
[pwnable] ssp_000 (1) | 2023.11.13 |