336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
16번문제애 접속해보면 이렇다.
사진에는 안보이지만 별이3개이다 ㅎㅎㅎ
노란색별이 아닌다른 색별에 마우를가져다대면 사라지게된다.
코드를한번 분석해보자
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 | <html> <head> <title>Challenge 16</title> <body bgcolor=black onload=kk(1,1) onkeypress=mv(event.keyCode)> <font color=silver id=c></font> <font color=yellow size=100 style=position:relative id=star>*</font> <script> document.body.innerHTML+="<font color=yellow id=aa style=position:relative;left:0;top:0>*</font>"; function mv(cd) { kk(star.style.posLeft-50,star.style.posTop-50); if(cd==100) star.style.posLeft=star.style.posLeft+50; if(cd==97) star.style.posLeft=star.style.posLeft-50; if(cd==119) star.style.posTop=star.style.posTop-50; if(cd==115) star.style.posTop=star.style.posTop+50; if(cd==124) location.href=String.fromCharCode(cd); } function kk(x,y) { rndc=Math.floor(Math.random()*9000000); document.body.innerHTML+="<font color=#"+rndc+" id=aa style=position:relative;left:"+x+";top:"+y+" onmouseover=this.innerHTML=''>*</font>"; } </script> </body> </html> | cs |
4번라인을보면 키를입력받아서 mv함수로 넘겨버린다
입력된값에따라 kk함수를 호출해서 랜덤색으로 별을 추가로 그려주는데
저기서 if문에있는값들이 무엇인가보니 아스키 코드값이엿다.
100은 소문자d 97은 소문자 a 119는 w키 115는 s키
근데 여기서 남은 124값은 위4개의 값들과 다르다
아스키코드 124번은 |(파이프라인)값이다.
|값을 입력해주면 이문제는클리어가된다
'wargame > webhacking.kr' 카테고리의 다른 글
webhacking.kr 21번 (0) | 2018.01.06 |
---|---|
webhacking.kr 26번 (0) | 2017.12.17 |
webhacking.kr 24번문제 (0) | 2017.12.11 |
webhacking.kr 39번문제 (0) | 2016.12.12 |
webhacking.kr 17번문제 (0) | 2016.12.12 |