INNER CODE UNIT · Python
index
project-sekai-ctf/sekaictf-2025 · misc/sekai-bank-transaction/challenge/poc-tester/poc-web/src/app.py:59
def index():
challenges = [client.CHALLENGE_NAME for client in clients]
if 'challenge' not in session:
challenge = Challenge.generate(Config.POW_DIFFICULTY)
session['challenge'] = str(challenge)
return render_template('index.html', challenges=challenges)
@app.route('/upload', methods=['POST'])
def upload():
try:
cmd = device.execute_script('echo 1', timeout=3)
if cmd.stdout.decode().strip() != '1':
return jsonify({'status': 'error', 'message': 'Device is not ready! Please come back later.'})
except Exception:
return jsonify({'status': 'error', 'message': 'Device is not ready! Please come back later.'})