반응형
rand_str = ""
alphanumeric = string.ascii_lowercase + string.digits
for i in range(4):
rand_str += str(random.choice(alphanumeric))
rand_num = random.randint(100, 200)
@app.route("/", methods = ["GET", "POST"])
def index():
if request.method == "GET":
return render_template("index.html")
else:
locker_num = request.form.get("locker_num", "")
password = request.form.get("password", "")
if locker_num != "" and rand_str[0:len(locker_num)] == locker_num:
if locker_num == rand_str and password == str(rand_num):
return render_template("index.html", result = "FLAG:" + FLAG)
return render_template("index.html", result = "Good")
else:
return render_template("index.html", result = "Wrong!")
locker_num은 소문자나 숫자이고 길이가 4인 랜덤값이다.
password는 100부터 200사이의 숫자이다.
burp suite을 사용해서 Brute forcer을 진행했다.
알파벳과 숫자로 이루어진 4자리 문자열을 찾기는 힘들기 때문에 하나의 문자열씩 진행해야 한다.
첫 번째 진행했을 때 f가 들어갔을 때 길이가 다름을 알 수 있었다.
따라서 locker_num 부분에 f를 추가하고 똑같은 방법으로 burp suite을 실행했다.
이 방법을 4번 진행하면 된다.
locker_num은 fbiy였고 password를 선택하고 다시 실행한다.
숫자와 영역을 설정해준다.
116에서 길이가 다름을 발견했다.
반응형
'Dreamhack > Web' 카테고리의 다른 글
simple_sqli (0) | 2023.11.09 |
---|---|
[wargame.kr] login filtering (0) | 2023.11.09 |
Type c-j (0) | 2023.11.09 |
session-basic (0) | 2023.11.09 |
pathtraversal (0) | 2023.11.09 |