목록전체 글 (33)
D1N0's hacking blog
문제 풀이 5번 파일에 플래그가 있다는데 5번 버튼이 없다 다 눌러봐도 Nop만 뜬다 그런데 이동한 페이지를 자세히 보면 ?id=[숫자] 형태가 붙어있다 ?[파라미터 이름]=[파라미터 값] 형태로 데이터를 넘겨주는 것을 GET방식이라 하는데, 문제에서 id에 번호를 GET방식으로 넘겨주는 듯 하다 실제로 소스를 보면 id에 GET방식으로 각각 1,2,3,4를 넘겨주는 것을 알 수 있다 5번 파일에 플래그가 있다고 했으므로 ?id=5로 넘겨주면 플래그가 나온다 FLAG : HackCTF{idx_is_so_s1m3le_ctf}
문제 풀이 들어가보면 Hidden Flag라는 문구와 로봇 사진만 있다 아마 저 로봇 사진이 힌트인듯 하다 로봇과 웹 하면 생각할 수 있는게 robots.txt이다 robots.txt는 크롤링 봇들이 사이트에 접근하지 않도록 하는 일종의 안내문이다 사이트에서 robots.txt에 들어가보면 User-agent: * Disallow: /robot_flag/ 이런 것을 볼 수 있다 모든 봇에 대해 /robot_flag/ 로의 접근을 막겠다는 건데, 너무 수상해보인다 /robot_flag/에 들어가보면 바로 플래그가 나온다 FLAG : HackCTF{w3lcome_to_s1mple_web_h3cking!}
문제 풀이 코드를 보면 ', substr, ascii, =, or, and, 공백, like, 0x를 필터링하고 있다 '는 no 부분에 '가 없기 때문에 우회 가능하고, substr은 mid, ascii는 char, or는 ||, and는 &&(%26%26)로 우회 가능하며, 공백은 tab이나 괄호 등으로 우회 가능하다 문제는 =과 like인데, 이와 비슷한 기능을 하는 instr을 이용하면 우회할 수 있다 STEP 0 - SQL injection 취약점 확인 no=1234||instr(id,char(97,100,109,105,110));%23 instr은 일치하는 문자열의 개수를 반환하는 함수인데, instr([문자열], [찾을 문자열])을 통해 =을 우회할 수 있다 STEP 1 - pw 길이 구하기 ..