[webhacking.kr] ๋ฌธ์ ํ์ด ์คํฐ๋ week1_ #1
(1) old-15

๊ฐ๋ฐ์๋๊ตฌ ์ผ์ ์ฝ๋๋ฅผ ๋ณด๋ฉด ์๋ ๋๊ฐ์ง๋ฅผ ์ ์ ์๋ค.
- ๋ธ๋ผ์ฐ์ ๊ฐ script ๋ฅผ ์คํํ์ฌ alert ์ฐฝ์ด ๋ฌ ๊ฒ์ ํ์ธ ๊ฐ๋ฅํ๋ค.
- flag๋ฅผ ์ป๊ธฐ ์ํด์๋ ?getflag๋ก ์ด๋ํด์ผ ํ๋ค๋ ๊ฒ์ ์ ์ ์๋ค.
<a href="์ด๋ํ ์ฃผ์">ํ๋ฉด์ ๋ณด์ด๋ ๊ธ์</a>

๋ฐ๋ผ์ /?getFlag๋ก ์์ฒญ ๋ณด๋ด๋ฉด ๋ฌธ์ ํ์ด ์๋ฃ

(2) old-14
ํ ์คํธ๋ก 1 ์ ๋ ฅํด๋ณด๋ฉด wrong ์ถ๋ ฅ

indexOf()
- indexOf ํจ์๋, ๋ฌธ์์ด(string)์์ ํน์ ๋ฌธ์์ด(searchvalue)์ ์ฐพ๊ณ , ๊ฒ์๋ ๋ฌธ์์ด์ด '์ฒซ๋ฒ์งธ'๋ก ๋ํ๋๋ ์์น index๋ฅผ ๋ฆฌํด (0๋ถํฐ ์นด์ดํธ)
- searchvalue : ํ์ ์ ๋ ฅ๊ฐ, ์ฐพ์ ๋ฌธ์์ด
- position : optional, ๊ธฐ๋ณธ๊ฐ์ 0, string์์ searchvalue๋ฅผ ์ฐพ๊ธฐ ์์ํ ์์น
- ์ฐพ๋ ๋ฌธ์์ด์ด ์์ผ๋ฉด -1์ ๋ฆฌํดํฉ๋๋ค. ๋ฌธ์์ด์ ์ฐพ์ ๋ ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํจ
string.indexOf(searchvalue, position)
ํ์ฌ ํ์ด์ง์ url์์ .kr๋ฅผ ์ฐพ๊ณ ๊ทธ ์์น์ * 30์ ํ๊ณ ๊ทธ ๊ฐ๊ณผ ํผ์ ์ ๋ ฅํ pw๊ฐ ๊ฐ์ผ๋ฉด /?{pw*30} ํ์ด์ง๋ก ์ด๋
๋ค๋ฅด๋ฉด wrong ์ถ๋ ฅ

https://webhacking.kr/challenge/js-1/ ์์ ์ธ์ด๋ณด๋ฉด,,, ๋ ์ข๊ฒ ์ง๋ง ์ฝ์์ฐฝ์ ์ ๋ ฅ ใฑใฑ

ํผ์ 540 ์ ๋ ฅํ๋ฉด ๋

(3) old-17
์ ๋ฌธ์ ๋ ๋น์ท.. ๋ค๋ง 1์ ์ ๋ ฅํด๋ณด์๋๋ฐ ?pw={์ ๋ ฅ๊ฐ}์ผ๋ก ์ด๋ํ๊ณ alert๊ฐ ๋จ๊ฑฐ๋ ํ์ง ์์

๊ฐ๋ฐ์๋๊ตฌ ์ด์ด์ ์ฝ๋ ํ์ธ !
๊ณ์ฐํ ํ์ ์์ด ๊ทธ๋๋ก ๋ณต๋ถํด์ ์ฝ์์์ ใฑใฑ
<script>
unlock=100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+1/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10+100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10-100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10/100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10*100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2*1*10+9999999;
function sub(){ if(login.pw.value==unlock){ location.href="?"+unlock/10; } else{ alert("Wrong"); } }
</script>


(2) old-16

๊ฐ๋ฐ์ ๋๊ตฌ ์ผ์ ํ์ธ ๊ณ ๊ณ
document.body.innerHTML+="<font color=yellow id=aa style=position:relative;left:0;top:0>*</font>";
function mv(cd){
kk(star.style.left-50,star.style.top-50);
if(cd==100) star.style.left=parseInt(star.style.left+0,10)+50+"px";
if(cd==97) star.style.left=parseInt(star.style.left+0,10)-50+"px";
if(cd==119) star.style.top=parseInt(star.style.top+0,10)-50+"px";
if(cd==115) star.style.top=parseInt(star.style.top+0,10)+50+"px";
if(cd==124) location.href=String.fromCharCode(cd)+".php"; // do it!
}
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>";
}
cd (์ ๋ ฅ๊ฐ)์ ๋ฐ๋ผ ๋ณ์ ์์น๊ฐ ๋ณ๊ฒฝํ๋ ํ์ด์ง ์ด๊ณ ,
//do it ์ ํตํด ์ ์ฝ๋๋ฅผ ์คํํด์ผ ํ๋ค๋ ๊ฒ์ ์ ์ ์๋ค.
๊ทธ๋์ 124๊ฐ ๋ฌด์จํค์ธ์ง ์ฐพ์๋ณด์๋๋ฐ, ใ ฃ? | ? ใ ฃ? ๋ญ์ง ๋ชจ๋ฅด๊ฒ ์ด์ ๊ตฌ๊ธ๋งํจ | ์์คํค์ฝ๋(ASCII) 124๋ฒ์ ์์ง์ ๋๋ ๋ฒํฐ์ปฌ ๋ฐ ๊ธฐํธ์ธ | ์ ๋๋ค. [1] ๋ผ๊ณ ํด์ ์ ๋ ฅํด์ฃผ๋ฉด ๋ฌธ์ ํ์ด ์๋ฃ

์ถ๊ฐ๋ก ์ฌ์ค mv(124)๋ฅผ ์คํํ๋ฉด ๋๋ ๊ฒ์ด๋ผ์ ์ฝ์์ฐฝ์์ ๋ฐ๋ก ์คํํด๋ ๋จ