목록전체 글 (33)
D1N0's hacking blog
문제 풀이 코드를 보면 pw를 직접 비교하기 때문에 pw를 구해야 한다 blind SQL injection을 쓰면 될 것 같은데 잘 보니 '를 필터링한다 그러나 no에 '가 없으니 Goblin문제처럼 SQL injection이 가능하다 substr, ascii, =를 필터링하는 것은 Golem문제처럼 각각 mid, ord, like로 우회 가능하다 STEP 0 - SQL injection 취약점 확인 no=1234 or id like char(97, 100, 109, 105, 110);%23 like와 char을 이용해 필터링을 우회하면 Hello admin을 띄울 수 있다 이제 pw를 찾아보자 STEP 1 - pw 길이 구하기 no=1234 or id like char(97, 100, 109, 105,..
문제 풀이 문제를 보면 pw를 직접 비교하기 때문에 Blind SQL injection으로 pw를 알아내야 한다 그러나 or, and, substr(, =을 필터링하고 있다 or과 and는 전처럼 ||, &&로 우회 가능하고, =은 like로 우회 가능하다 참고로 like는 부분적으로 일치하는 부분이 있는지 확인할 때 사용하는 구문이지만 특정기호 없이 글자만 넣으면 =과 같은 역할을 한다 substr을 우회할 수 있는건 많이 있지만 여기서는 mid를 이용했다 STEP 0 - SQL injection 취약점 확인 pw=' || id like 'admin';%23 or -> || , = -> like로 하면 Hello admin이 뜬다 이를 이용해 pw를 구해보자 STEP 1 - pw 길이 구하기 pw=' ..
문제 풀이 코드를 보면 id를 guest로 두고 심지어 뒤에 false구문까지 뒀다 그러나 다행히 '를 필터링하지 않기 때문에 전에 간단한 SQL injection으로 인증할 수 있다 첫 번째 풀이 pw=' or id='admin';%23 or을 사용해 id가 admin인 행을 가져오고 1=0 부분은 주석으로 날린다 두 번째 풀이 pw=' or id='admin' or ' 주석을 쓰지 않고 1=0 부분을 or로 처리할 수도 있다