Web
-
Webhacking.kr / old-21Web/webhacking.kr 2024. 8. 30. 10:59
문제Blind SQL Injection 문제이다풀이흔히 문제에서 많이 사용하는 guest / guest를 입력해보자login success 하지만 우리는 admin의 계정을 탈취하는 것을 목적으로 수행한다 결과값이 다른 것을 확인할 수 있다 즉 admin / 'or =1=1#을 넣었을 경우 DB에서 결과값을 돌려주지만 php 코드에서 결과값을 한번 더 확인 한 뒤 사용자에게 보여주는 것 같다wrong password = DB내 존재login fail = DB 내 존재 X 이를 이용하여 Blind SQL Injection 수행 BLIND SQLI1. admin password 길이 확인2. bit masking or lpad & bin & ord 를 활용해서 비밀번호 확인3. 입력 더보기?id=admin&..
-
Webhacking.kr / old-10Web/webhacking.kr 2024. 8. 30. 09:23
문제 설명소스코드를 확인해 보자O||||Goal 태그에 onclick 이벤트가 있고 if 문으로 리다이렉션 시키는 것을 확인할 수 있다. 즉 id=hackme a태그를 이용하여 O 문구를 1600px로 이동시키면 성공 정답더보기1. 개발자도구 -> style에 left를 1599로 변경 후 클릭2. onclick에 this.style.left=parseInt(this.style.left,10) => this.style.left=parseInt(this.style.left,1600) 수정 후 클릭
-
Webhacking.kr / old-26Web/webhacking.kr 2024. 8. 23. 11:20
문제확인 사항1. preg_match로 admin을 필터링2. urldecode 수행 후 비교 진행 사항입력 값 -> url 인코딩 -> url 디코딩 -> server $_GET['id'] -> preg_match 비교 -> url decode -> 비교 따라서 2번의 url 인코딩이 필요하다 기본적으로 'admin'을 아스키코드로 인코딩을 하면 %61%64%6D%69%6E => admin 으로 server에 전송$_GET['id']를 통해 1차 디코딩 => admin으로 들어감 => preg match에 걸림 => 실패 %2561%2564%256D%2569%256E => 1차 decode => %61%64%6D%69%6E => preg match 걸리지 않음=> 2차 decode => admin ..
-
Webhacking.kr / old-27Web/webhacking.kr 2024. 8. 22. 12:38
문제간단한 sql injection 문제이다 소스코드를 확인해보자 해당 부분에 중요한 부분은 다음과 같다 if(preg_match("/#|select|\(| |limit|=|0x/i",$_GET['no'])) exit("no hack"); $r=mysqli_fetch_array(mysqli_query($db,"select id from chall27 where id='guest' and no=({$_GET['no']})")) or die("query error"); 필터링을 우회하여 id=admin의 결과를 불러오면 된다. 힌트더보기공백 우회: %09 / %0a / %0b / %0c ...주석 처리 : # / -- / ;%00 / 정답더보기0)%09or%09id%09like%09%27admin..
-
Webhacking.kr / old-16Web/webhacking.kr 2024. 8. 6. 17:21
문제를 확인하면 무슨 이상한 꽃 모양 3개만 나와 있는 것을 알 수 있다. 여기서 확인할 수 있는 정보는 더이상 없으므로 개발자 도구를 확인한다(Ctrl + command + i / mac) 해당 파트를 확인해 보면 mv / kk함수 2개가 있는 것을 확인할 수 있다. 유의 깊게 봐야할 구간은 mv함수에 if(cd==124) location.href=String.fromCharCode(cd)+".php"; 부분이다. 즉 mv함수로 들어온 cd의 값이 124일 경우 특정 페이지로 리다이렉션이 되는 것을 확인 할 수 있다. 정답더보기콘솔창에 mv(124)입력
-
Webhacking.kr / old-15Web/webhacking.kr 2024. 8. 3. 17:51
기본적으로 문제를 들어가면 alert문으로 Access_Denied가 발생하는 것을 확인할 수 있다. Burp Suite로 확인해본 결과 location.href='/';document.write("[Get Flag]")2개가 작성되어 있는 것을 확인할 수 있다. ?getFlag로 이동할 시 flag값을 확인할 수 있다. 즉, '/'로 리다이렉션 되는 스크립트를 무시하고 해당 페이지로 이동하면 해결되는 것을 알 수 있다. https://webhacking.kr/challenge/js-2/?getFlag 로 이동할 수 있다. 정답더보기https://webhacking.kr/challenge/js-2/?getFlag 로 바로 이동or자바스크립트 동작 해제를 한 후 이동