INNER CODE UNIT · Python

upload

project-sekai-ctf/sekaictf-2025 · misc/sekai-bank-transaction/challenge/poc-tester/poc-web/src/app.py:69

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.'})

    if Config.ENABLE_POW:
        try:
            solution = request.form.get('solution')
            challenge = Challenge.from_string(session.get('challenge'))

            if not solution or not check(challenge, solution):
                return jsonify({'status': 'error', 'message': 'Incorrect solution!'})

            session.pop('challenge', None)
        except Exception:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…