feat(forensic): hex task and flag accept

This commit is contained in:
2025-04-08 23:34:36 +03:00
parent 16adc1d99e
commit 50946c114b
2 changed files with 22 additions and 15 deletions
+21 -14
View File
@@ -102,31 +102,38 @@ def forensic_task1():
@app.route("/forensic/base-guide", methods=('GET', 'POST'))
def fbase():
flag_task2 = session['flag_task2']
flag_task4 = session['flag_task4']
if request.method == 'POST':
user_flag = request.form['user_flag']
if user_flag == flag_task2:
return render_template('base.html', flag=flag_task2, success_flag='.')
return render_template('base.html', flag=flag_task2, error='Ошибка: неверный флаг!')
if not flag_task2:
session['flag_task2'] = flag_task2 = f'C4TchFl4g{{{hex(getrandbits(45))[2:]}}}'
base32str = str(base64.b32encode(flag_task2.encode()))[2:-1]
if user_flag == flag_task4:
return render_template('base.html', flag=flag_task4, success_flag='.')
return render_template('base.html', flag=flag_task4, error='Ошибка: неверный флаг!')
if not flag_task4:
session['flag_task2'] = flag_task4 = f'C4TchFl4g{{{hex(getrandbits(45))[2:]}}}'
base32str = str(base64.b32encode(flag_task4.encode()))[2:-1]
base64str = str(base64.b64encode(f"Ой-ой, похоже, что самое главное всё ещё зашифровано( {base32str}".encode()))[2:-1]
return render_template('base.html', base_task=base64str)
@app.route("/forensic/.docx_files", methods=('GET', 'POST'))
def fbinwalk():
flag_task2 = 'C4TchFl4g{GT4_6_1eaks}'
flag_task3 = 'C4TchFl4g{GT4_6_1eaks}'
if request.method == 'POST':
user_flag = request.form['user_flag']
if user_flag == flag_task3:
return render_template('binwalk.html', flag=flag_task3, success_flag='.')
return render_template('binwalk.html', flag=flag_task3, error='Ошибка: неверный флаг!')
return render_template('binwalk.html')
@app.route("/forensic/hex", methods=('GET', 'POST'))
def fhex():
flag_task2 = "C4TchFl4g{I_hir3d_7his_c4r_t0_st4r3_4t_Y0u}"
if request.method == 'POST':
user_flag = request.form['user_flag']
if user_flag == flag_task2:
return render_template('binwalk.html', flag=flag_task2, success_flag='.')
return render_template('binwalk.html', flag=flag_task2, error='Ошибка: неверный флаг!')
return render_template('binwalk.html')
@app.route("/forensic/hex")
def fhex():
return render_template('hex.html', flag=flag_task2, success_flag='.')
return render_template('hex.html', flag=flag_task2, error='Ошибка: неверный флаг!')
return render_template('hex.html')
return render_template('hex.html')
@app.route("/forensic/hash")