문제를 다운 받아 보았다.
html 파일이 하나 있어서 보니 10000번 클릭하면 답이 나오는것 같아 개발자도구로 소스를 보았다.
var pumpkin = [ 124, 112, 59, 73, 167, 100, 105, 75, 59, 23, 16, 181, 165, 104, 43, 49, 118, 71, 112, 169, 43, 53 ];
var counter = 0;
var pie = 1;
function make() {
if (0 < counter && counter <= 1000) {
$('#jack-nose').css('opacity', (counter) + '%');
}
else if (1000 < counter && counter <= 3000) {
$('#jack-left').css('opacity', (counter - 1000) / 2 + '%');
}
else if (3000 < counter && counter <= 5000) {
$('#jack-right').css('opacity', (counter - 3000) / 2 + '%');
}
else if (5000 < counter && counter <= 10000) {
$('#jack-mouth').css('opacity', (counter - 5000) / 5 + '%');
}
if (10000 < counter) {
$('#jack-target').addClass('tada');
var ctx = document.querySelector("canvas").getContext("2d"),
dashLen = 220, dashOffset = dashLen, speed = 20,
txt = pumpkin.map(x=>String.fromCharCode(x)).join(''), x = 30, i = 0;
ctx.font = "50px Comic Sans MS, cursive, TSCu_Comic, sans-serif";
ctx.lineWidth = 5; ctx.lineJoin = "round"; ctx.globalAlpha = 2/3;
ctx.strokeStyle = ctx.fillStyle = "#1f2f90";
(function loop() {
ctx.clearRect(x, 0, 60, 150);
ctx.setLineDash([dashLen - dashOffset, dashOffset - speed]); // create a long dash mask
dashOffset -= speed; // reduce dash length
ctx.strokeText(txt[i], x, 90); // stroke letter
if (dashOffset > 0) requestAnimationFrame(loop); // animate
else {
ctx.fillText(txt[i], x, 90); // fill final letter
dashOffset = dashLen; // prep next char
x += ctx.measureText(txt[i++]).width + ctx.lineWidth * Math.random();
ctx.setTransform(1, 0, 0, 1, 0, 3 * Math.random()); // random y-delta
ctx.rotate(Math.random() * 0.005); // random rotation
if (i < txt.length) requestAnimationFrame(loop);
}
})();
}
else {
$('#clicks').text(10000 - counter);
}
}
$(function() {
$('#jack-target').click(function () {
counter += 1;
if (counter <= 10000 && counter % 100 == 0) {
for (var i = 0; i < pumpkin.length; i++) {
pumpkin[i] ^= pie;
pie = ((pie ^ 0xff) + (i * 10)) & 0xff;
}
}
make();
});
});
대충 훑어봤을때 counter가 10000을 넘기면 될것같아서
콘솔에서 counter를 10000으로 만들었더니 뭔가 이상한게 출력되서 다시 코드를 보러갔다.
코드를 보니 10000번을 클릭하는 방식이 아니면 순서대로 문자가 출력되 지 않는 것 같아서 console에서 10000번 클릭하는 코드를 입력하여 답을 얻었다.
for(var i = 0;i<10000;i++)
{
$('#jack-target').click()
}
'정보보안 > DreamHack' 카테고리의 다른 글
[Lecture]블록암호 : 운영모드(Cryptography) (0) | 2022.02.03 |
---|---|
[Lecture]현대암호(Cryptography) (0) | 2022.01.28 |
[Lecture]고전암호(Cryptography) (0) | 2022.01.27 |
[Lecture]Shellcode(System) (0) | 2022.01.26 |
[Wargame]file-download-1(web) (0) | 2022.01.23 |