반응형
문제 링크 : http://suninatas.com/Part_one/web04/web04.asp
Hint를 보면 50점이라는 것과 SuNiNaTaS가 힌트라는 것을 알 수 있다.
plus 버튼을 누르면 값이 1씩 증가하는 것을 알 수 있고, 값이 25이상인 경우에는 "I like the SuNiNaTaS browser!"라는 경고창이 뜬다.
따라서 User-Agent를 SuNiNaTaS로 설정해주면 잘 작동할 것이라고 추측을 하고 아래의 Python code를 작성해서 실행했다.
실행 결과 Auth Key를 얻을 수 있었다.
from urllib import request
from bs4 import BeautifulSoup
def main():
COOKIE = "ASPSESSIONIDASDAQDDD=************************"
url = "http://suninatas.com/Part_one/web04/web04_ck.asp"
header = {"Cookie":COOKIE, "User-Agent" : "SuNiNaTaS"}
val = 0
for i in range(55):
req = request.Request(url, data='total=50'.encode(), headers=header)
res = request.urlopen(req)
soup = BeautifulSoup(res.read())
req = request.Request("http://suninatas.com/Part_one/web04/web04.asp", headers=header)
res = request.urlopen(req)
soup = BeautifulSoup(res.read())
if val == 49:
break
try:
val = int(soup.find("input", {"name":"total"}).get('value'))
except:
print("ERROR!")
return
print(val)
print(soup.find_all("td", class_="table_top")[5].text)
if __name__ == '__main__':
main()
Auth Key : Change your Us3r Ag3ent
반응형
'Hacking > - suninatas.com' 카테고리의 다른 글
| [Web] Level 6 (0) | 2015.10.25 |
|---|---|
| [Web] Level 5 (0) | 2015.10.24 |
| [Web] Level 3 (0) | 2015.10.24 |
| [Web] Level 2 (0) | 2015.10.24 |
| [Web] Level 1 (0) | 2015.10.24 |