RicercaCTF2023 writeup

はじめに 4/22に開催されたRicercaCTF 2023にSUSH1st1として参加して、23位でした。 PwnもWebもあまり解けず悔しかった。 競技中に解いた問題 [pwn 97] BOFSec(107 solves) [web 95] Cat Café(113 solves) [misc 200] gatekeeper(21 solves) 競技後に解いた問題 [web] tinyDB 競技中に解いた問題 [pwn 97] BOFSec 100%本物保証 authored by ptr-yudai 問題概要 ユーザーのis_adminによってフラグがもらえたりもらえなかったりする。 ... //(一部抜粋) typedef struct { char name[0x100]; int is_admin; } auth_t; auth_t get_auth(void) { auth_t user = { .is_admin = 0 }; printf("Name: "); scanf("%s", user....

2023-04-22 · 3 分 · Me

DiceCTF@HOPE

問題 [web]secure-page 以下のところよりadmin = trueであればいいことがわかります。 ... if admin == '': headers['set-cookie'] = 'admin=false' if admin == 'true': return (200, ''' <title>Secure Page</title> <link rel="stylesheet" href="/style.css" /> <div class="container"> <h1>Secure Page</h1> %s</div> ''' % os.environ.get('FLAG', 'flag is missing!'), headers) ... HeaderにCookie: admin=trueを置いてリクエストを叩けばいいです。 curl -H 'Cookie: admin=true' https://secure-page.mc.ax hope{signatures_signatures_signatures} [web]reverser 以下のところでテンプレートインジェクションができそうです。 @app.post('/') def reverse(): ... output = request.form.get('text', '')[::-1] return render_template_string(result % output) outputは逆文字列になることに注意して、書きます。 i = "{{url_for....

2022-07-25 · 3 分 · Me